接口:level2_sz_new
描述:level2新接口,包含深圳数据.
限量:单次最大10000
已入库数据时间
| 开始时间 | 结束时间 |
|---|---|
| 20230101 | 上个交易日 |
变更说明
相对于2021年10月11日之前的深圳Level2快照数据(接口level2_sz)的变化:
输入参数
| 名称 | 类型 | 必选 | 描述 |
|---|---|---|---|
| code | str | N | 股票代码 000001.SZ |
| tradetime | str | N | 2021-10-11 09:30:00.000 or 2021-10-11 09:30:00 or 2021-10-11 |
| start_time | str | N | 2021-10-11 09:30:00.000 or 2021-10-11 09:30:00 or 2021-10-11 |
| end_time | str | N | 2021-10-11 09:30:00.000 or 2021-10-11 09:30:00 or 2021-10-11 |
输出参数
| 名称 | 类型 | 默认显示 | 描述 |
|---|---|---|---|
| code | str | Y | 股票代码 000001.SZ |
| sendingtime | int | Y | 发送时间 |
| msgseqnum | int | Y | 消息序号 |
| imagestatus | int | Y | 快照类型 全量1 更新2 |
| tradetime | str | Y | 成交时间 |
| preclosepx | float | Y | 昨收盘价或昨收盘指数 |
| openpx | float | Y | 开盘价或开盘指数 |
| highpx | float | Y | 最高价或最高指数 |
| lowpx | float | Y | 最低价或最低指数 |
| lastpx | float | Y | 现价或当前指数 |
| closepx | float | Y | 收盘价或收盘指数 |
| volume | int | Y | 成交量 指数:手 股票:股 权证:份 债券:手 期权:张 |
| amount | float | Y | 成交金额(元) |
| averagepx | float | Y | 均价或指数均值 |
| bidnumorder | int | Y | 申买实际总委托笔数 |
| offernumorder | int | Y | 申卖实际总委托笔数 |
| numtrades | int | Y | 成交笔数 |
| totalbidqty | int | Y | 委托买入总量 股票:股 权证:份 债券:手 |
| weightedavgbidpx | float | Y | 加权平均委买价格(元) |
| totalofferqty | int | Y | 委托卖出总量 股票:股 权证:份 债券:手 |
| weightedavgofferpx | float | Y | 加权平均委卖价格(元) |
| change1 | float | Y | 升跌1 最新价减去昨收价 |
| change2 | float | Y | 升跌2 最新价减去上一最新价 |
| totallongposition | int | Y | 衍生品合约持仓量 |
| peratio1 | float | Y | 市盈率1 股票:价格/上年每股利润 基金:NAV或T-1日净值 债券:每百元应计利息 |
| peratio2 | float | Y | 市盈率2 股票:价格/本年每股利润 债券:到期收益率 基金:IOPV或净值 权证:溢价率 |
| upperlimitpx | float | Y | 涨停价 |
| lowerlimitpx | float | Y | 跌停价 |
| weightedavgpxchg | float | Y | 加权平均价涨跌BP |
| preweightedavgpx | float | Y | 昨收盘加权平均价 |
| tradingphasecode | str | Y | 产品实时阶段 |
| noordersb1 | int | Y | 买一揭示委托笔数 |
| noorderss1 | int | Y | 卖一揭示委托笔数 |
| bidprice1 | float | Y | 申买价一 |
| bidprice2 | float | Y | 申买价二 |
| bidprice3 | float | Y | 申买价三 |
| bidprice4 | float | Y | 申买价四 |
| bidprice5 | float | Y | 申买价五 |
| bidprice6 | float | Y | 申买价六 |
| bidprice7 | float | Y | 申买价七 |
| bidprice8 | float | Y | 申买价八 |
| bidprice9 | float | Y | 申买价九 |
| bidprice10 | float | Y | 申买价十 |
| bidorderqty1 | int | Y | 申买量一 股票:股 权证:份 债券:手 |
| bidorderqty2 | int | Y | 申买量二 |
| bidorderqty3 | int | Y | 申买量三 |
| bidorderqty4 | int | Y | 申买量四 |
| bidorderqty5 | int | Y | 申买量五 |
| bidorderqty6 | int | Y | 申买量六 |
| bidorderqty7 | int | Y | 申买量七 |
| bidorderqty8 | int | Y | 申买量八 |
| bidorderqty9 | int | Y | 申买量九 |
| bidorderqty10 | int | Y | 申买量十 |
| offerprice1 | float | Y | 申卖价一 |
| offerprice2 | float | Y | 申卖价二 |
| offerprice3 | float | Y | 申卖价三 |
| offerprice4 | float | Y | 申卖价四 |
| offerprice5 | float | Y | 申卖价五 |
| offerprice6 | float | Y | 申卖价六 |
| offerprice7 | float | Y | 申卖价七 |
| offerprice8 | float | Y | 申卖价八 |
| offerprice9 | float | Y | 申卖价九 |
| offerprice10 | float | Y | 申卖价十 |
| offerorderqty1 | int | Y | 申卖量一 股票:股 权证:份 债券:手 |
| offerorderqty2 | int | Y | 申卖量二 |
| offerorderqty3 | int | Y | 申卖量三 |
| offerorderqty4 | int | Y | 申卖量四 |
| offerorderqty5 | int | Y | 申卖量五 |
| offerorderqty6 | int | Y | 申卖量六 |
| offerorderqty7 | int | Y | 申卖量七 |
| offerorderqty8 | int | Y | 申卖量八 |
| offerorderqty9 | int | Y | 申卖量九 |
| offerorderqty10 | int | Y | 申卖量十 |
安装Python包
pip install dcube
导入datacube
import dcube as dc
用token初始化pro接口
pro = dc.pro_api('your token')
数据调取
df = pro.query('level2_sz_new', code='000001.SZ',tradetime='2021-10-11',fields='code,tradetime,preclosepx,openpx,highpx,lowpx')
或者
df = pro.level2_sz_new(code='000001.SZ',tradetime='2021-10-11')