批量查询标的元数据
使用 POST 方法批量查询,支持更多标的(最多 1000 个)。
OpenAPI
/zh-Hans/api-reference/openapi.json post /v1/instruments
openapi: 3.1.0
info:
title: TickFlow 行情数据 API
description: |-
高性能行情数据服务,支持 A股、ETF、美股、港股。
## 认证方式
所有接口需要通过 `x-api-key` 请求头传递 API Key 进行认证。
## 速率限制
根据 API Key 配置的权限,可能会有请求频率和配额限制。
## 批量查询
部分接口同时支持 GET 和 POST 方法:
- **GET**: 通过 URL 参数传递,适合少量数据
- **POST**: 通过 JSON Body 传递,适合大批量查询,不受 URL 长度限制
## K线周期
支持的周期:1m, 5m, 10m, 15m, 30m, 60m, 1d, 1w, 1M, 1Q, 1Y
- 日内周期(5m/15m/30m/60m)从1m数据聚合
- 周线(1w)/月线(1M)/季线(1Q)/年线(1Y)从日线聚合
- intraday 接口当前为 Beta 版本
contact:
name: TickFlow Team
license:
name: ''
version: 1.0.0
servers:
- url: https://api.tickflow.org
security:
- api_key: []
paths:
/v1/instruments:
post:
tags:
- 标的
summary: 批量查询标的元数据
description: 使用 POST 方法批量查询,支持更多标的(最多 1000 个)。
operationId: post_instruments
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/InstrumentsRequest'
required: true
responses:
'200':
description: 查询成功
content:
application/json:
schema:
$ref: '#/components/schemas/InstrumentsResponse'
'400':
description: 参数错误
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
description: 认证失败
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
security:
- api_key: []
components:
schemas:
InstrumentsRequest:
type: object
description: 批量查询标的请求体 (POST)
required:
- symbols
properties:
symbols:
type: array
items:
type: string
description: 标的代码列表
InstrumentsResponse:
type: object
description: 标的元数据响应
required:
- data
properties:
data:
type: array
items:
$ref: '#/components/schemas/Instrument'
description: 标的元数据列表
ApiError:
type: object
description: API 错误响应体
required:
- code
- message
properties:
code:
type: string
description: 错误代码 (如 "INVALID_PERIOD", "SYMBOL_NOT_FOUND")
example: INVALID_PERIOD
details:
description: 详细信息 (可选,用于调试)
message:
type: string
description: 错误消息 (人类可读)
example: 'Invalid period: 2d'
Instrument:
type: object
description: 标的元数据
required:
- symbol
- exchange
- code
- region
properties:
code:
type: string
description: 交易所内代码 (如 "600000", "AAPL")
exchange:
type: string
description: 交易所代码 (如 "SH", "SZ", "US")
ext:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/InstrumentExt'
description: 市场特定扩展字段
name:
type:
- string
- 'null'
description: 标的名称
region:
type: string
description: 所属地区 (CN, US, HK)
symbol:
type: string
description: 标的代码 (如 "600000.SH", "AAPL.US")
type:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/InstrumentType'
description: 标的类型
InstrumentExt:
oneOf:
- allOf:
- $ref: '#/components/schemas/CnEquityInstrumentExt'
description: 中国 A 股扩展
- type: object
required:
- type
properties:
type:
type: string
enum:
- cn_equity
description: 中国 A 股扩展
- allOf:
- $ref: '#/components/schemas/UsEquityInstrumentExt'
description: 美国股票扩展
- type: object
required:
- type
properties:
type:
type: string
enum:
- us_equity
description: 美国股票扩展
- allOf:
- $ref: '#/components/schemas/HkEquityInstrumentExt'
description: 香港股票扩展
- type: object
required:
- type
properties:
type:
type: string
enum:
- hk_equity
description: 香港股票扩展
description: |-
市场特定元数据扩展
`type` 标签值与 [`MarketType`] 一一对应。
InstrumentType:
type: string
description: 标的类型
enum:
- stock
- etf
- index
- bond
- fund
- options
- other
CnEquityInstrumentExt:
type: object
description: 中国 A 股特有字段
properties:
float_shares:
type:
- number
- 'null'
format: double
description: 流通股本(股)
limit_down:
type:
- number
- 'null'
format: double
description: 跌停价(每交易日更新)
limit_up:
type:
- number
- 'null'
format: double
description: 涨停价(每交易日更新)
listing_date:
type:
- string
- 'null'
description: 上市日期
name_en:
type:
- string
- 'null'
description: 英文名
tick_size:
type:
- number
- 'null'
format: double
description: 最小变动价位
total_shares:
type:
- number
- 'null'
format: double
description: 总股本(股)
UsEquityInstrumentExt:
type: object
description: 美股特有字段
properties:
float_shares:
type:
- number
- 'null'
format: double
description: 流通股本(股)
total_shares:
type:
- number
- 'null'
format: double
description: 总股本(股)
HkEquityInstrumentExt:
type: object
description: 港股特有字段
properties:
float_shares:
type:
- number
- 'null'
format: double
description: 流通股本(股)
lot_size:
type:
- integer
- 'null'
format: int32
description: 每手股数
total_shares:
type:
- number
- 'null'
format: double
description: 总股本(股)
securitySchemes:
api_key:
type: apiKey
in: header
name: x-api-key