Stock Data Developer Guide股票数据开发指南

Choose a Free Stock Ticker API
That Fits Your App
选择适合应用的
免费股票代码 API

Build reliable symbol search with exchange-qualified identity, ticker-change history, delisted listings, and mappings that survive provider changes.

围绕交易所身份、代码变更、退市记录和稳定映射构建可靠查询,
避免供应商变化破坏自选股与历史数据。

Hand-drawn free stock ticker API workflow from symbol search to exchange-qualified identity, validation, mapping, and free-tier checks

TL;DR核心摘要

Ticker is not identity

A ticker such as ABC can exist on more than one exchange. Store an exchange-qualified identifier alongside the display symbol.

Validate before quoting

Resolve aliases, share classes, inactive listings, and exchange suffixes before requesting a price.

Check quote freshness

A successful response may still be delayed or stale. Read the market, session, currency, and timestamp.

Design for free limits

Cache symbol metadata, coalesce quote requests, and isolate the provider behind a small adapter.

代码不等于唯一身份

同一个股票代码可能出现在多个交易所,因此还应保存包含交易所信息的标识。

报价前先验证

请求价格前先处理别名、不同股类、停牌或退市状态,以及交易所后缀。

核对报价新鲜度

请求成功不代表数据实时,还要读取市场、交易时段、币种和时间戳。

围绕免费额度设计

缓存代码元数据、合并重复报价请求,并用轻量适配层隔离供应商。

Fields a stock ticker API should return股票代码 API 应返回哪些字段

Treat symbol lookup and quote lookup as separate steps. A durable instrument record needs identity fields; a usable quote needs market context.

应把代码查询与报价查询分成两个步骤:证券记录需要身份字段,报价则需要市场上下文。

Data数据Fields to expect应包含字段Use用途Common trap常见误区
Instrument identity证券身份Canonical symbol, exchange, MIC, name, type标准代码、交易所、MIC、名称、类型Stable watchlist records稳定的自选股记录Using a bare ticker as a unique key把裸代码当作唯一键
Listing status上市状态Active flag, first trade, delisted date, aliases有效状态、首日交易、退市日期、别名Validation and migration验证与迁移Silently dropping renamed symbols无提示丢弃已更名代码
Latest quote最新报价Price, timestamp, currency, exchange, session价格、时间戳、币种、交易所、交易时段Watchlists and snapshots自选股与价格快照Treating delayed data as live把延迟数据当作实时数据
Search result搜索结果Matched text, score, locale, provider ID匹配文本、分数、地区、供应商 IDTicker autocomplete代码自动补全Selecting the first fuzzy match直接选择第一个模糊结果

Ticker symbols, CIK, ISIN, FIGI, and MIC are not interchangeableTicker、CIK、ISIN、FIGI 与 MIC 不是一回事

A stock ticker is a short, human-friendly label assigned to a listing. It can change after a rebrand, be reused after a delisting, or identify different securities on different exchanges. A reliable application therefore stores several identifiers with explicit scope instead of treating the visible ticker as the database key.

股票代码是交易所为某个上市证券分配的简短展示标签。公司更名后代码可能变化,退市后的代码也可能被重新使用;同一个短代码在不同交易所还可能代表完全不同的证券。因此,可靠系统不会把页面上看到的 ticker 直接当作数据库唯一键,而会同时保存多个有明确适用范围的标识符。

Identifier标识符Identifies标识对象Useful for适合用途Important limitation重要限制
TickerA tradable listing label某个上市证券的交易代码Display, search, and user input展示、搜索和用户输入Not globally unique, permanent, or sufficient without exchange context并非全球唯一,也不是永久标识,缺少交易所上下文时信息不足
MICA market or operating segment交易市场或其运营分区Exchange-qualified keys and venue routing构建包含交易所信息的键,并将请求路由到正确市场Identifies the venue, not the security itself标识的是交易场所,而不是证券本身
CIKAn SEC filerSEC 申报主体Joining U.S. filings and issuer records关联美国申报文件和发行人记录One filer may have multiple securities; not a global listing ID一个申报主体可能发行多种证券,也不是全球上市标识
ISINA specific security issue某一具体证券发行Cross-border security identification跨市场识别同一证券Availability and redistribution may depend on the data source可获得性和再分发权限取决于数据源
FIGIA financial instrument or composite单个金融工具或综合层级的金融工具记录Mapping instruments across data systems在不同数据系统间映射证券Choose the correct listing, composite, or share-class level需要区分具体上市证券、综合层级和股类层级
Provider IDThe provider's internal record供应商内部记录Fast calls within one provider在同一供应商内部稳定调用Usually cannot serve as a portable cross-provider identity通常无法作为跨供应商通用标识

Practical internal key: assign your own immutable instrument ID, then attach time-bounded ticker aliases, venue identifiers, issuer IDs, and provider mappings. This lets the product change providers without rewriting user portfolios.

实用做法:为每个证券建立自己的不可变内部 ID,再关联带生效时间的 ticker 别名、交易场所标识、发行人标识和供应商映射。这样更换供应商时,不必重写用户持仓与历史记录。

Free and freemium sources for stock ticker lookup可用于股票代码查询的免费数据源与免费套餐

No source is complete for every market. Official directories are closest to the listing record but may expose files instead of a polished search API. Mapping services connect identifier systems, while commercial market-data providers add convenient search and historical status fields. Choose the source role first.

没有一个来源能够完整覆盖所有市场。官方证券目录最接近上市记录,但往往提供文件而不是现成搜索接口;标识符映射服务负责连接不同编码体系;商业市场数据服务则通常提供更方便的搜索、筛选和历史状态字段。选型时应先明确每个来源承担什么角色。

Source数据源Strongest use最适合用途What it returns主要返回内容Boundary to understand需要理解的边界
SEC company ticker filesJoining U.S. issuers to EDGAR将美国发行人与 EDGAR 记录关联Company name, CIK, ticker, and an exchange association file公司名称、CIK、ticker,以及带交易所关联的文件The SEC says the files are updated periodically and does not guarantee accuracy or scope; a filer is not the same as every listed securitySEC 说明文件定期更新,但不保证准确性或覆盖范围;申报主体也不等同于其发行的每只证券
Nasdaq Trader symbol directoryU.S.-listed symbol reference美国上市证券代码目录Symbols and listing attributes with documented field definitions证券代码、上市属性以及对应字段定义It is a reference directory, not a universal company search or quote service它是参考目录,不是全球公司搜索或股票报价服务
OpenFIGI APIMapping third-party identifiers to FIGI把第三方标识符映射为 FIGIFIGI, ticker, name, exchange code, security type, composite and share-class FIGIFIGI、ticker、名称、交易所代码、证券类型、综合 FIGI 和股类 FIGIA ticker-only mapping can return multiple instruments; add exchange, market sector, currency, or security filters只用 ticker 映射可能返回多个证券,需要增加交易所、市场类别、币种或证券类型条件
Massive All TickersSearchable provider reference data and point-in-time status可搜索的证券参考资料,以及指定历史日期的证券状态Ticker, name, market, primary exchange, currency, CIK, FIGI fields, active state, and delisting date when availableticker、名称、市场、主要交易所、币种、CIK、FIGI、活跃状态,以及可用时的退市日期Requires an API key and plan access; provider IDs and coverage remain provider-specific需要 API 密钥和对应套餐权限,供应商内部标识与覆盖范围也不具备通用性

What “free” means for ticker and symbol data股票代码与证券目录数据的“免费”意味着什么

Request and daily quotas

Convert the advertised quota into your own workload: symbols × refreshes × users. A generous daily allowance can still fail if the provider enforces a tight per-minute burst limit.

Delayed or end-of-day prices

Free feeds may be delayed, end-of-day only, or limited outside regular sessions. Label the timestamp and delay in the UI instead of implying live execution quality.

Exchange and history coverage

Confirm the exact exchanges, instruments, delisted symbols, intraday depth, and historical start date. “Global” rarely means identical coverage everywhere.

Display and redistribution rights

Free access does not automatically permit public display, redistribution, commercial resale, or training. Read both the API terms and underlying exchange rules.

请求额度与每日配额

把宣传额度换算成自己的负载:股票数 × 刷新次数 × 用户数。每日额度看似充足,也可能被严格的每分钟限制卡住。

延迟报价或日线数据

免费数据可能延迟、仅提供日终价格,或不完整覆盖盘前盘后。界面应明确显示时间戳和延迟,避免暗示实时成交质量。

交易所与历史覆盖

逐项确认交易所、证券类型、退市代码、分钟数据深度和最早历史日期。“全球覆盖”通常并不代表各市场完全一致。

展示与再分发许可

免费访问不等于可以公开展示、再分发、商业转售或训练模型。既要阅读 API 条款,也要检查底层交易所规则。

Design a stock symbol search that rejects the wrong company设计不会选错公司的股票代码查询

Ticker lookup is a search-and-resolution problem, not a simple string match. Users may type a ticker, legal company name, product brand, old symbol, exchange suffix, CIK, or partial text. The API should retrieve candidates first; your application should then rank and validate them against market, security type, status, and user context.

股票代码查询本质上是“搜索并消除歧义”,不是简单的字符串匹配。用户可能输入 ticker、公司法定名称、产品品牌、旧代码、交易所后缀、CIK,甚至只输入一部分文字。接口负责返回候选项,应用还要结合市场、证券类型、上市状态和用户上下文进行排序与确认。

1. Normalize input without destroying meaning

Trim whitespace and handle case consistently, but preserve punctuation that distinguishes share classes or exchange-qualified symbols. Do not automatically remove periods, hyphens, slashes, or suffixes until the target market's notation rules are known.

2. Retrieve a candidate set

Search both symbol and company name, include active and inactive records when history matters, and request exchange, country, currency, instrument type, and permanent provider ID with every result. Autocomplete should not return a bare ticker alone.

3. Rank with product context

A U.S.-equity application may prioritize active common stock on NYSE or Nasdaq; a global portfolio should not. Rank exact ticker matches, exact names, home-market listings, security types, and locale deliberately rather than trusting an undocumented provider score.

4. Require confirmation for ambiguity

If two plausible listings remain, show company name, exchange, country, currency, and security type and let the user choose. Silently choosing the first result can attach a portfolio transaction to the wrong instrument.

5. Store the resolved identity

After selection, save your internal instrument ID plus source identifiers and effective dates. Future quote or fundamental requests should use the resolved mapping rather than repeating fuzzy search every time.

1. 规范输入,但不要破坏代码含义

可以去除首尾空格并统一大小写处理,但应保留用于区分股类或交易所限定代码的标点。在尚未确认目标市场规则前,不要擅自删除句点、连字符、斜杠或市场后缀。

2. 获取完整候选集

同时搜索证券代码和公司名称;如果涉及历史数据,还要包含已失效记录。每个结果至少应返回交易所、国家、币种、证券类型和供应商提供的稳定 ID,自动补全结果不能只显示一个孤立的 ticker。

3. 根据产品场景排序

只服务美国股票的应用可以优先展示纽交所或纳斯达克的活跃普通股,但全球投资组合不应采用同样规则。应明确设置精确代码、公司全名、本地主要上市地、证券类型和语言地区的权重,而不是盲信供应商不透明的匹配分数。

4. 有歧义时必须让用户确认

如果仍有两个合理候选,应同时展示公司名称、交易所、国家、币种和证券类型,让用户选择。默认采用第一个结果,可能把一笔真实持仓错误地挂到另一只证券上。

5. 保存已经解析的身份

用户确认后,应保存内部证券 ID、来源标识和生效日期。后续请求行情或基本面数据时直接使用这份映射,不要每次都重新进行模糊搜索。

Handle ticker changes, mergers, delistings, and share classes正确处理代码变更、并购、退市和不同股类

A ticker directory is a changing reference dataset. Treat every symbol-to-instrument relationship as time-bounded. Updating the current symbol in place without retaining history breaks old portfolio transactions, chart links, alerts, and joins to filings.

证券代码目录会持续变化,因此“代码对应哪只证券”必须带有有效时间范围。如果只覆盖当前代码而不保留历史,自选列表、历史交易记录、旧图表链接、提醒规则以及财报关联都可能失效。

Ticker change

Keep old and new symbols as aliases with effective dates. Preserve the same instrument ID only when the underlying security truly remains the same.

Merger or acquisition

Do not assume the surviving ticker means continuity. Record predecessor, successor, conversion terms, event date, and whether a new security was issued.

Delisting

Retain the inactive record and delisting date. Historical portfolios and backtests need securities that no longer appear in today's active list.

Share classes

Store each class separately with its own ticker and security identifier while linking them to the common issuer. Voting rights and prices may differ.

Cross-listing and ADR

A local share, foreign listing, and ADR may represent related exposure but remain separate instruments with different currency, venue, ratio, and trading hours.

Ticker reuse

A symbol may later be assigned to an unrelated company. Effective dates prevent a current lookup result from rewriting historical identity.

代码变更

将旧代码和新代码作为带生效日期的别名保存。只有底层证券确实没有变化时,才能继续使用同一个内部证券 ID。

并购或收购

不能因为某个 ticker 被保留,就默认并购前后的证券仍是同一资产。应记录前身、继承证券、换股条件、事件日期,以及是否发行了新证券。

退市

保留失效记录和退市日期。历史投资组合和回测都需要今天的活跃证券列表中已经不存在的标的。

不同股类

每个股类使用独立 ticker 和证券标识,同时关联到共同发行人。不同股类的投票权和市场价格可能并不相同。

跨市场上市与 ADR

本地股票、海外上市证券和 ADR 可能对应相近经济敞口,但仍是币种、交易场所、换算比例和交易时间不同的独立证券。

代码重新使用

退市代码以后可能分配给完全无关的公司。保存生效日期,可以防止今天的查询结果错误覆盖历史证券身份。

A resilient free stock ticker API integration如何可靠集成免费股票代码 API

Create an exchange-qualified key

Map each result to a stable internal key such as MIC plus canonical symbol. Keep the friendly ticker for display, not database identity.

Cache metadata separately

Instrument names and exchange mappings change less often than quotes. Cache them longer and refresh active prices under a separate freshness policy.

Reject ambiguous matches

If symbol search returns multiple exchanges or instrument types, ask for a choice instead of silently selecting the first result.

Handle 429s deliberately

Respect Retry-After, use exponential backoff with jitter, and serve a clearly marked cached value when freshness requirements allow it.

建立包含交易所信息的键

用 MIC 与标准代码的组合构建稳定的内部键;易读的 ticker 只用于展示,不作为数据库中的唯一身份。

分开缓存元数据

证券名称和交易所映射的变化频率低于报价,应使用更长的缓存时间,并为活跃价格单独设置时效策略。

拒绝歧义匹配

若代码搜索返回多个交易所或证券类型,应让用户选择,不要默认采用第一个结果。

明确处理 429

遵循 Retry-After,使用带抖动的指数退避;在新鲜度允许时,返回带清晰标记的缓存值。

Find ticker search and identifier capabilities with QVeris用 QVeris 查找代码搜索与标识符能力

QVeris helps developers and agents discover and inspect callable financial-data capabilities. Search by the task—symbol lookup, exchange directory, identifier mapping, company search, or delisted securities—then inspect the tool contract before calling it.

QVeris 帮助开发者和 Agent 查找并检查可调用的金融数据能力。可以按股票代码查询、交易所目录、标识符映射、公司搜索或退市证券等任务查找工具,再在调用前检查工具的输入、输出和使用要求。

  • Inspect whether a tool returns exchange, country, currency, security type, listing status, and permanent identifiers—not just a ticker string.
  • Pass enough context to reject ambiguous matches, and preserve the chosen source record with the result.
  • Keep provider mappings outside the user-facing portfolio model so a vendor change does not alter instrument identity.
  • 检查工具是否返回交易所、国家、币种、证券类型、上市状态和永久标识,而不是只返回一个 ticker 字符串。
  • 提供足够上下文来排除歧义,并把最终选择的来源记录与结果一起保存。
  • 让供应商映射与用户看到的投资组合模型分离,避免更换供应商改变证券身份。

FAQ常见问题

Is a ticker symbol globally unique?

No. The same short symbol can identify different instruments on different exchanges, so include exchange or MIC identity.

Can a free ticker API return live prices?

Sometimes, but exchange entitlements and delays vary. Verify each quote timestamp and the provider’s display rights.

How should I handle ticker changes?

Keep a stable internal instrument ID and store symbol aliases with effective dates so watchlists survive renames and mergers.

How do I stay within a free API limit?

Cache metadata, deduplicate requests, batch symbols when supported, and back off correctly after 429 responses.

股票代码在全球唯一吗?

不唯一。同一短代码可能代表不同交易所的不同证券,因此需要同时保存交易所或 MIC 身份。

免费代码 API 能返回实时价格吗?

有时可以,但交易所授权与延迟不同。应核对每条报价的时间戳和供应商展示许可。

如何处理股票代码变更?

使用稳定的内部证券 ID,并保存带生效日期的代码别名,让自选股在更名或合并后仍可用。

如何控制免费 API 用量?

缓存元数据、合并重复请求,在支持时批量查询,并在 429 后正确退避。

External references外部参考链接