# Market History > Historical market data over one REST API, for backtesting and research: OHLCV bars for US stocks and options, FX, crypto spot and perpetuals, commodities, indices, government bonds and yields, overnight rates, volatility indices, equity factors and Russian stocks and futures; one US stock exchange's full order book (L3) and its 1s top of book (L2); and crypto perpetual funding rates. Pay per bar, no subscription. Data is one to two days behind real time: there is no live or streaming feed. Venue depth by price level (`/mbp/`) is being prepared: no session is published yet. - Base URL: https://getmarkethistory.com/. Keyless endpoints live under `/api/v1/`; billed ones under `/query/v1/` with `Authorization: Bearer mh_live_…`. - Try without a key: `curl https://getmarkethistory.com/api/v1/bars/stocks/AAPL/1h` returns the newest 100 hourly bars; add `start`/`end` to page back five years. The L3 and L2 datasets have keyless samples too. - Keys: a person signs in with Google or GitHub at https://getmarkethistory.com/login and creates a key in the dashboard. There is no programmatic sign-up. Details: https://getmarkethistory.com/auth.md. - Formats: `format=jsonl` (default), `json`, `csv`, `parquet`, `arrow`; `mbt1` (compact binary) for bars only. Timestamps are UTC; prices are raw (splits and dividends are a separate free table, applied on request with `adjust=splits` or `adjust=all`). - Paging: `limit` up to 100,000 rows; follow the `X-Next-Cursor` header (or `Link: rel="next"`) until it is absent. Each account: 2 requests in flight, 300 a minute; 30 s per request. - Discovery, no key: `/api/v1/sources` lists the dataset ids each product serves (bars under `sources`; then `l3`, `l2`, `mbp`, `funding`, `prices`, `open_interest`, `corporate_actions`); `/api/v1/symbols` and `/api/v1/stats` list instruments and ranges. - MCP: remote server at https://getmarkethistory.com/mcp (Streamable HTTP; sign in through the client with OAuth, or send `Authorization: Bearer mh_live_…`), billed exactly like `/query/v1/`; setup at https://getmarkethistory.com/docs/mcp.md. - Machine-readable: OpenAPI 3.1 at https://getmarkethistory.com/openapi.json; RFC 9727 API catalog at https://getmarkethistory.com/.well-known/api-catalog. ## Pricing - Unit: the **bar**. A response bills its rows in blocks of 100 bars, rounded up; an empty response is free; errors are free. Every format costs the same. - Other row types bill in bars too: 10 L3 events = 1 bar, 10 depth rows = 1 bar; one L2 row, funding row, price row or open-interest row = 1 bar. Corporate actions are free with any key. - Bought once, never expire, from 1,000,000 bars: graduated bands (0–1,000,000: $5.00 per million; 1,000,000–10,000,000: $3.00 per million; 10,000,000–100,000,000: $1.50 per million; 100,000,000–1,000,000,000: $0.60 per million; beyond 1,000,000,000: $0.25 per million). - Monthly plans (optional): Self-serve $15/month for 10,000,000 bars, Growth $79/month for 100,000,000 bars. Unused plan bars expire at renewal. - Free account: a monthly allowance of 1h bars (amount on the pricing section). Every other timeframe and dataset needs bought bars. ## Coverage Read from `/api/v1/stats` when this file was served. Bars are OHLCV; finer stored timeframes resample to any whole multiple (e.g. 1s → 5m, 1m → 4h). History is only ever extended, never deleted. | Dataset id | What | Stored timeframes | Instruments | First | Last | | --- | --- | --- | --- | --- | --- | | `bonds` | Government bonds | 1m, 1h | 3 | 2017-12-26 | 2026-11-03 | | `commodities` | Commodities | 1m, 1h | 15 | 2003-05-05 | 2026-11-03 | | `crypto` | Crypto | 1s, 1m, 1h | 20 | 2017-08-17 | 2026-11-02 | | `crypto-futures` | Crypto futures | 1m, 1h | 1,014 | 2020-01-01 | 2026-11-02 | | `factors` | Equity factors | 1d | 7 | 1926-11-03 | 2026-09-30 | | `futures-russia` | Russian futures | 1m | 5,886 | 2011-12-19 | 2026-11-03 | | `fx` | FX | 1s, 1m, 1h | 10 | 2016-01-03 | 2026-11-03 | | `fx-crosses` | FX crosses | 1m, 1h | 99 | 2003-08-03 | 2026-11-03 | | `fx-history` | FX, deep history | 1s, 1m, 1h | 66 | 2000-05-30 | 2026-09-30 | | `fx-reference` | FX reference rates | 1d | 41 | 1999-01-04 | 2026-11-03 | | `indices` | Stock indices | 1m, 1h | 21 | 2011-09-18 | 2026-11-03 | | `money-markets` | Overnight rates | 1d | 8 | 1975-01-02 | 2026-11-02 | | `options` | US options | 1m | 933,793 | 2024-02-01 | 2026-11-02 | | `rates` | US government yields | 1d | 14 | 1990-01-02 | 2026-11-03 | | `stocks` | US stocks | 1m | 15,738 | 2016-01-01 | 2026-11-02 | | `stocks-global` | Global stocks | 1m, 1h | 78 | 2018-01-02 | 2026-11-03 | | `stocks-russia` | Russian stocks | 1m | 669 | 2011-12-15 | 2026-11-03 | | `stocks-venue` | US stocks, single venue | 1s, 1d | 13,929 | 2017-05-15 | 2026-11-02 | | `volatility` | Volatility indices | 1d | 26 | 1990-01-02 | 2026-11-03 | | `volatility-futures` | VIX futures | 1d | 175 | 2013-01-02 | 2026-11-02 | | `stocks-venue-l3` | L3 order book (every order event), one US venue | sessions: 6 | | 2026-10-26 | 2026-11-02 | | `stocks-venue-l2` | L2 top of book, 1s, one US venue | sessions: 6 | | 2026-10-26 | 2026-11-02 | ## Endpoints - `GET https://getmarkethistory.com/api/v1/bars/{source}/{ticker}/{timeframe}`: Free 1h sample for one symbol (no key) - `GET https://getmarkethistory.com/api/v1/bars`: Free 1h sample by query (no key) - `GET https://getmarkethistory.com/query/v1/bars/{source}/{ticker}/{timeframe}`: Bars for one symbol (billed) (API key) - `GET https://getmarkethistory.com/query/v1/bars`: Bars by query string (billed) (API key) - `GET https://getmarkethistory.com/api/v1/mbo/{source}/{ticker}`: Free L3 sample for one symbol (no key) - `GET https://getmarkethistory.com/query/v1/mbo/{source}/{ticker}`: L3 order-book events for one symbol (billed) (API key) - `GET https://getmarkethistory.com/api/v1/l2/{source}/{ticker}`: Free L2 sample for one symbol (no key) - `GET https://getmarkethistory.com/query/v1/l2/{source}/{ticker}`: L2 1s top of book for one symbol (billed) (API key) - `GET https://getmarkethistory.com/api/v1/mbp/{source}/{ticker}`: Free depth sample for one symbol (no key) - `GET https://getmarkethistory.com/query/v1/mbp/{source}/{ticker}`: Venue depth (market by price) for one symbol (billed) (API key) - `GET https://getmarkethistory.com/query/v1/funding`: Funding rates of one perpetual (billed) (API key) - `GET https://getmarkethistory.com/query/v1/prices`: Mark, index or premium prices of one perpetual (billed) (API key) - `GET https://getmarkethistory.com/query/v1/open-interest`: Open interest and long/short ratios of one perpetual (billed) (API key) - `GET https://getmarkethistory.com/query/v1/corporate-actions`: Splits, dividends, symbol changes and mergers (free with a key) (API key) - `GET https://getmarkethistory.com/api/v1/sources`: published sources under this root, and the ids serving l3, l2, mbp, funding, prices, open_interest and corporate_actions (no key) - `GET https://getmarkethistory.com/api/v1/timeframes`: timeframes for one source (no key) - `GET https://getmarkethistory.com/api/v1/symbols`: symbol index for one source + timeframe; prefix, limit (no key) - `GET https://getmarkethistory.com/api/v1/stats`: candle, symbol, and byte counts from the symbol index (no key) - `GET https://getmarkethistory.com/api/v1/schema`: bars columns and HTTP output encodings (no key) ## Docs - [Historical market data API docs](https://getmarkethistory.com/docs.md): Query and consume published market-history data. - [Quickstart](https://getmarkethistory.com/docs/quickstart.md): Get a key and make your first Market History request. - [Crypto perpetual funding rate history API](https://getmarkethistory.com/docs/guides/crypto-funding-rates.md): Every funding event of each USD-margined crypto perpetual, delisted contracts included, over a REST API, billed one row per bar. - [Historical forex 1-minute data API](https://getmarkethistory.com/docs/guides/forex-1-minute-data.md): One-minute FX bars over a REST API, for the major pairs since 2000 and for crosses, exotics and metal crosses since 2003. - [Funding-rate carry on perpetuals](https://getmarkethistory.com/docs/guides/funding-carry.md): Measure what a hedged short perpetual earned in funding, priced at the mark, with a rule that steps aside when funding turns negative. - [Reconstruct the top of book from L3 events](https://getmarkethistory.com/docs/guides/l3-top-of-book.md): Replay one session of order-by-order events into a book, read the best bid and offer each second, and check it against the L2 rows. - [Backtest a moving-average strategy](https://getmarkethistory.com/docs/guides/moving-average.md): A 50/200-day crossover on SPY with pandas, on daily bars adjusted for splits and dividends. - [US stocks L3 order book data](https://getmarkethistory.com/docs/guides/us-stocks-l3-order-book.md): One US stock exchange's full order book, order by order (market by order), every session since 2026-10-26, over a REST API with a keyless sample. - [OpenAPI spec](https://getmarkethistory.com/docs/api/openapi.md): The machine-readable Market History API description. - [API reference](https://getmarkethistory.com/docs/api/reference.md): Every Market History HTTP endpoint and parameter. - [Bars](https://getmarkethistory.com/docs/bars.md): OHLCV bars of any ticker, at any timeframe, raw or split- and dividend-adjusted. - [Changelog](https://getmarkethistory.com/docs/changelog.md): Versioned, dated changes to the Market History data contract. - [Corporate actions](https://getmarkethistory.com/docs/corporate-actions.md): Splits, dividends, symbol changes and mergers of US equities, and split- or dividend-adjusted bars on request. - [Datasets — what each one holds](https://getmarkethistory.com/docs/coverage.md): What each dataset holds, how fresh it is, and the caveats that matter for a backtest. - [Venue depth](https://getmarkethistory.com/docs/depth.md): Every price-level change at full depth, with nanosecond timestamps, and the top of book after each event. - [Errors](https://getmarkethistory.com/docs/errors.md): Every status code the Market History API returns, and what a client should do about it. - [Data & formats](https://getmarkethistory.com/docs/formats.md): The bars schema and output encodings Market History publishes. - [Funding rates](https://getmarkethistory.com/docs/funding.md): Every funding event of each crypto perpetual, since its first month. - [L2 top of book](https://getmarkethistory.com/docs/l2.md): One venue's best bid and offer, once a second, every session since the first one published. - [L3 order book](https://getmarkethistory.com/docs/l3.md): Every order-book event, order by order, every session since the first one published. - [Limits & billing](https://getmarkethistory.com/docs/limits.md): How bars are billed, how paging works, and what bars and plans cost. - [MCP server](https://getmarkethistory.com/docs/mcp.md): Connect Claude, Cursor or any MCP client to Market History. Add the URL and sign in in the browser. - [Open interest](https://getmarkethistory.com/docs/open-interest.md): 5-minute open interest and long/short ratios of each crypto perpetual. - [Perpetual prices](https://getmarkethistory.com/docs/perp-prices.md): 1m mark, index and premium prices of each crypto perpetual, since its first month. - [Reliability](https://getmarkethistory.com/docs/reliability.md): The refresh schedule, what "fresh" means per source, and how to reach us when it isn't. - [Privacy Policy](https://getmarkethistory.com/docs/privacy.md): What personal data Market History collects, why, and the rights you have over it. - [Terms of Service](https://getmarkethistory.com/docs/terms.md): The terms that govern accounts, billing, and use of Market History data. ## Optional - [Complete documentation](https://getmarkethistory.com/llms-full.txt): every docs page above in one Markdown file - [Live coverage](https://getmarkethistory.com/coverage): per-instrument ranges, read from the API - [Status](https://getmarkethistory.com/status.json): freshness of each dataset, JSON