CNBC market overview
CNBC's market boards for a region: every index, future, currency, commodity, bond yield or crypto on the board with its full quote (price, change, change %, open, high, low, previous close, 52-week range, volume, extended-hours quote and more), plus the market movers of an index or region: top gainers and losers by % change, or the most active by volume or by volume against the 10-day average. Each mover: rank, symbol, name, link, price, change, change %, previous close, volume, 10-day average volume, P/E, dividend yield, implied volatility, pre-market and after-hours change, 52-week high/low flags and last trade time.
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
region | us | americas | europe | asia | currencies | commodities | bonds | futures | crypto | Which board (default us). Example: us |
movers | sp500 | nasdaq100 | dow30 | us | europe | asia | none | Movers of this index or region (default sp500 for us, europe and asia for those regions, otherwise none). |
rank | change | volume | relative_volume | change (gainers and losers, default), volume (most active) or relative_volume (volume against the 10-day average). |
count | integer | Movers per list (1-25, default 10). |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/cnbc/v1/markets?region=us" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/cnbc/v1/markets",
params={"region": "us"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/cnbc/v1/markets");
url.searchParams.set("region", "us");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).