Get Company Prices
GET/v1/stockmarket/companies/{ticker}/prices
Historical OHLC price series for charts. We hold **daily** OHLCV, so intervals are ``1d`` (default) or ``1wk`` (resampled from daily) — open to every tier. ``range=1D`` (``interval=15m``) is real intraday data for **S&P 500 + ASX 200 only**, gated to paid tiers (free-tier keys get a 403 upsell); every other ticker returns an honest empty series, not an error. The window is anchored to the most recent available bar/session (not wall-clock now) so series stay correct when the latest data is a few days stale, or when a market is currently closed. **Price basis** (see ``adjustment`` in the response): - ``open`` / ``high`` / ``low`` / ``close`` are **adjusted for splits and dividends**. - ``close_split_adjusted`` is the close **adjusted for splits only**. It is on the same basis as ``price`` and ``prev_close`` from ``/companies/quotes``. - A split rescales every earlier bar of both closes; a dividend lowers every earlier ``close`` and leaves ``close_split_adjusted`` unchanged. When either happens, the whole series is refetched and replaced, so the history is always on one basis. - ``volume`` is split-adjusted. Intraday (``range=1D``) bars are as traded.
Price
$0.01/ callEdge cache
300s
Uptime 24h
100.00%
p95
346ms
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| ticker* | path | string | |
| range | query | string = 1M | Time range: 1W, 1M, 3M, 6M, 1Y, 5Y, MAX |
| interval | query | string = 1d | Bar interval: 1d or 1wk |
| exchange | query | string | Exchange of the listing (e.g. ASX, NYSE). Only needed when the same code trades on several exchanges; also accepted as ASX:CAT or CAT.AX. |
Code
# 1. No key, no payment: the gateway answers 402 with the price
curl -i "https://api.realtimeapi.ai/v1/stockmarket/companies/AAPL/prices"
# 2. Pay: retry with a signed x402 payment (any x402 client builds this header)
curl "https://api.realtimeapi.ai/v1/stockmarket/companies/AAPL/prices" -H "PAYMENT-SIGNATURE: $X402_PAYMENT"// npm i @x402/fetch @x402/core @x402/evm viem
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = x402Client.fromConfig({ schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(privateKeyToAccount(PRIVATE_KEY)) }] });
const pay = wrapFetchWithPayment(fetch, client);
const data = await (await pay("https://api.realtimeapi.ai/v1/stockmarket/companies/AAPL/prices")).json();
console.log(data);# pip install x402 eth-account requests
from eth_account import Account
from x402.clients.requests import x402_requests
session = x402_requests(Account.from_key(PRIVATE_KEY))
print(session.get("https://api.realtimeapi.ai/v1/stockmarket/companies/AAPL/prices").json())curl "https://api.realtimeapi.ai/v1/stockmarket/companies/AAPL/prices" -H "X-API-Key: $RTAPI_KEY"Frequently asked questions
How do I get get company prices from StockMarketAPI?
Send GET https://api.realtimeapi.ai/v1/stockmarket/companies/{ticker}/prices. Pay $0.01 per request with x402, or send an X-API-Key header.
What does GET /companies/{ticker}/prices cost?
$0.01 per successful request in USDC on Base. Failed requests are never charged.
Can I call this endpoint from an MCP client?
Yes. Connect any MCP client to the RealtimeAPI server and use call_feed with this endpoint's URL, or get_quote to check the price first.