Alternative to google finance api
Updating answer a bit
1. Try Twelve Data API
For beginners try to run the following query with a JSON response:
https://api.twelvedata.com/time_series?symbol=AAPL&interval=1min&apikey=demo&source=docs
NO more real time Alpha Vantage API
For beginners you can try to get a JSON output from query such as
https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=MSFT&apikey=demo
DON'T Try Yahoo Finance API (it is DEPRECATED or UNAVAILABLE NOW).
- Here is a link to previous Yahoo Finance API discussion on StackOverflow.
- Here's an alternative link to Yahoo Finance API posted on Google Code.
For beginners, you can generate a CSV with a simple API call:
http://finance.yahoo.com/d/quotes.csv?s=AAPL+GOOG+MSFT&f=sb2b3jk
(This will generate and save a CSV for AAPL, GOOG, and MSFT)
Note that you must append the format to the query string (f=..
). For an overview of all of the formats see this page.
For more examples, visit this page.
For XML and JSON-based data, you can do the following:
Don't use YQL (Yahoo Query Language)
For example:
http://developer.yahoo.com/yql/console/?q=select%20*%20from%20yahoo.finance
.quotes%20where%20symbol%20in%20(%22YHOO%22%2C%22AAPL%22%2C%22GOOG%22%2C%22
MSFT%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env
2. Use the webservice
For example, to get all stock quotes in XML:
http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote
To get all stock quotes in JSON, just add format=JSON
to the end of the URL:
http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote?format=json
Alternatives:
Currency API
- 165+ real time currency rates, including few cryptos. Docs here.
Financial Content API
- The documentation for this API is very good.
IEX
Open Exchange Rates
Polygon
XE API
Xignite API
currencylayer API
Other APIs - discussed at programmableWeb
I'm way late, but check out Quandl. They have an API for stock prices and fundamentals.
Here's an example call, using Quandl-api download in csv
example:
https://www.quandl.com/api/v1/datasets/WIKI/AAPL.csv?column=4&sort_order=asc&collapse=quarterly&trim_start=2012-01-01&trim_end=2013-12-31
They support these languages. Their source data comes from Yahoo Finance, Google Finance, NSE, BSE, FSE, HKEX, LSE, SSE, TSE and more (see here).
I'd suggest using TradeKing's developer API. It is very good and free to use. All that is required is that you have an account with them and to my knowledge you don't have to carry a balance ... only to be registered.