通用表查询

table

在只读白名单内按 schema.table 查询任意表,支持字段裁剪、等值过滤、排序与分页。

高级 56 张白名单表
通用表查询只开放白名单内的表与字段,库名、表名与列名必须在服务端注册表中存在。 任何字符串都会作为参数绑定,不接受原生 SQL 片段。

请求参数 10 项

参数类型说明必填
schema 字符串 白名单内的库名 必填
table 字符串 白名单内的表名 必填
fields 字符串 逗号分隔的字段名,缺省返回全部字段 可选
where 对象 JSON 对象,键为字段名,值为单值或数组 可选
order_by 字符串 形如 trade_date desc,仅允许白名单字段 可选
trade_date 日期 YYYYMMDD 或 YYYY-MM-DD;与开始/结束日期互斥 可选
start_date 日期 YYYYMMDD 或 YYYY-MM-DD,含当日 可选
end_date 日期 YYYYMMDD 或 YYYY-MM-DD,含当日 可选
limit 整数 默认 1000,上限由账号单次返回行数决定 可选
offset 整数 用于分页,配合 has_more 使用 可选

请求示例

Python · MQData SDK
from mq_data import MQData

client = MQData(token="你的 Token")
rows = client.table(
    schema="kline", table="daily_bars_bfq",
    fields="code,trade_date,close,volume",
    where={"code": ["600519", "000001"]},
    order_by="trade_date desc", limit=10)
print(rows)
cURL · HTTP
curl -X POST https://api.mquant.com.cn/data/v1 \
  -H "X-API-Token: $MQ_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"api_name": "table", "params": {"schema": "kline", "table": "daily_bars_bfq", "fields": "code,trade_date,close,volume", "where": {"code": ["600519", "000001"]}, "order_by": "trade_date desc", "limit": 10}}'

响应示例

JSON · 标准响应
{
  "code": 0,
  "msg": null,
  "data": {
    "fields": ["code", "trade_date", "close", "volume"],
    "items": [["600519", "20260105", 1688.0, 32100]],
    "has_more": false
  }
}

白名单数据表 56 张

announcements

1 张表
表名schema
announcements.announcementannouncements

auction

2 张表
表名schema
auction.auction_callauction
auction.auction_snapshotauction

dim

1 张表
表名schema
dim.securitydim

financials

3 张表
表名schema
financials.earnings_flashfinancials
financials.earnings_forecastfinancials
financials.financial_reportfinancials

kline

9 张表
表名schema
kline.adjust_factorkline
kline.daily_bars_bfqkline
kline.dividend_infokline
kline.index_daily_barskline
kline.index_minute_barskline
kline.index_monthly_barskline
kline.index_weekly_barskline
kline.monthly_bars_bfqkline
kline.weekly_bars_bfqkline

limit_up

15 张表
表名schema
limit_up.daily_theme_maplimit_up
limit_up.free_float_metalimit_up
limit_up.free_float_snapshotlimit_up
limit_up.iwencai_ztlimit_up
limit_up.jygs_action_boardlimit_up
limit_up.kpl_dailylimit_up
limit_up.limit_up_turnoverlimit_up
limit_up.market_dailylimit_up
limit_up.market_sentiment_dailylimit_up
limit_up.reason_dailylimit_up
limit_up.sector_fund_flowlimit_up
limit_up.stock_industrylimit_up
limit_up.stock_themelimit_up
limit_up.themelimit_up
limit_up.theme_dailylimit_up

market_detail

16 张表
表名schema
market_detail.actual_controller_changemarket_detail
market_detail.block_trademarket_detail
market_detail.dragon_tigermarket_detail
market_detail.dragon_tiger_seatsmarket_detail
market_detail.holder_changemarket_detail
market_detail.holder_numbermarket_detail
market_detail.margin_detailmarket_detail
market_detail.pledge_eventmarket_detail
market_detail.pledge_snapshotmarket_detail
market_detail.restricted_releasemarket_detail
market_detail.sm_lhb_seatmarket_detail
market_detail.sm_market_flowmarket_detail
market_detail.sm_moneyflowmarket_detail
market_detail.soe_change_logmarket_detail
market_detail.soe_profilemarket_detail
market_detail.stock_fund_flowmarket_detail

news

4 张表
表名schema
news.clustersnews
news.headlinesnews
news.news_ratingsnews
news.news_sentiment_dailynews

research

3 张表
表名schema
research.institution_surveyresearch
research.research_ratingresearch
research.research_reportresearch

st_history

1 张表
表名schema
st_history.st_dailyst_history

tdx_snapshot

1 张表
表名schema
tdx_snapshot.tdx_snapshottdx_snapshot