# Quickstart

> Make your first QuantSet API call in a minute with the free sandbox key.

Canonical URL: https://quantset.dev/docs/quickstart
Full LLM API Contract: https://api.quantset.dev/llms-full.txt

> ## For AI agents
> The QuantSet API is at https://api.quantset.dev. Send the key in the `X-API-Key` header. The sandbox key `mw_demo` needs no signup and reads the sample listings.
> No key yet? An agent can open an account on its own: https://api.quantset.dev/skill.md
> Connect an MCP client to https://api.quantset.dev/mcp. Client setup is at https://api.quantset.dev/agents.md.
> Start with https://api.quantset.dev/llms.txt or read the full reference at https://api.quantset.dev/llms-full.txt. The OpenAPI file is https://api.quantset.dev/openapi.json. Add `.md` to any docs URL to get that page as Markdown.

Copy a request into your terminal or client to make your first call with the sandbox key.
          

          
            

## 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](https://quantset.dev/signup) 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](/pricing) 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](/docs/api) 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](https://quantset.dev/account/plan), 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](/docs/api/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`. |
              
            
          

          

## Where to go next

          
            [All endpointsEvery dataset, with parameter definitions, examples and response schemas.](/docs/api)
            [AI agentsConnect Claude, Cursor or your own agent. Works with the sandbox key.](/docs/agents)
            [SpreadsheetsPull the data into Google Sheets or Excel.](/docs/spreadsheets)
            [Switch from FMPKeep your code. Change the host and the key.](/docs/switch/fmp)

---

## QuantSet Ecosystem & Integrations (https://quantset.dev/integrations)

- **MCP Clients & 7 Skills:** `npx quantset init` & `npx skills add quantset/skills` (Claude, Claude Code, Cursor, ChatGPT, Codex, Hermes, OpenClaw, Block Goose, Cline, Docker MCP Toolkit — `https://api.quantset.dev/mcp`)
- **Python SDK & Agent Frameworks:** `pip install "quantset[pandas]"` · `from quantset.tools import build_agent_functions, langchain_tools, crewai_tools` (PydanticAI, LangGraph, LangChain, CrewAI, Agno, AutoGen, Google ADK, OpenAI Agents SDK)
- **TypeScript SDK & Vercel AI / Mastra:** `npm install quantset` · `import { createQuantsetTools } from "quantset/tools"` (Node 20+, Bun, Deno, Cloudflare Workers, Vercel Edge)
- **Spreadsheets & Workspaces:** Google Sheets (`=QUANTSET()` & `=IMPORTDATA()`), Microsoft Excel Power Query (`?format=csv`), Notion MCP & n8n/Make webhooks (`https://quantset.dev/docs/guides/google-sheets-excel-notion-stock-templates`)
- **Drop-In Migrations & Machine Payments:** FMP `/stable/*` & `/v3/*` adapter (`https://quantset.dev/docs/switch/fmp`), `yfinance` migration (`https://quantset.dev/docs/switch/yfinance`), autonomous signup (`https://api.quantset.dev/skill.md`), and `x402` Base USDC.
