Friends Data API独立数据服务

DATASET · market

商品期货与现货 K 线

market.commodity_ohlcv
价格与行情

这是价格、成交、报价与衍生品行情中的“商品期货与现货 K 线”数据集;一行由 commodity_code、bar_date、interval、source 定位,主要字段包括 open、high、low、close、adjusted_close。

字段26
关键字段4
更新口径daily
时间列publish_ts
单页上限5000
分页Cursor
PIT不支持
规模1K-9K

WHAT IT ANSWERS

这张表适合回答什么

  • 查询历史或盘中价格与成交
  • 构建行情、波动率和衍生品特征

GRAIN & TIME

一行代表什么

业务粒度
每行代表“商品期货与现货 K 线”的一条记录;逻辑粒度由 commodity_code × interval × bar_date × source 共同确定。
时间口径
以 publish_ts 为主要查询时间轴;除下方限制特别说明外,时间戳按 UTC、日期按来源市场日历解释。
更新节奏
通常按交易日或自然日更新;具体最新日期请以返回数据为准。

KEY FIELDS

先看这些字段

commodity_code
用于确定该表业务粒度或默认顺序的 commodity code 字段。
interval
行情或统计的聚合时间间隔。
bar_date
bar date 对应的日历日期。
source
标准化数据来源;同一业务键可能因来源不同而有多行。

RECOMMENDED JOINS

怎样和其他表关联

该表主要按自身业务键使用,目前没有推荐的跨表主键联接。

HOW TO QUERY SAFELY

查询方法与已知限制

先用 catalog 确认当前契约;可按 catalog 中列出的 filters 进一步缩小范围;单页最多 5000 行,响应有 has_more 时原样传回 next_cursor 继续分页。

MACHINE CONTRACT

筛选、排序与分页

UNVERSIONED
默认排序
commodity_code, bar_date, interval, source
唯一键
commodity_code, bar_date, interval, source
读取模式
canonical_final_active
最大时间窗
未单独限制

可用 filters

provider→ provider · string
source→ source · string

POINT IN TIME

可复现读取

NOT AVAILABLE

该资产没有 PIT 契约。普通 rows 端点仍按当前公开读模式返回数据;不要把它表述成历史时点快照。

COPY-READY CALLS

怎么调用

同一数据集可用 HTTP、Python SDK、CLI 或 MCP;Key 始终只通过环境变量/Bearer Header 传递。

READ ONLY
HTTP
curl --fail-with-body -H "Authorization: Bearer $FRIENDS_DATA_API_KEY" "https://api.alphahubs.uk/api/v1/data/datasets/market/commodity_ohlcv/rows?limit=100&provider=PROVIDER_VALUE"

FIELD DICTIONARY

26 个返回字段

descriptionSource 可在 JSON 中区分仓库注释、标准术语表和名称推导说明。

#字段ClickHouse 类型JSON可空角色说明
1commodity_codeStringstringnodefault_order, warehouse_primary_key, contract_unique_keySource-normalized field: commodity code.名称推导
2intervalLowCardinality(String)stringnodefault_order, warehouse_primary_key, contract_unique_keyAggregation or sampling interval.标准术语表
3bar_datedateDatestring / datenodefault_order, warehouse_primary_key, contract_unique_keyCalendar date for bar date (YYYY-MM-DD).名称推导
4openNullable(Float64)numberyesvalueOpening price for the represented interval.标准术语表
5highNullable(Float64)numberyesvalueHighest price for the represented interval.标准术语表
6lowNullable(Float64)numberyesvalueLowest price for the represented interval.标准术语表
7closeNullable(Float64)numberyesvalueClosing or last price for the represented interval.标准术语表
8adjusted_closeNullable(Float64)numberyesvalueSource-normalized field: adjusted close.名称推导
9volumeNullable(UInt64)integeryesvalueTraded volume for the represented interval.标准术语表
10currencyLowCardinality(String)stringnovalueISO-like currency code for monetary values.标准术语表
11publish_tsUTC_datetimeDateTime64(3, 'UTC')string / date-timenotime, provenanceUTC point-in-time availability timestamp used by PIT reads.标准术语表
12source_tsUTC_datetimeDateTime64(3, 'UTC')string / date-timenoprovenanceTimestamp asserted by the upstream source.标准术语表
13ingested_atUTC_datetimeDateTime64(3, 'UTC')string / date-timenoprovenanceUTC timestamp when the source record entered the warehouse.标准术语表
14sourceLowCardinality(String)stringnofilter, default_order, warehouse_primary_key, contract_unique_key, provenanceNormalized upstream source identifier.标准术语表
15providerLowCardinality(String)stringnofilter, provenanceUpstream data provider identifier.标准术语表
16source_urlStringstringnoprovenanceURL of the upstream evidence or record when distributable.标准术语表
17source_record_idStringstringnoprovenanceProvider-side identifier for the source record.标准术语表
18raw_payload_hashStringstringnoprovenanceOpaque fingerprint of the normalized source payload for provenance checks.标准术语表
19parser_versionLowCardinality(String)stringnoprovenanceVersion of the parser or normalizer that produced the row.标准术语表
20quality_statusLowCardinality(String)stringnoprovenanceMachine-readable data-quality classification.标准术语表
21license_scopeLowCardinality(String)stringnoprovenanceLicense or redistribution scope attached to the row.标准术语表
22visibility_tierLowCardinality(String)stringnoprovenanceServing visibility tier attached to the row.标准术语表
23ingest_run_idStringstringnoprovenanceIdentifier of the ingestion run that produced the row.标准术语表
24versionUInt64integernoprovenanceMonotonic row version used for correction-aware reads.标准术语表
25version_tsUTC_datetimeDateTime64(3, 'UTC')string / date-timenoprovenanceUTC timestamp associated with the row version.标准术语表
26is_deletedUInt8integernovalueSoft-delete marker; public serving excludes current tombstones.标准术语表
字典口径

结构来自 Friends 只读身份可见的真实 serving relation;权限、过滤、排序、PIT 与分页来自可执行 DatasetSpec。Schema observed at 2026-10-06T18:08:52Z。