Trading API vs Market Data API: Key Differences
A trading API acts on your brokerage account; a market data API answers price questions under exchange licensing. Where the line sits, and which one you need.
A trading API acts on a brokerage account. A market data API answers questions about prices. The trading API vs market data API distinction matters from your first hour of building: the two use different credentials, and only one of them arrives with exchange licensing attached.
Trading API vs market data API: where the line sits
A market data API is a read interface over prices. You ask for a quote, a trade print, a daily bar or an options chain, and it answers. Nothing you send changes the state of any account. Its rules come from the venues that produced the numbers: an exchange licenses its feed, and the licence travels with the data into your app.
A trading API is a write interface over one account. Every call is an instruction: buy this, cancel that. Its rules come from the broker, which carries the regulatory obligation for whatever your code sends. Broker checks run before the order leaves: buying power, position limits, restricted lists, order type validity.
One practical result. A data key is open to anyone who registers for one. A trading API needs a funded account at that specific broker plus a per-account authorisation.
What a market data API gives you
Four shapes of answer cover most of what a data API serves:
- Snapshots: the current or last known quote and trade.
- History: bars by minute, hour or day, plus tick level quotes and trades.
- Reference data: splits, dividends, listings, filings.
- Derived series: implied volatility, short interest, valuation ratios.
The cheapest shape to work with is the end of day bar: one row per name per session. A month of it for a few names fits on one screen, which is where most screeners live.
| symbol | session_count | avg_dollar_volume_millions | up_session_pct |
|---|---|---|---|
| SPY | 21 | 34263 | 33.3 |
| NVDA | 21 | 25155.7 | 38.1 |
| AAPL | 21 | 14150.2 | 42.9 |
| MSFT | 21 | 10703.8 | 52.4 |
| KO | 21 | 1360.7 | 33.3 |
The exact SQL behind every number
SELECT
ticker AS symbol,
count() AS session_count,
round(avg(toFloat64(close) * volume) / 1e6, 1) AS avg_dollar_volume_millions,
round(100 * countIf(close > open) / count(), 1) AS up_session_pct
FROM global_markets.stocks_daily_aggs
WHERE ticker IN ('AAPL', 'KO', 'MSFT', 'NVDA', 'SPY')
AND date >= '2026-09-01'
AND date < '2026-10-01'
GROUP BY ticker
ORDER BY avg_dollar_volume_millions DESCSPY printed 21 sessions in September 2026 and averaged the largest turnover of the group at $34263 million a session, against $1360.7 million for KO. No brokerage account touched any of that, and nothing in the panel can place an order.
A free stock market data API usually starts here, with delayed or end of day coverage, since those carry the lightest licence terms. The venues rarely sell to individuals directly: do NYSE and Nasdaq have public APIs covers who actually distributes a feed.
What a trading API gives you
A trading API covers order entry, cancel and replace, order status, positions and balances. Most also stream fills, and many offer a paper trading mode that mirrors the same endpoints against simulated money.
What it does not reliably give you is price history. Quotes returned beside an order exist to support that order, not to populate a chart. Your own fills are account records about you. The quote screen next to them is licensed exchange content, governed by a different document even when one key fetches both.
Authentication: API key versus OAuth and account linkage
Data APIs mostly authenticate with a long lived key or bearer token in a header. One key, one developer, no notion of whose money is involved.
Trading APIs authenticate an account holder. The usual pattern is OAuth 2.0: the owner is redirected to the broker, signs in with their own credentials and a second factor, then grants your application scoped access to one account number. You receive a short lived access token and a refresh token, often with a daily re-authorisation step.
That asymmetry is the whole lesson. A data key identifies a developer. A trading token identifies a person with money at stake, which is why it expires faster and why revoking it sits in the account owner's hands rather than yours.
Rate limits versus order throttles
Both sides meter you, and they meter different things. On the data side the published limit is requests per interval and concurrent connections, sometimes with a cap on symbols per subscription. The deeper constraint is that top of book changes faster than a polling loop can ask about it. The panel below buckets one session of AAPL quote messages by New York clock hour on a pinned past date, Wednesday 16 September 2026, so the counts stay put.
| et_hour | quote_count | distinct_quote_count | updates_per_second |
|---|---|---|---|
| 09:00 | 104377 | 5955 | 29 |
| 10:00 | 80296 | 1546 | 22.3 |
| 11:00 | 69167 | 1337 | 19.2 |
| 12:00 | 43725 | 794 | 12.1 |
| 13:00 | 43605 | 627 | 12.1 |
| 14:00 | 122503 | 2377 | 34 |
| 15:00 | 164419 | 1735 | 45.7 |
| 16:00 | 936 | 240 | 0.3 |
The exact SQL behind every number
SELECT
formatDateTime(
toStartOfHour(toTimeZone(sip_timestamp, 'America/New_York')),
'%H:%i') AS et_hour,
count() AS quote_count,
uniqExact(bid_price, ask_price) AS distinct_quote_count,
round(count() / 3600, 1) AS updates_per_second
FROM global_markets.cache_stocks_quotes
WHERE ticker = 'AAPL'
AND sip_timestamp >= '2026-09-16 13:00:00'
AND sip_timestamp < '2026-09-16 21:00:00'
GROUP BY et_hour
ORDER BY et_hourIn the hour beginning 09:00 ET, which contains the 9:30 a.m. open, the stream carried 104377 quote messages, about 29 every second, across 5955 distinct bid and ask combinations. In the hour beginning 16:00 ET, following the 4 p.m. close, it carried 936. The shape of that line is the argument for streaming: a once-per-second request sees one message a second and never learns what happened in between.
On the order side the meter is orders per second per account and open order counts, plus outright rejection of apparent duplicates. A rejected data request can be retried for free. A retried order can double a position, which is why order APIs hand you a client order id. Send the same id twice and the broker treats it as one instruction.
REST pull versus streaming push
Historical data is a pull: ask for a range, get rows, finished. Live data is a push. You open a WebSocket or similar stream, subscribe to symbols, and messages arrive on the venue's schedule rather than yours. A live view built on polling is always slightly stale, and the staleness is invisible from inside your own code. Order flow splits the same way: submission is a request with a response, while fills arrive whenever they arrive. The order side also carries a state machine with no data side analogue, running from accepted through partially filled, replaced, cancelled, rejected and expired.
Why broker data comes with display restrictions
A broker's market data feed is a byproduct of the brokerage relationship. The broker holds exchange agreements covering data shown to its own customers, and that footing is what your access rests on. Terms commonly attached: display to the authenticated account holder only, no redistribution to third parties, no bulk storage or export, and delayed rather than real time until the holder signs the exchange agreements directly.
That combination makes broker data excellent for a private tool and unusable for a public product, even where it costs nothing. Market data licensing for app developers walks through the agreement types.
The licensing asymmetry: paperwork lands on the data side
Redistribution means showing data to anyone other than yourself, and it is the line that turns a hobby key into a licensing conversation. Professional versus non professional market data status turns on job function and business use rather than portfolio size, and it sets the per-user fee. Display versus non-display use separates a human reading a number on a screen from a machine consuming the same number inside a model.
None of that applies to orders. No exchange bills a monthly per-user fee for the privilege of sending one, and your own order is not somebody else's licensed content. The order side has its own gates, approval levels and margin agreements, which govern what you are allowed to trade rather than who is allowed to look.
Three worked scenarios
A daily screener
Ranking a universe once a day on end of day prices or fundamentals needs a market data API only. No account is involved, and end of day data carries the mildest licence terms on offer. One API suffices. The moment that screener grows a one-click buy button, a trading API joins it.
A live portfolio dashboard
Showing what you hold and what it is worth needs both. Holdings, cost basis, cash and buying power come from the trading API. The marks that value them come from a data API. For a dashboard only you will ever see, a broker feed covers the data half. For one with other users, that half needs a licence of its own.
An automated strategy
A strategy that acts on a price needs both, and it needs them to agree. The data API supplies the quote the logic reads. The trading API sends the order and reports what filled. The distance between those two numbers starts with the bid ask spread, which the data side reports and the order side pays.
| symbol | avg_spread_bps | quote_count |
|---|---|---|
| MSFT | 2.51 | 226336 |
| KO | 1.48 | 238945 |
| AAPL | 1.34 | 624488 |
| NVDA | 0.87 | 2165073 |
| SPY | 0.33 | 2958765 |
The exact SQL behind every number
SELECT
ticker AS symbol,
round(10000 * avg(
toFloat64(ask_price - bid_price)
/ toFloat64((ask_price + bid_price) / 2)), 2) AS avg_spread_bps,
count() AS quote_count
FROM global_markets.cache_stocks_quotes
WHERE ticker IN ('AAPL', 'KO', 'MSFT', 'NVDA', 'SPY')
AND sip_timestamp >= '2026-09-16 13:00:00'
AND sip_timestamp < '2026-09-16 21:00:00'
AND bid_price > 0
AND ask_price > bid_price
GROUP BY ticker
ORDER BY avg_spread_bps DESCOn the same pinned session, with crossed and zero-bid quotes skipped, MSFT quoted the widest average spread of the five at 2.51 basis points of the midpoint. A basis point is one hundredth of one percent. The tightest was SPY at 0.33. A strategy priced off the midpoint assumes it can trade there. The order side settles whether it did. Agentic trading bots on retail brokerages covers how the two halves get wired together on a retail account.
FAQ
Can one API do both trading and market data?
Some brokers expose both behind a single credential, and some data vendors partner with a broker to look like one product. The halves stay legally separate. The data half still arrives with display and redistribution terms even where the order half is wide open to you.
Do I need a trading API to build a stock screener?
No. A screener reads prices and fundamentals and places no orders, so a market data API alone covers it. A trading API becomes necessary only when the screener acts on one of its own results.
Does professional versus non-professional status apply to a trading API?
No. It is a market data classification that sets per-user data fees, and it turns on job function and business use. Order access is gated by account approvals and margin paperwork instead.
Why is my broker's data free when vendor data is not?
The broker's feed reaches you under the broker's own exchange agreements, for the benefit of its customers, with display restrictions as the trade. A vendor selling data you may redistribute passes through exchange fees you would otherwise owe directly. As of October 2026 that split still describes the market.
Every panel here ships the exact SQL beneath it, so each count can be checked line by line. To ask the same price questions in plain English, bring them to the Strasmore terminal.