Incorrect behavior of /v2/stocks/auctions API

Hi, I observed some very odd results using this API. If you run this command:

GET https://data.alpaca.markets/v2/stocks/auctions?symbols=A%2CGOEV&start=2016-01-01&end=2024-08-23&limit=2000&feed=sip&sort=asc

Basically I want to get all auction data for symbol “A” and “GOEV” (could be any other two combined). BUT the responses only contain data of “A”. And even for “A” the auction history isn’t complete, it only returns 2016-01-01 to 2022-12-14. next_page_token is None so there isn’t more data to download.

If I get data separately (one symbol a time) using

GET https://data.alpaca.markets/v2/stocks/auctions?symbols=GOEV&start=2016-01-01&end=2024-08-23&limit=2000&feed=sip&sort=asc

I can download the full history. So looks like this API doesn’t support multi-symbol parameters?

@PatL The issue is you are including the limit=2000 parameter. The API returns 2000 records and stops. That is why 1) you see None as the next_page_token (ie it returned the requested 2000 records so there isn’t a next page) and 2) it stops at 2022-12-14 and 3) doesn’t return GOEV (ie the limit parameter is total records and not records per symbol. It returned 2000 A records and stopped).

The fix is to not include the limit parameter. You will get next_page_tokens so you will need to page to then get all dates for all symbols.

I see, that works thank you!

Although I would recommend to make it more explicit in the api doc, from the doc it looks to me I have to set limit in order to see next_page_token set.

This actually is a bug. It should return all the GOEV auctions or a next_page_token with limit = 2000. Thank you for reporting this and we’re going to fix it.

@PatL Thanks again for reporting this bug, it has been fixed:

$ curl -s -H "APCA-API-KEY-ID: ${APCA_API_KEY_ID}" -H "APCA-API-SECRET-KEY: ${APCA_API_SECRET_KEY}" \
"https://data.alpaca.markets/v2/stocks/auctions?symbols=A%2CGOEV&start=2016-01-01&end=2024-08-23&limit=2000&feed=sip&sort=asc" | jq '.next_page_token'
"QXwxNjcwOTc2MDAwMDAzMjg0NzM2fE58IE18MTU3LjY2"

$ curl -s -H "APCA-API-KEY-ID: ${APCA_API_KEY_ID}" -H "APCA-API-SECRET-KEY: ${APCA_API_SECRET_KEY}" \
"https://data.alpaca.markets/v2/stocks/auctions?symbols=A%2CGOEV&start=2016-01-01&end=2024-08-23&limit=2000&feed=sip&sort=asc&page_token=QXwxNjcwOTc2MDAwMDAzMjg0NzM2fE58IE18MTU3LjY2" | jq '.auctions.GOEV | length'
898

Thank you for the rapid fix. I haven’t checked but I believe this will work.

Hey there! Thanks for sharing!