# Historical stock market data API for US equities

> One-minute bars of every US-listed stock and ETF since 2016, delisted tickers included, raw or split- and dividend-adjusted, with a free daily sample and no key needed to try it.

Source: https://getmarkethistory.com/docs/guides/historical-stock-market-data

`stocks/us` is the equity historical data behind every US-listed stock and ETF that trades on an
exchange (OTC excluded): one-minute OHLCV bars from the US consolidated tape, every US exchange
together, since January 2016. On 2026-11-10 it served 15,760 tickers.
[`/api/v1/stats`](https://getmarkethistory.com/api/v1/stats) gives the live count and the first and last bar.

## Sample request

No key, the newest 100 daily bars of Apple:

```bash
curl https://getmarkethistory.com/api/v1/bars/stocks/us/AAPL/1d
```

With a key, two weeks of one-minute bars around Apple's 2020 split, adjusted, as CSV:

```bash
curl "https://getmarkethistory.com/query/v1/bars/stocks/us/AAPL/1m?start=2020-08-24&end=2020-09-04&adjust=splits&format=csv" \
  -H "Authorization: Bearer $MARKET_HISTORY_KEY"
```

From Python, with the [client](https://getmarkethistory.com/docs/quickstart#4-into-pandas), paging handled for you:

```python
from markethistory import Client

mh = Client()  # reads MARKET_HISTORY_KEY
df = mh.frame(
    "stocks/us", "AAPL", "1m", start="2024-01-01", end="2024-12-31", adjust="all"
)
```

Columns: `timestamp` (bar open, UTC), `open`, `high`, `low`, `close`, `volume`, `vwap`,
`trade_count`, `symbol`, `symbol_id`. A minute with no trade has no bar; nothing is filled in.

## Is there free stock historical data?

Yes, two ways. With no account, the daily bars of any ticker: the newest 100 with no dates, or any
range in the last two years with `start` and `end` (one such request every 30 seconds).
`Client().preview("stocks/us", "AAPL")` does the same from Python. Signed in, a free account gets a
monthly allowance of bars at `1h` and longer over the full history; the amount is on
[pricing](https://getmarkethistory.com/#pricing). One-minute bars need [bought bars](https://getmarkethistory.com/docs/limits#buying-bars).

## Are delisted stocks included?

Yes. Inactive tickers stay in the dataset with their whole history, so a backtest over it is not
limited to the companies that survived. Xilinx, acquired in February 2022, still answers:

```bash
curl https://getmarkethistory.com/api/v1/stocks/us/XLNX
```

That free call lists its one-minute bars from 2016-01-04 to 2022-02-11 and `"status": "inactive"`.
`/api/v1/symbols?dataset=stocks/us&timeframe=1m` lists every ticker with its first and last bar.

## Are prices adjusted for splits and dividends?

Bars are stored raw, as traded, and never rewritten. Add `adjust=splits` for split-adjusted
prices, or `adjust=all` for splits and cash dividends (a total-return view). The splits,
dividends, symbol changes and mergers themselves come from
[corporate actions](https://getmarkethistory.com/docs/corporate-actions), from 2016 on. To reproduce a backtest exactly,
keep the raw bars and the actions you used: an adjusted history changes when a new split lands.

## Which timeframes can I ask for?

Any whole multiple of one minute: `1m`, `5m`, `1h`, `1d`, `1w`, `1M`. Bars hold the regular
session, 09:30 to 16:00 New York, by default, so a `1d` bar closes at the last regular-session
trade; `hours=extended` adds pre-market, after-hours and overnight trading
([Bars](https://getmarkethistory.com/docs/bars#trading-hours) explains it; `tz=UTC` gives UTC days). One exchange's own trades, IEX's, also come as `1s` bars (`feed=iex`),
since May 2017.

## How fresh is it?

A session day is published once it is at least 48 hours old, so the newest bar is one to two days
behind. This is historical data for research and backtests, not a live feed.

## How much does it cost?

One bar is one bar, in every format. A year of Apple at one minute was 187,812 bars in 2024, inside
the smallest purchase (1M bars, $5). `/api/v1/stocks/us/AAPL/cost?timeframe=1m&start=2024-01-01&end=2024-12-31`
answers exactly what a pull bills before you make it, free. See [Limits & billing](https://getmarkethistory.com/docs/limits).
