WHAT IT ANSWERS
这张表适合回答什么
- 查询历史或盘中价格与成交
- 构建行情、波动率和衍生品特征
DATASET · market
market.snapshot_us_stocks
这是价格、成交、报价与衍生品行情中的“美股全市场盘中快照”数据集;一行由 observed_at、instrument_id 定位,主要字段包括 code、todays_change_perc、todays_change、updated、day_o。
observed_atWHAT IT ANSWERS
GRAIN & TIME
KEY FIELDS
instrument_idobserved_atRECOMMENDED JOINS
ref.instrumenton instrument_id用 instrument_id 补充证券代码、名称、市场、交易所和资产类型。
HOW TO QUERY SAFELY
先用 catalog 确认当前契约;可按 catalog 中列出的 filters 进一步缩小范围;单页最多 5000 行,响应有 has_more 时原样传回 next_cursor 继续分页。
MACHINE CONTRACT
observed_at, instrument_idobserved_at, instrument_idrelation_defaultcode→ code · stringinstrument_id→ instrument_id · integerprovider→ provider · stringsource→ source · stringPOINT IN TIME
该资产没有 PIT 契约。普通 rows 端点仍按当前公开读模式返回数据;不要把它表述成历史时点快照。
COPY-READY CALLS
同一数据集可用 HTTP、Python SDK、CLI 或 MCP;Key 始终只通过环境变量/Bearer Header 传递。
curl --fail-with-body -H "Authorization: Bearer $FRIENDS_DATA_API_KEY" "https://api.alphahubs.uk/api/v1/data/datasets/market/snapshot_us_stocks/rows?limit=100&code=AAPL"from friends_data_api import FriendsDataClient, Settings
async with FriendsDataClient(Settings.from_env()) as client:
page = await client.get_dataset_rows('market', 'snapshot_us_stocks', limit=100, filters={'code': 'AAPL'})
print(page.data)
if page.has_more:
print("next cursor:", page.next_cursor)friends-data get-dataset-rows market snapshot_us_stocks --limit 100 --filter code=AAPL{
"arguments": {
"dataset": "snapshot_us_stocks",
"filters": {
"code": "AAPL"
},
"limit": 100,
"namespace": "market"
},
"tool": "get_dataset_rows"
}FIELD DICTIONARY
descriptionSource 可在 JSON 中区分仓库注释、标准术语表和名称推导说明。
| # | 字段 | ClickHouse 类型 | JSON | 可空 | 角色 | 说明 |
|---|---|---|---|---|---|---|
| 1 | instrument_id | UInt64 | integer | no | filter, default_order, warehouse_primary_key, contract_unique_key | WarrenHub canonical instrument identifier; use it for cross-dataset joins.标准术语表 |
| 2 | code | String | string | no | filter | Source-normalized security or contract code.标准术语表 |
| 3 | observed_atUTC_datetime | DateTime64(3, 'UTC') | string / date-time | no | time, default_order, warehouse_primary_key, contract_unique_key | UTC timestamp for observed at.名称推导 |
| 4 | todays_change_perc | Nullable(Float64) | number | yes | value | Source-normalized field: todays change perc.名称推导 |
| 5 | todays_change | Nullable(Float64) | number | yes | value | Source-normalized field: todays change.名称推导 |
| 6 | updated | DateTime64(3, 'UTC') | string / date-time | no | value | Source-normalized field: updated.名称推导 |
| 7 | day_o | Nullable(Float64) | number | yes | value | Source-normalized field: day o.名称推导 |
| 8 | day_h | Nullable(Float64) | number | yes | value | Source-normalized field: day h.名称推导 |
| 9 | day_l | Nullable(Float64) | number | yes | value | Source-normalized field: day l.名称推导 |
| 10 | day_c | Nullable(Float64) | number | yes | value | Source-normalized field: day c.名称推导 |
| 11 | day_v | Nullable(Float64) | number | yes | value | Source-normalized field: day v.名称推导 |
| 12 | day_vw | Nullable(Float64) | number | yes | value | Source-normalized field: day vw.名称推导 |
| 13 | lastTrade_p | Nullable(Float64) | number | yes | value | Source-normalized field: lastTrade p.名称推导 |
| 14 | lastTrade_s | Nullable(UInt32) | integer | yes | value | Source-normalized field: lastTrade s.名称推导 |
| 15 | lastTrade_t | Nullable(DateTime64(9, 'UTC')) | string / date-time | yes | value | Source-normalized field: lastTrade t.名称推导 |
| 16 | lastTrade_x | Nullable(UInt16) | integer | yes | value | Source-normalized field: lastTrade x.名称推导 |
| 17 | lastTrade_c | Array(UInt16) | array | no | value | Source-normalized field: lastTrade c.名称推导 |
| 18 | lastTrade_i | Nullable(String) | string | yes | value | Source-normalized field: lastTrade i.名称推导 |
| 19 | lastQuote_bp | Nullable(Float64) | number | yes | value | Source-normalized field: lastQuote bp.名称推导 |
| 20 | lastQuote_ap | Nullable(Float64) | number | yes | value | Source-normalized field: lastQuote ap.名称推导 |
| 21 | lastQuote_bs | Nullable(UInt32) | integer | yes | value | Source-normalized field: lastQuote bs.名称推导 |
| 22 | lastQuote_as | Nullable(UInt32) | integer | yes | value | Source-normalized field: lastQuote as.名称推导 |
| 23 | lastQuote_t | Nullable(DateTime64(9, 'UTC')) | string / date-time | yes | value | Source-normalized field: lastQuote t.名称推导 |
| 24 | min_o | Nullable(Float64) | number | yes | value | Source-normalized field: min o.名称推导 |
| 25 | min_h | Nullable(Float64) | number | yes | value | Source-normalized field: min h.名称推导 |
| 26 | min_l | Nullable(Float64) | number | yes | value | Source-normalized field: min l.名称推导 |
| 27 | min_c | Nullable(Float64) | number | yes | value | Source-normalized field: min c.名称推导 |
| 28 | min_v | Nullable(UInt64) | integer | yes | value | Source-normalized field: min v.名称推导 |
| 29 | min_vw | Nullable(Float64) | number | yes | value | Source-normalized field: min vw.名称推导 |
| 30 | min_av | Nullable(UInt64) | integer | yes | value | Source-normalized field: min av.名称推导 |
| 31 | min_t | Nullable(DateTime64(3, 'UTC')) | string / date-time | yes | value | Source-normalized field: min t.名称推导 |
| 32 | min_n | Nullable(UInt32) | integer | yes | value | Source-normalized field: min n.名称推导 |
| 33 | min_dv | Nullable(Float64) | number | yes | value | Source-normalized field: min dv.名称推导 |
| 34 | min_dav | Nullable(Float64) | number | yes | value | Source-normalized field: min dav.名称推导 |
| 35 | prevDay_o | Nullable(Float64) | number | yes | value | Source-normalized field: prevDay o.名称推导 |
| 36 | prevDay_h | Nullable(Float64) | number | yes | value | Source-normalized field: prevDay h.名称推导 |
| 37 | prevDay_l | Nullable(Float64) | number | yes | value | Source-normalized field: prevDay l.名称推导 |
| 38 | prevDay_c | Nullable(Float64) | number | yes | value | Source-normalized field: prevDay c.名称推导 |
| 39 | prevDay_v | Nullable(Float64) | number | yes | value | Source-normalized field: prevDay v.名称推导 |
| 40 | prevDay_vw | Nullable(Float64) | number | yes | value | Source-normalized field: prevDay vw.名称推导 |
| 41 | ingested_atUTC_datetime | DateTime64(3, 'UTC') | string / date-time | no | provenance | UTC timestamp when the source record entered the warehouse.标准术语表 |
| 42 | source | LowCardinality(String) | string | no | filter, provenance | Normalized upstream source identifier.标准术语表 |
| 43 | provider | LowCardinality(String) | string | no | filter, provenance | Upstream data provider identifier.标准术语表 |
| 44 | ingest_run_id | String | string | no | provenance | Identifier of the ingestion run that produced the row.标准术语表 |
| 45 | snapshot_endpoint | LowCardinality(String) | string | no | value | Source-normalized field: snapshot endpoint.名称推导 |
| 46 | source_url | String | string | no | provenance | URL of the upstream evidence or record when distributable.标准术语表 |
| 47 | source_record_id | String | string | no | provenance | Provider-side identifier for the source record.标准术语表 |
| 48 | raw_payload_hash | String | string | no | provenance | Opaque fingerprint of the normalized source payload for provenance checks.标准术语表 |
| 49 | parser_version | LowCardinality(String) | string | no | provenance | Version of the parser or normalizer that produced the row.标准术语表 |
| 50 | quality_status | LowCardinality(String) | string | no | provenance | Machine-readable data-quality classification.标准术语表 |
| 51 | license_scope | LowCardinality(String) | string | no | provenance | License or redistribution scope attached to the row.标准术语表 |
| 52 | visibility_tier | LowCardinality(String) | string | no | provenance | Serving visibility tier attached to the row.标准术语表 |
| 53 | version | UInt64 | integer | no | provenance | Monotonic row version used for correction-aware reads.标准术语表 |
| 54 | is_deleted | UInt8 | integer | no | value | Soft-delete marker; public serving excludes current tombstones.标准术语表 |
| 55 | created_atUTC_datetime | DateTime64(3, 'UTC') | string / date-time | no | value | UTC timestamp when the warehouse row was first created.标准术语表 |
| 56 | updated_atUTC_datetime | DateTime64(3, 'UTC') | string / date-time | no | value | UTC timestamp when the warehouse row was last updated.标准术语表 |
换一个字段名、类型或角色。
结构来自 Friends 只读身份可见的真实 serving relation;权限、过滤、排序、PIT 与分页来自可执行 DatasetSpec。Schema observed at 2026-10-06T18:08:52Z。