gpt4 book ai didi

json - 雅虎财经股票报价API

转载 作者:行者123 更新时间:2023-12-04 12:49:45 27 4
gpt4 key购买 nike

有没有什么办法可以从yahoo api中获取json格式的历史股价?我想使用 REST,因为它更轻量级。

最佳答案

用一个具体的例子来跟进 user586050 的回答......

您可以使用 YQL此请求的 yahoo.finance.historical 数据表,并将结果以 JSON 格式返回。

例如,试试这个查询(链接会带你到 YQL 控制台,你可以在那里玩它):

select * from yahoo.finance.historicaldata where symbol = "YHOO" and startDate = "2009-09-11" and endDate = "2009-09-15"

JSON 格式的示例结果:

{
"query": {
"count": 3,
"created": "2011-12-31T19:44:20Z",
"lang": "en-US",
"results": {
"quote": [
{
"date": "2009-09-15",
"Date": "2009-09-15",
"Open": "16.01",
"High": "16.49",
"Low": "15.87",
"Close": "16.41",
"Volume": "64668200",
"Adj_Close": "16.41"
},
{
"date": "2009-09-14",
"Date": "2009-09-14",
"Open": "15.45",
"High": "15.58",
"Low": "15.28",
"Close": "15.57",
"Volume": "19451200",
"Adj_Close": "15.57"
},
{
"date": "2009-09-11",
"Date": "2009-09-11",
"Open": "15.53",
"High": "15.68",
"Low": "15.41",
"Close": "15.59",
"Volume": "26860700",
"Adj_Close": "15.59"
}
]
}
}
}

关于json - 雅虎财经股票报价API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4529217/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com