雅虎金融股票报价api [英] yahoo finance stock quote api

查看:174
本文介绍了雅虎金融股票报价api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法以json格式从yahoo api获取历史股价?我想使用REST,因为它更轻巧.

Is there any way to get historical stock prices from the yahoo api in the json format? I'd like to use REST because it's more lightweight.

推荐答案

通过具体示例跟进user586050的答案...

To follow up on user586050's answer with a specific example...

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

You can use the YQL yahoo.finance.historical data table for this request, and have the results come back in JSON format.

例如,尝试以下查询(该链接会将您带到YQL控制台,您可以在其中使用它):

For example try this query (the link will take you to the YQL console where you can play with it):

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

采样结果为JSON格式:

Sample results in JSON format:

{
 "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"
    }
   ]
  }
 }
}

这篇关于雅虎金融股票报价api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆