Free Intraday Stock Data API
Options, Limits & Setup免费盘中股票数据 API
选择、限制与接入
Find a free API for intraday OHLCV data, understand what “free” really includes, and build a prototype that can survive rate limits and stale bars.
找到可获取盘中 OHLCV 数据的免费 API,弄清“免费”服务的实际范围,
并构建能应对请求频率限制和 K 线数据延迟的原型。
TL;DR核心摘要
A free intraday stock data API is usually best for prototypes, education, research, and low-frequency dashboards.
“Intraday” describes bar frequency, not necessarily real-time delivery. Verify delay and exchange entitlement.
One symbol at a five-minute interval can consume hundreds of calls per day without batching or caching.
Reject duplicate timestamps, missing bars, invalid OHLC relationships, and data outside the intended session.
免费盘中股票数据 API 通常适合原型开发、教学、研究和低频更新的仪表盘。
“盘中”描述的是 K 线周期,并不代表数据一定会实时送达;还需核实数据延迟和交易所行情使用权限。
如果不使用批量请求或缓存,即使只跟踪一个标的并每五分钟请求一次数据,每天也可能产生数百次 API 调用。
应剔除时间戳重复、K 线缺失、开盘价、最高价、最低价与收盘价之间的关系异常,以及目标交易时段以外的数据。
Use intraday bars when the decision depends on activity inside the trading day but does not require every quote or trade event. Five- or fifteen-minute bars can support charting, signal research, and low-frequency screening; one-minute or second bars need tighter definitions, greater history, and more rigorous correction handling. If the strategy models order placement, queue position, or spread crossing, aggregated OHLCV alone is insufficient and quote or trade data is required.
当决策依赖交易日内的价格变化,但不需要每次报价或逐笔成交时,可以使用盘中 K 线。五分钟或十五分钟 K 线适合图表、信号研究和低频筛选;一分钟或秒级 K 线则需要更严格的字段定义、更长的历史留存和更完善的更正处理。如果策略要模拟下单、排队位置或跨越买卖价差,聚合 OHLCV 本身并不够,还需要报价或逐笔成交数据。
Define the intraday data you actually need先明确实际需要的盘中数据
Before choosing a provider, write down the market, symbols, bar interval, session, history depth, acceptable delay, and expected request volume. These requirements determine whether a free plan is viable.
选择数据供应商前,先明确目标市场、标的代码、K 线周期、交易时段、历史数据深度、可接受的数据延迟和预期请求量。这些条件决定免费套餐是否可行。
OHLCV bars summarize activity over an interval. A latest quote exposes bid and ask. Trades expose individual executions. Do not choose an endpoint before deciding which object the product needs.
A one-minute bar can still arrive many minutes late. Treat interval, publication delay, and polling frequency as separate fields.
Specify whether a timestamp marks bar start or end, how events exactly on a boundary are assigned, whether intervals are fixed in exchange time, and how early closes or session breaks shorten the series.
Separate pre-market, regular, closing auction, and after-hours activity. A daily chart assembled from all sessions can differ materially from one based only on regular trading hours.
Confirm which trades are eligible, how corrections and late reports are handled, whether empty intervals are emitted, how volume is counted, and whether bars are adjusted for splits.
Free APIs often retain daily data longer than minute data. Calculate the earliest required date, intervals, symbols, rows, pagination, and whether expired or delisted tickers remain queryable.
Store exchange event time, bar publication or revision time, provider retrieval time, timezone, session, delay class, and dataset version so a historical signal can be reproduced.
OHLCV K 线汇总一个周期内的交易活动;最新报价包含当前买价和卖价;逐笔成交数据则记录每一笔实际成交。应先明确产品需要哪一类数据,再选择相应的 API 端点。
即使是一分钟 K 线,数据也可能延迟数分钟才送达。应分别记录 K 线周期、数据发布延迟和轮询频率,不要将三者混为一谈。
说明时间戳代表 K 线开始还是结束,恰好落在边界上的成交归入哪个区间,区间是否按交易所时间固定划分,以及提前收盘或盘中休市如何缩短序列。
分别处理盘前、常规时段、收盘集合竞价和盘后交易。把所有时段合并生成的日内图表,可能与仅使用常规交易时段的结果明显不同。
确认哪些成交可以纳入、如何处理更正和延迟报告、是否生成空区间、成交量如何统计,以及 K 线是否按拆股进行复权。
免费 API 通常对日线数据保留更久,对分钟数据保留较短。应计算最早日期、周期、证券数量、记录量和分页,并确认已退市证券是否仍可查询。
保存交易所事件时间、K 线发布或修订时间、服务商获取时间、时区、交易时段、延迟类别和数据集版本,使历史信号能够复现。
A fixed bar-construction example makes provider differences visible. Assume a regular-session five-minute interval is defined as [09:30:00, 09:35:00) in America/New_York, so the start is included and the end is excluded. Four eligible trades arrive inside that interval:
固定的 K 线构造样本能够直观暴露供应商差异。假设常规交易时段的一根五分钟 K 线定义为纽约时间 [09:30:00, 09:35:00),即包含起点但不包含终点。区间内共有四笔符合条件的成交:
| Exchange time交易所时间 | Price价格 | Size成交数量 | Bar roleK 线作用 |
|---|---|---|---|
09:30:12 | $100.00 | 100 | Open and first eligible trade开盘价与首笔有效成交 |
09:31:40 | $100.20 | 50 | High最高价 |
09:33:05 | $99.90 | 200 | Low最低价 |
09:34:58 | $100.10 | 150 | Close and final eligible trade收盘价与最后一笔有效成交 |
Expected bar: O=100.00, H=100.20, L=99.90, C=100.10, V=500. Trade-weighted VWAP is (100.00×100 + 100.20×50 + 99.90×200 + 100.10×150) ÷ 500 = 100.01. A trade stamped exactly 09:35:00 belongs to the next interval under this convention. If the provider uses end-labelled timestamps, the returned timestamp may be 09:35 even though the underlying interval began at 09:30; the response must state which convention applies.
预期 K 线:开=100.00,高=100.20,低=99.90,收=100.10,量=500。按成交量加权的 VWAP 为 (100.00×100 + 100.20×50 + 99.90×200 + 100.10×150) ÷ 500 = 100.01。按照上述约定,时间恰好为 09:35:00 的成交应归入下一周期。如果供应商用区间结束时间标记 K 线,返回时间可能写成 09:35,尽管底层区间从 09:30 开始;响应必须明确采用哪种标记方式。
| Missing-looking state看似缺失的状态 | Evidence to check需要检查的证据 | Safe representation稳妥表示方式 |
|---|---|---|
| No eligible trade没有有效成交 | Market open, symbol active, feed healthy, but no qualifying trade occurred.市场已开、证券有效、数据源正常,但该周期没有符合规则的成交。 | Omit the bar or emit an explicitly empty bar according to the documented contract; never invent volume.按契约省略该 K 线,或明确返回空 K 线;不能虚构成交量。 |
| Trading halt停牌 | Exchange status shows a halt covering the interval.交易所状态显示该周期处于停牌。 | Preserve a halt state and its effective times, not a generic data error.保存停牌状态及其生效时间,不能记成普通数据错误。 |
| Market closed市场休市 | Exchange calendar shows a holiday, weekend, session break, or early close.交易所日历显示节假日、周末、盘中休市或提前收盘。 | No expected slot; do not create a missing-data alert.该时段本就不存在预期 K 线,不应触发缺失数据告警。 |
| Feed or backfill gap数据流或回填缺口 | The calendar expects a bar and nearby activity exists, but the requested page or stream segment is absent.交易日历预期存在 K 线,邻近周期也有交易活动,但分页或数据流片段缺失。 | Mark incomplete, retry safely, and block research release until reconciled.标记为不完整,安全重试,并在勾稽完成前阻止研究数据发布。 |
| Current partial bar当前未完成 K 线 | The interval end has not occurred or the provider has not finalized corrections.周期尚未结束,或供应商尚未完成更正。 | Expose is_final=false; do not let it trigger a confirmed historical signal.返回 is_final=false,不能让它触发已确认的历史信号。 |
Store both UTC and an IANA exchange timezone such as America/New_York. The local 09:30 open maps to different UTC times before and after daylight-saving changes, while the local session definition remains stable. Do not hard-code one UTC offset for an entire history; generate expected slots from the exchange calendar and timezone database.
应同时保存 UTC 时间与 America/New_York 这类 IANA 交易所时区。夏令时切换前后,当地 09:30 开盘对应不同 UTC 时间,但本地交易时段定义保持不变。不能为整段历史固定使用一个 UTC 偏移量;预期 K 线时点应结合交易所日历和时区数据库生成。
Free intraday stock data API options免费盘中股票数据 API 有哪些选择
| Option服务 | Intraday capability盘中数据能力 | Free-tier fit免费套餐适用场景 | Verify before use使用前需核实 |
|---|---|---|---|
| Alpha Vantage | Intraday OHLCV intervals from 1 to 60 minutes; recent compact output is documented.提供 1 至 60 分钟周期的盘中 OHLCV 数据;官方文档说明精简输出模式可返回近期数据。 | Useful for small prototypes under a low daily request ceiling.适合每日 API 调用量不高的小型原型。 | Realtime and delayed U.S. entitlements, daily quota, history depth.美国市场实时与延迟行情权限、每日请求额度及历史数据深度。 |
| Twelve Data | Unified time-series API with intraday intervals and broad instrument coverage.提供统一的时间序列 API,支持多种盘中周期,并覆盖多类金融标的。 | Good for testing a normalized schema and multi-market discovery.适合验证统一的数据结构,并查找不同市场中可用的金融标的。 | Current plan credits, exchange access, delay, and commercial rights.当前套餐的 API 积分额度、交易所数据权限、数据延迟及商业使用许可。 |
| Broker sandbox券商模拟环境 | Quotes and bars may be bundled with a paper-trading or brokerage account.模拟交易账户或券商账户可能附带报价与 K 线数据。 | Best when the eventual product also submits orders.如果最终产品还需要提交订单,这类方案最为合适。 | Account eligibility, market subscriptions, redistribution, uptime.开户资格、行情订阅要求、数据再分发权限及服务可用性。 |
| Marketstack | Intraday endpoints exist, but its official FAQ places intraday access above the free end-of-day plan.虽然提供盘中数据端点,但官方常见问题说明,免费套餐仅涵盖日线数据;盘中数据需使用更高级别的套餐。 | Free plan is better treated as an end-of-day evaluation path.免费套餐更适合用于评估日线数据。 | Do not assume a “free API” marketing label includes intraday access.不要因为宣传中写有“免费 API”,就默认其中包含盘中数据访问权限。 |
After shortlisting providers, run a fixed acceptance backfill rather than comparing documentation alone. Request the same liquid stock, thin stock, recent IPO, ticker change, split date, early-close session, and after-hours period at two intervals. Reconcile expected versus returned bars, timestamps, session membership, OHLC relationships, volume, duplicates, revisions, pagination, and quota consumed.
筛选出候选服务商后,应执行固定的验收回填,而不是只比较文档。使用两种 K 线周期查询同一组样本:高流动性股票、低流动性股票、新近 IPO、代码变更、拆股日期、提前收盘日和盘后时段,并核对预期与实际 K 线数量、时间戳、交易时段归属、OHLC 逻辑、成交量、重复记录、修订、分页和配额消耗。
Fingerprint request parameters and store untouched responses, headers, retrieval times, cursors, and provider version before normalization.
Map ticker, exchange, share class, currency, and effective dates to one listing identity; do not merge same-text symbols across venues.
Check high ≥ open and close, low ≤ open and close, nonnegative volume, unique timestamps, expected calendar slots, currency, session, and split continuity.
Checkpoint by symbol and bounded date window, retry only safe failures, preserve missing-page evidence, and mark an incomplete series instead of silently analyzing it.
Record source versions, revisions, normalization code, adjustment method, session policy, and exclusions beside every model or backtest result.
先为请求参数生成指纹,并保存未经改写的响应、响应头、获取时间、游标和服务商版本,再进行标准化。
将股票代码、交易所、股份类别、币种和有效日期映射到同一上市实体,不能合并不同场所中名称相同的代码。
检查最高价不低于开盘和收盘、最低价不高于开盘和收盘、成交量非负、时间戳唯一,并核对交易日历时点、币种、时段和拆股连续性。
按证券和有限日期窗口保存检查点,只对安全的失败进行重试,保留分页缺失证据,并明确标记不完整序列,不能静默送入分析。
在每个模型或回测结果旁记录数据来源版本、修订、标准化代码、复权方法、交易时段政策和排除项。
Use QVeris to discover market data capabilities使用 QVeris 查找市场数据能力
Provider plans change. QVeris gives agents and developers a discovery layer for inspecting market data tools and routing requests through callable capabilities instead of hardcoding one vendor too early.
供应商套餐会发生变化。QVeris 为智能体和开发者提供一个发现层,用于查看市场数据工具,并通过可调用的能力路由请求,无需过早在代码中绑定单一供应商。
- Search for stock, quote, and intraday time-series capabilities by outcome.
- Inspect inputs, provider metadata, and response shape before wiring an agent workflow.
- Keep validation, caching, licensing checks, and production monitoring in your application.
- 按所需结果查找股票数据、报价和盘中时间序列能力。
- 将工具接入智能体工作流前,先查看输入参数、供应商元数据和响应结构。
- 数据校验、缓存、授权许可核查和生产环境监控仍需由应用侧负责。
QVeris can simplify discovery and request routing across intraday capabilities. The application still owns interval definitions, session policy, stable identifiers, historical backfill, bar validation, adjustment choices, data versioning, licensing, and production monitoring.
QVeris 能够简化盘中数据能力的查找与请求路由,但 K 线周期定义、交易时段政策、稳定证券标识、历史回填、K 线验证、复权选择、数据版本、许可和生产监控,仍由应用方负责。
FAQ常见问题
Not necessarily. Intraday refers to intervals within a trading day; delivery may be historical, delayed, or real time depending on the plan and exchange entitlement.
At minimum: symbol, timestamp, interval, open, high, low, close, and volume, plus timezone or exchange context.
不一定。“盘中”仅表示数据采用交易日内的时间周期,并不代表数据会实时更新。具体提供历史数据、延迟数据还是实时数据,取决于所用套餐和交易所行情权限。
至少应返回标的代码、时间戳、K 线周期、开盘价、最高价、最低价、收盘价和成交量,并提供时区或所属交易所信息。
The security may not have traded, the provider may omit empty intervals, the market may be closed or halted, the symbol may be wrong, or the backfill may be incomplete. Use calendar and status data before filling gaps.
Not automatically. Forward filling creates a synthetic price and may invent liquidity. Preserve the missing state; if a model requires filling, document the rule and keep a flag.
Policies vary. Some providers adjust history, some return raw bars, and some expose a separate factor. Retain corporate-action events and test a known split across every interval used.
Only approximately. They hide quote spreads, event order, available size, and within-bar path. Execution-sensitive research usually needs quote or trade events and explicit fill assumptions.
证券可能没有成交,服务商可能省略空区间,市场可能休市或停牌,代码可能错误,历史回填也可能不完整。填补缺口前,应先检查交易日历和市场状态。
不能自动这样做。向前填充会制造一个合成价格,也可能虚构流动性。应保留缺失状态;模型确实需要填充时,必须记录规则并设置标记。
各服务商政策不同:有些调整历史数据,有些返回原始 K 线,还有些单独提供因子。应保留公司行为记录,并用已知拆股日期测试所有使用的周期。
只能近似模拟。它隐藏买卖价差、事件顺序、可成交数量和区间内路径。对执行敏感的研究通常需要报价或逐笔成交事件,并明确成交假设。
