yahoo finance stock quote api
Asked Answered
C

3

7

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.

Compartmentalize answered 25/12, 2010 at 3:38 Comment(2)
Your question is facetious; JSON doesn't require REST.Couple
Sorry just trying to say that I'd like to have JSON returned when using the yahoo APICompartmentalize
T
2

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

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

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"

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"
    }
   ]
  }
 }
}
Trillium answered 31/12, 2011 at 19:48 Comment(0)
H
0

You can use YQL to fetch data. look at here the code in C#.

Or if you want current stock look at https://github.com/samkiller/stoxxbees You can have stock data in both xml or json.

Halfslip answered 24/3, 2011 at 19:1 Comment(1)
This project does not exist.Holiday
P
0

get json format you can use YQL to send request and get response, if you want to get history data in spreadsheet, you can use http://ichart.finance.yahoo.com/table.csv?s=company symbol e.g open http://ichart.finance.yahoo.com/table.csv?s=MD in your browser

Porpoise answered 19/8, 2016 at 11:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.