首页 基金行情查询 基金行情查询示例代码 查询ETF/LOF基金历史[Python]

查询ETF/LOF基金历史示例代码Python

作者: 阅读数:6256 上传时间:2026-05-26

查询ETF/LOF基金历史

#!/usr/bin/python
# encoding:utf-8

import requests

data = {"code":"520500", "startdate":"2025-05-01", "enddate":"2025-05-31", "pagesize":"10", "pagenum":"1"}
data["appkey"] = "your_appkey_here"
url = "https://api.jisuapi.com/fund/openhistory"
response = requests.get(url,params=data)
jsonarr = response.json()
if jsonarr["status"] != 0:
    print(jsonarr["msg"])
    exit()
result = jsonarr["result"]
for val in result['list']:
    print(val.date)
    print(val.openningprice)
    print(val.maxprice)