last_quote API keeps returning "Not found" regardless of the symbol

last_quote API keeps returning “Not found” regardless of the symbol

This is likely due to the fact that today is Thanksgiving. Markets are closed.

I mean, there should still be a last quote, right? There must be a most recent price that is being referenced when the buying power decreases following an order placed when markets are closed. Simply getting “Not Found” is kind of dubious.

On further trials and observations, it looks like the “Not Found” response may not be coming from Alpaca, but from the curl connection. Could someone please verify that this is the correct uri to get the last quote for GOOG ?
Thank you.

The Data API endpoint is different from the Trading API endpoint. The URL for data requests such as last and last_quote is So the following should work

The URL is for account things like submitting orders, account status, etc. It’s easy to overlook, but check out the docs under “Endpoint”.

1 Like

Thank you. Very helpful.

I changed the uri and it worked for a while (Alpaca was responding with the quotes).
I did not use this api for a while. and now it responds “Token not valid in this context”.
So, I decided to use the API key/secret instead. It is a GET request, so I just appended them to the uri:
(key_value and secret_value are constants set to the current values)
Now, Alpaca responds “Forbidden”
Could you please put me on the right track to fix this issue? Maybe I am using the wrong names?
Thank you

@Frank_Simtob My first guess would be that you are using your paper-trading API keys and you have recently reset your paper trading account. If so, that requires you to regenerate your keys. There is another post here which may also help. Try that and get back if it doesn’t work.

Thank you for your prompt reply.
I am using the paper account. I did not reset it but I regenerated a set of keys.
Using the new values, Alpaca still returns “message: forbidden”.
There is no code or error code.
What would you suggest next?

This is a long shot but would your account ID happen to be one in this list?


Those accounts for some reason have two or more paper accounts which is confusing some of the processes.

I’d be surprised if your account ID is one of those but it’s worth a try?

Neither my API Key nor API Secret match any number in this list.
I also have an account number, but it does not match any in the list
Where do I find my account ID ?

When I call the “account” API (using “token” instead of key/secret), I get a parameter called “id”.
I assume that this would be the account id.
It is not on the list you have given me.
This “account” API is a also a GET request, so I tried it with the key and secret as query arguments appended to the uri., just like in the “last Quote” API. I get the following response :

code : 40110000
message : access key verification failed : access key not found (Code = 40110000)

What would be the next thing to try?
Thank you for your help