3

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?

Eric
  • 95
  • 2
  • 11

2 Answers2

6

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

mindaugasw
  • 1,116
  • 13
  • 18
stlawrence
  • 169
  • 1
  • 2
  • 11
  • The author of the GitHub project mentioned it has no affiliation with AlphaVantage, so I wonder how this is figured out, and what more other useful APIs there are that's not publicized. – kawingkelvin Jan 03 '20 at 22:43
  • this is great but it didn't seem to have open, high, and low ? – kawingkelvin Jan 03 '20 at 22:53
  • 17
    Did they shut this down? Bummer. "This API function (BATCH_STOCK_QUOTES) does not exist." – RJB Jan 31 '20 at 01:41
-4

They created a new section called Listing & Delisting Status

https://www.alphavantage.co/documentation/

This will download a csv file with all the stocks and the exchange they are on.

https://www.alphavantage.co/query?function=LISTING_STATUS&apikey=demo

It looks like this

enter image description here

You can import this and than loop trough all the stocks that have NASDAQ to find the metrics you need

Jakub
  • 1,260
  • 1
  • 13
  • 40