通用表查询只开放白名单内的表与字段,库名、表名与列名必须在服务端注册表中存在。
任何字符串都会作为参数绑定,不接受原生 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.announcement | announcements |
auction
2 张表
| 表名 | schema |
auction.auction_call | auction |
auction.auction_snapshot | auction |
financials
3 张表
| 表名 | schema |
financials.earnings_flash | financials |
financials.earnings_forecast | financials |
financials.financial_report | financials |
kline
9 张表
| 表名 | schema |
kline.adjust_factor | kline |
kline.daily_bars_bfq | kline |
kline.dividend_info | kline |
kline.index_daily_bars | kline |
kline.index_minute_bars | kline |
kline.index_monthly_bars | kline |
kline.index_weekly_bars | kline |
kline.monthly_bars_bfq | kline |
kline.weekly_bars_bfq | kline |
limit_up
15 张表
| 表名 | schema |
limit_up.daily_theme_map | limit_up |
limit_up.free_float_meta | limit_up |
limit_up.free_float_snapshot | limit_up |
limit_up.iwencai_zt | limit_up |
limit_up.jygs_action_board | limit_up |
limit_up.kpl_daily | limit_up |
limit_up.limit_up_turnover | limit_up |
limit_up.market_daily | limit_up |
limit_up.market_sentiment_daily | limit_up |
limit_up.reason_daily | limit_up |
limit_up.sector_fund_flow | limit_up |
limit_up.stock_industry | limit_up |
limit_up.stock_theme | limit_up |
limit_up.theme | limit_up |
limit_up.theme_daily | limit_up |
market_detail
16 张表
| 表名 | schema |
market_detail.actual_controller_change | market_detail |
market_detail.block_trade | market_detail |
market_detail.dragon_tiger | market_detail |
market_detail.dragon_tiger_seats | market_detail |
market_detail.holder_change | market_detail |
market_detail.holder_number | market_detail |
market_detail.margin_detail | market_detail |
market_detail.pledge_event | market_detail |
market_detail.pledge_snapshot | market_detail |
market_detail.restricted_release | market_detail |
market_detail.sm_lhb_seat | market_detail |
market_detail.sm_market_flow | market_detail |
market_detail.sm_moneyflow | market_detail |
market_detail.soe_change_log | market_detail |
market_detail.soe_profile | market_detail |
market_detail.stock_fund_flow | market_detail |
news
4 张表
| 表名 | schema |
news.clusters | news |
news.headlines | news |
news.news_ratings | news |
news.news_sentiment_daily | news |
research
3 张表
| 表名 | schema |
research.institution_survey | research |
research.research_rating | research |
research.research_report | research |
st_history
1 张表
| 表名 | schema |
st_history.st_daily | st_history |
tdx_snapshot
1 张表
| 表名 | schema |
tdx_snapshot.tdx_snapshot | tdx_snapshot |