Get started
Quickstart
Copy a request into your terminal or client to make your first call with the sandbox key.
us:NVDAus:AAPLus:MSFTus:IVVcrypto:BTCUSDTglobal:SHEL.Lglobal:1301.Tglobal:RELIANCE.NSindex:SPX
Make your first call
Read the latest five available daily bars for Nvidia. Copy the example into your terminal.
curl "https://api.quantset.dev/api/v1/prices?ticker=NVDA&limit=5" -H "X-API-Key: mw_demo"
Each row identifies the listing, observation date, currency and adjustment. Use ticker for one listing, such as NVDA or 7203.T, or supply its canonical ID, such as us:NVDA. Use tickers=NVDA,AAPL for batched quotes.
Get price history
The most recent page comes first. Rows in each page are ordered from oldest to newest. US history starts in 1962. Narrow the range with start and end.
curl "https://api.quantset.dev/api/v1/prices?ticker=NVDA&limit=30" -H "X-API-Key: mw_demo"
Listings outside the US use the global: prefix with their exchange suffix and are priced in their local currency.
curl "https://api.quantset.dev/api/v1/prices?ticker=SHEL.L&limit=30" -H "X-API-Key: mw_demo"
Read financial statements
Choose income, balance_sheet or cash_flow, annual or quarterly. Check each row’s currency and availability date. Use as_of to constrain when data was publicly available.
curl "https://api.quantset.dev/api/v1/financial-statements/income?tickers=us:NVDA&period=annual&limit_per_instrument=2" -H "X-API-Key: mw_demo"
Empty means unknown. A value we could not verify comes back as null, never as 0. Treat null as missing in your own calculations.
Get CSV instead of JSON
Add format=csv to a data operation that lists CSV in the reference.
curl "https://api.quantset.dev/api/v1/prices?ticker=AAPL&limit=10&format=csv" -H "X-API-Key: mw_demo"
Read a long history page by page
A response includes next_cursor when there is more to read. Send it back as cursor, together with the same snapshot_id, until it comes back empty. Pages run from the newest bars to the oldest.
import requests BASE = "https://api.quantset.dev" HEADERS = {"X-API-Key": "mw_demo"} params = {"ticker": "NVDA", "start": "2015-01-01", "limit": 500} bars = [] while True: page = requests.get(f"{BASE}/api/v1/prices", params=params, headers=HEADERS, timeout=15) page.raise_for_status() body = page.json() bars = body["data"] + bars if not body["next_cursor"]: break params = {**params, "cursor": body["next_cursor"], "snapshot_id": body["snapshot_id"]} print(len(bars), "bars, oldest first")
Data is published once a night. If a new snapshot lands while you are paging, the API answers 409 and you start that read again, so two nights of data never get mixed.
Authentication
Send your key in the X-API-Key header. Authorization: Bearer works too, and ?apikey= is there for spreadsheets and other tools that cannot set headers. Use one of them per request.
Send a User-Agent with your client’s name. A Cloudflare rejection (HTTP 403, edge code 1010) can arrive as plain text or HTML before the request reaches the API. Include the HTTP status and Cloudflare Ray ID when reporting one.
The sandbox key mw_demo needs no signup and reads sample listings. Create a free account for a key of your own. It comes with 250 free credits that work on every covered listing, plus usage and a log of every request. Paste a key into the key menu in the top bar and every example will use it.
Errors and limits
The sandbox allows 30 requests a minute. Paid plans have a higher limit per minute and no daily limit. Check X-RateLimit-Remaining for throughput and X-Credits-Remaining for your spendable credits. Each endpoint page states its credit price.
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests allowed each minute. |
X-RateLimit-Remaining | Requests left in the current minute. |
X-RateLimit-Reset | When the minute resets, as Unix time in seconds. |
Errors are JSON with a stable code and a detail message. An ambiguous selector returns candidates containing canonical listing IDs.
| Status | What happened | What to do |
|---|---|---|
| 400 | The request carried two different keys. | Send the key one way only. |
| 401 | The key is missing, mistyped or revoked. | Check the key. |
| 402 | The balance cannot cover this request. Nothing was charged. | Add credits in your console, or ask for a smaller page. |
| 403 | The key cannot read this. | The sandbox key covers the sample listings only. Use a personal key. |
| 404 | We do not know that instrument. | Look it up with Search instruments. |
| 409 | A new snapshot was published in the middle of a paged read. | Start that read again. |
| 422 | A parameter is invalid. | The response names the parameter. |
| 429 | A per-second, minute or daily request limit was reached. A 600 RPM key permits 50 requests in one second. | Wait for Retry-After seconds, then resume at a steady pace. The minute can still have capacity after a burst. |
| 503 | The API is briefly unavailable. | Retry after Retry-After. |