API Reference: Stock Bars
Details
Docs navigation
- Getting started: Quickstart, Authentication, Rate limits, Errors and retries
- Guides: Symbol formats, Timestamps and time zones, Pagination, Split and dividend adjustments, WebSocket streaming, Dataset downloads, Excel and Google Sheets, Changelog
- API reference: Stock bars (you are here), Stock trades and quotes, Snapshots and movers, Tickers, exchanges, calendar, Splits and dividends, Fundamentals and SEC filings, Options chain and Greeks, Options EOD, bars, OI, Forex, Crypto, Crypto derivatives, Futures bars and continuous, Settlements and COT, Indices, Economic data, Technical indicators
- SDKs: Python, JavaScript
This is the stock bars API endpoint reference: one endpoint for OHLCV bars on US stocks and ETFs, from 1-second bars up to monthly, plus a bulk call that returns the whole market for one day. Use it for charts, backtests and anything that needs price history. Parameters, response fields, examples and endpoint-specific errors are all below.
Early access. Planned v1 endpoint, not live yet. Plan access: Free gets 2 years of daily bars; Starter ($29/mo) full daily history and 15-minute delayed intraday bars with 5 years of minute history; Pro ($79/mo) real time and
1sbars; Business ($249/mo) SIP real time for commercial internal use.
Details
Get bars for one symbol
GET https://api.marketdata.co/v1/stocks/bars
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
symbol |
string | yes | Ticker, e.g. AAPL, BRK.B |
|
interval |
string | no | 1d |
1s, 1m, 5m, 15m, 30m, 1h, 1d, 1w, 1mo |
start |
string | no | 1 year ago | Date or UTC timestamp, inclusive |
end |
string | no | now | Date or UTC timestamp, exclusive |
adjusted |
boolean | no | true |
Split-adjust prices and volume |
session |
string | no | all |
Intraday only: regular, extended (pre and post), or all |
fields |
string | no | all | Comma-separated list of fields to return |
limit |
integer | no | 5,000 | Rows per page, max 50,000 |
cursor |
string | no | From next_cursor of the previous page |
|
sort |
string | no | asc |
asc or desc by time |
format |
string | no | json |
json or csv |
Response fields: daily, weekly, monthly
| Field | Type | Description |
|---|---|---|
symbol |
string | Ticker |
date |
string | Trading date, YYYY-MM-DD, exchange calendar |
interval |
string | 1d, 1w, 1mo |
open, high, low, close |
number | Split-adjusted prices |
volume |
number | Split-adjusted consolidated volume |
vwap |
number | Volume-weighted average price (optional) |
trade_count |
number | Number of trades (optional) |
unadjusted_open, unadjusted_high, unadjusted_low, unadjusted_close, unadjusted_volume |
number | Raw values (optional) |
adjusted_close |
number | Split and dividend adjusted close |
dividend |
number | Cash dividend with ex-date on this day, else 0 |
split_factor |
number | Split ratio effective this day, else 1 |
previous_close |
number | Prior session close (optional) |
change_percent |
number | Close vs previous close, percent (optional) |
exchange |
string | Primary listing MIC, e.g. XNAS |
currency |
string | ISO 4217 code |
Response fields: intraday
| Field | Type | Description |
|---|---|---|
symbol |
string | Ticker |
timestamp |
string | Bar start, ISO 8601 UTC |
interval |
string | 1s to 1h |
open, high, low, close |
number | First, highest, lowest and last trade price |
volume |
number | Shares traded in the bar |
vwap |
number | Volume-weighted average price (optional) |
trade_count |
number | Trades in the bar (optional) |
session |
string | pre, regular, post, overnight |
adjusted |
boolean | Whether prices are split-adjusted |
Example request
Example (curl), one day of NVDA 1-minute bars, regular session:
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.marketdata.co/v1/stocks/bars?symbol=NVDA&interval=1m&start=2026-11-18T14:30:00Z&end=2026-11-18T21:00:00Z&session=regular"
Example (Python):
import os
import requests
import pandas as pd
r = requests.get(
"https://api.marketdata.co/v1/stocks/bars",
headers={"Authorization": f"Bearer {os.environ['MARKETDATA_API_KEY']}"},
params={"symbol": "NVDA", "interval": "1m", "session": "regular",
"start": "2026-11-18T14:30:00Z", "end": "2026-11-18T21:00:00Z"},
)
r.raise_for_status()
bars = pd.DataFrame(r.json()["results"])
Example response
{
"status": "ok",
"count": 390,
"next_cursor": null,
"results": [
{
"symbol": "NVDA",
"timestamp": "2026-11-18T14:31:00Z",
"interval": "1m",
"open": 146.12,
"high": 146.38,
"low": 146.05,
"close": 146.31,
"volume": 412870,
"vwap": 146.22,
"trade_count": 3104,
"session": "regular",
"adjusted": true
}
]
}
Prices shown are illustrative.
Markets
Get the whole market for one day
GET https://api.marketdata.co/v1/stocks/bars/grouped
Returns one daily bar for every US stock and ETF that traded on date. Starter plan and up.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
date |
string | yes | Trading date, YYYY-MM-DD |
|
adjusted |
boolean | no | true |
Split-adjust prices |
asset_type |
string | no | all | common_stock, etf, adr |
limit, cursor, format |
no | As above |
API
Errors for this endpoint
| HTTP | error.code |
When |
|---|---|---|
| 400 | invalid_parameter |
Unknown interval, or session used with a daily interval |
| 400 | range_too_large |
Too long a range for 1s bars in one call; split by day |
| 403 | plan_required |
Intraday bars on Free, 1s bars below Pro, or history beyond your plan |
| 404 | symbol_not_found |
Ticker unknown; check symbol formats |
Watch out
Notes and gotchas
- No bar is emitted for an interval with no trades. Illiquid names will have gaps.
- Bars are stamped at the start of the interval, in UTC. 9:30 New York is
14:30Zin winter and13:30Zin summer. - Daily
volumeis consolidated across all venues, so it will be higher than a single exchange's number. - Weekly bars start on the first trading day of the week; monthly bars on the first trading day of the month.
adjusted=falsereturns prices as printed. Daily bars include both versions anyway; the flag mainly matters for intraday.- Holidays return an empty
resultslist. Check the market calendar.
Keep reading
Next steps
Details
Was this page useful?
[Yes] [No]
Missing a field or interval? Tell us on the custom data form.