import requests
api_url = 'https://data.infoway.io/stock/batch_kline/1/10/002594.SZ'
# 官方网站:www.infoway.io
# Github:https://github.com/infoway-api/realtime-market-data-api
# 设置请求头
headers = {
'User-Agent': 'Mozilla/5.0',
'Accept': 'application/json',
'apiKey': 'yourApikey'
}
# 发送GET请求
response = requests.get(api_url, headers=headers)
# 输出结果
print(f"HTTP code: {response.status_code}")
print(f"message: {response.text}")
下面是测试返回的结果:
{
"s": "002594.SZ", //产品代码
"respList": [
{
"t": "1751958000", //秒时间戳(UTC+8)
"h": "326.880", //最高价
"o": "326.880", //开盘价
"l": "326.880", //最低价
"c": "326.880", //收盘价
"v": "1410", //成交量
"vw": "460900.80", //成交额
"pc": "0.00%", //涨跌幅
"pca": "0.000" //涨跌额
}
]
}
更多接入教程可以看API 文档。
點擊查看更多內(nèi)容
為 TA 點贊
評論
評論
共同學(xué)習(xí),寫下你的評論
評論加載中...
作者其他優(yōu)質(zhì)文章
正在加載中
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦