接口: stock_zh_index_spot
描述: 股票指数数据
限量: 单次返回所有指数的实时行情数据
输入参数:
名称 | 类型 | 描述 |
---|---|---|
- | - | - |
输出参数-实时行情数据:
名称 | 类型 | 描述 |
---|---|---|
symbol | str | - |
name | str | - |
trade | str | - |
pricechange | str | - |
changepercent | str | - |
buy | str | - |
sell | str | - |
settlement | str | - |
open | str | - |
high | str | - |
low | str | - |
volume | int | - |
amount | int | - |
code | str | - |
ticktime | str | - |
接口示例-实时行情数据:
import mssdk as ms
stock_df = ms.stock_zh_index_spot()
stock_df
symbol | name | trade | pricechange | changepercent | buy | sell | settlement | open | high | low | volume | amount | code | ticktime | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | sh000001 | 上证指数 | 3366.9832 | -0.249 | -0.007 | 0 | 0 | 3367.2326 | 3371.2632 | 3378.6626 | 3359.1705 | 220813976 | 308823385267 | 000001 | 15:13:39 |
1 | sh000002 | A股指数 | 3529.2750 | -0.259 | -0.007 | 0 | 0 | 3529.5344 | 3533.7660 | 3541.5356 | 3521.0769 | 220606098 | 308243548844 | 000002 | 15:13:39 |
2 | sh000003 | B股指数 | 235.6013 | -0.097 | -0.041 | 0 | 0 | 235.6984 | 235.6984 | 236.2723 | 235.0140 | 130973 | 59839355 | 000003 | 15:13:39 |
3 | sh000004 | 工业指数 | 2937.1848 | 1.397 | 0.048 | 0 | 0 | 2935.7881 | 2938.6448 | 2946.0800 | 2931.3038 | 142110548 | 221323216990 | 000004 | 15:13:39 |
4 | sh000005 | 商业指数 | 3193.5744 | -19.291 | -0.600 | 0 | 0 | 3212.8655 | 3209.8971 | 3213.8967 | 3190.2668 | 16207026 | 25360080386 | 000005 | 15:13:39 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
574 | sz399998 | 中证煤炭 | 1253.516 | -9.543 | -0.756 | 0.000 | 0.000 | 1263.059 | 1264.915 | 1278.702 | 1252.034 | 820847862 | 4843110641 | 399998 | 15:02:00 |
575 | sz980001 | 1636.065 | 8.829 | 0.543 | 0.000 | 0.000 | 1627.236 | 1634.910 | 1640.797 | 1629.960 | 2286000804 | 73954935130 | 980001 | 15:35:57 | |
576 | sz980017 | 8797.670 | -120.140 | -1.347 | 0.000 | 0.000 | 8917.810 | 8888.562 | 8896.159 | 8773.637 | 512133757 | 23232674798 | 980017 | 15:01:02 | |
577 | sz980023 | 2885.671 | -0.781 | -0.027 | 0.000 | 0.000 | 2886.452 | 2897.341 | 2898.821 | 2879.657 | 730217835 | 19142706333 | 980023 | 15:35:57 | |
578 | sz980068 | 1992.621 | -10.394 | -0.519 | 0.000 | 0.000 | 2003.015 | 2004.459 | 2007.402 | 1991.218 | 1057211392 | 9573917163 | 980068 | 15:35:57 |
579 rows × 15 columns
接口: stock_zh_index_daily
描述: 股票指数数据的历史数据按日频率更新
限量: 单次返回具体某个指数的所有历史行情数据
输入参数:
名称 | 类型 | 描述 |
---|---|---|
symbol | str | symbol="sz399552" |
输出参数-历史行情数据:
名称 | 类型 | 描述 |
---|---|---|
date | str | 新浪的数据开始时间, 不是证券上市时间 |
open | float | - |
high | float | - |
low | float | - |
close | float | - |
volume | float | - |
接口示例-历史行情数据
import mssdk as ms
stock_zh_index_daily_df = ms.stock_zh_index_daily(symbol="sz399551")
stock_zh_index_daily_df
open | high | low | close | volume | |
---|---|---|---|---|---|
date | |||||
2013-06-06 | 4292.747 | 4301.747 | 4241.195 | 4243.962 | 3.981258e+08 |
2013-06-07 | 4249.735 | 4291.510 | 4172.918 | 4215.467 | 4.022790e+08 |
2013-06-13 | 4157.919 | 4157.919 | 4009.029 | 4156.027 | 3.698634e+08 |
2013-06-14 | 4168.914 | 4323.536 | 4168.914 | 4310.456 | 4.562316e+08 |
2013-06-17 | 4332.291 | 4385.733 | 4310.696 | 4328.840 | 4.423041e+08 |
... | ... | ... | ... | ... | ... |
2021-03-23 | 9254.509 | 9325.773 | 9115.355 | 9189.006 | 1.785505e+09 |
2021-03-24 | 9126.195 | 9210.246 | 9014.156 | 9025.956 | 1.436271e+09 |
2021-03-25 | 8979.066 | 9095.230 | 8942.097 | 8997.790 | 1.489227e+09 |
2021-03-26 | 9043.594 | 9365.723 | 9043.594 | 9321.560 | 1.784510e+09 |
2021-03-29 | 9370.938 | 9418.296 | 9263.665 | 9286.918 | 1.415742e+09 |
1902 rows × 5 columns
接口: stock_zh_index_daily_tx
描述: 获取股票指数(或者股票)历史行情数据
限量: 单次返回具体某个股票指数(或者股票)的所有历史行情数据
输入参数:
名称 | 类型 | 描述 |
---|---|---|
symbol | str | symbol="sh000919" |
输出参数-历史行情数据:
名称 | 类型 | 描述 |
---|---|---|
date | str | 腾讯的数据开始时间, 不是证券上市时间 |
open | float | - |
close | float | - |
high | float | - |
low | float | - |
amount | float | - |
接口示例-历史行情数据:
import mssdk as ms
stock_zh_index_daily_tx_df = ms.stock_zh_index_daily_tx(symbol="sh000919")
stock_zh_index_daily_tx_df
100%|██████████| 17/17 [00:13<00:00, 1.24it/s]
open | close | high | low | amount | |
---|---|---|---|---|---|
date | |||||
2005-01-04 | 993.11 | 978.14 | 993.11 | 976.82 | 4235500.0 |
2005-01-05 | 976.94 | 981.50 | 985.52 | 972.79 | 3366739.0 |
2005-01-06 | 982.37 | 968.90 | 982.37 | 966.52 | 3137880.0 |
2005-01-07 | 968.77 | 967.72 | 978.27 | 963.10 | 3340480.0 |
2005-01-10 | 967.81 | 977.77 | 978.15 | 963.31 | 2680019.0 |
... | ... | ... | ... | ... | ... |
2021-01-21 | 5442.02 | 5457.31 | 5496.34 | 5417.68 | 81334021.0 |
2021-01-22 | 5451.02 | 5385.60 | 5451.02 | 5356.18 | 76805439.0 |
2021-01-25 | 5367.69 | 5391.70 | 5405.90 | 5309.66 | 76335359.0 |
2021-01-26 | 5368.39 | 5334.48 | 5398.36 | 5331.89 | 63300515.0 |
2021-01-27 | 5336.97 | 5371.72 | 5393.42 | 5336.97 | 66035284.0 |
3907 rows × 5 columns