For example, if I want to list out all the stocks on NASAQ and their closing price, is there a way to do this without using the API for each individual stock?
What I mean is, you pull data for a company using the company's ticker symbol in the API url. If there are 3000 companies on the NASDAQ, can I get all their closing prices without calling the URL 3000 times?
Yes, there is an undocumented BATCH_STOCK_QUOTES that lets you pass in a comma seperated list of ticker symbols.
It seems like the endpoint BATCH_STOCK_QUOTES is not working anymore.
Example HTTP GET request (use your apikey instead of xxx):
https://www.alphavantage.co/query?function=BATCH_STOCK_QUOTES&apikey=xxx&symbols=MSFT,AAPL,FB
Response:
{
"Meta Data": {
"1. Information": "Batch Stock Market Quotes",
"2. Notes": "IEX Real-Time",
"3. Time Zone": "US/Eastern"
},
"Stock Quotes": [
{
"1. symbol": "MSFT",
"2. price": "119.1900",
"3. volume": "10711735",
"4. timestamp": "2019-04-09 14:39:53"
},
{
"1. symbol": "AAPL",
"2. price": "199.9100",
"3. volume": "27681098",
"4. timestamp": "2019-04-09 14:39:56"
},
{
"1. symbol": "FB",
"2. price": "177.1800",
"3. volume": "14088849",
"4. timestamp": "2019-04-09 14:39:50"
}
]
}
I found this looking at the source of this javascript api wrapper: https://github.com/zackurben/alphavantage
Specifically: https://raw.githubusercontent.com/zackurben/alphavantage/master/lib/data.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With