waditu / tushare

TuShare is a utility for crawling historical data of China stocks
BSD 3-Clause "New" or "Revised" License
12.87k stars 4.29k forks source link

realtime_quote 接口, 使用 src=‘sn’, 每次只能返回一条数据 #1739

Closed Xingtao closed 4 months ago

Xingtao commented 4 months ago

按文档:https://tushare.pro/document/2?doc_id=315, 应该最多每次可以query 50个tscode,返回50条数据

df = ts.realtime_quote(ts_code='000001.SZ,000002.SZ,', src='sn') df NAME TS_CODE DATE TIME OPEN PRE_CLOSE PRICE HIGH LOW ... A1_P A2_V A2_P A3_V A3_P A4_V A4_P A5_V A5_P 0 平安银行 000001.SZ 20240618 13:23:12 10.04 10.1 10.12 10.16 10.11 ... 10.12 7205 10.13 8427 10.14 10882 10.15 11088 10.16

[1 rows x 33 columns]

Xingtao commented 4 months ago

操作系统是:ubuntu 22.04 tushare 1.3.7, 1.4.6 都有此问题; 在 windows 上: 可以正常返回 50条数据

Xingtao commented 4 months ago

基本确定是新浪会对某些ip限流; 这个有问题的是 使用腾讯云的上海区服务器