qtrade icon indicating copy to clipboard operation
qtrade copied to clipboard

403 Client Error - get_historical_data

Open jaymon0703 opened this issue 3 years ago • 4 comments

Firstly, thanks @jborchma for this library.

I am able to download data such as ticker information, account info etc, but when i try to download historical data i get the below error:

HTTPError: 403 Client Error: Forbidden for url: https://api02.iq.questrade.com/v1/markets/candles/36261155?startTime=2019-07-01T00%3A00%3A00-05%3A00&endTime=2019-07-02T00%3A00%3A00-05%3A00&interval=OneDay

Does this mean i do not have access to historical market data?

Anyone else get this issue?

Thanks

jaymon0703 avatar Jan 25 '22 05:01 jaymon0703

Yeah, I have never gotten an answer when trying to reach out to their api support. This is a new one, though. Let me see if they changed the API URL recently (or took out the historical data capability all together).

jborchma avatar Jan 25 '22 23:01 jborchma

So I just tested it myself on my computer and I was able to successfully get historical data for the OneDay interval no problem. I ran

aapl_history = qt.get_historical_data('AAPL', '2020-04-01', '2020-04-02', 'OneDay')

jborchma avatar Jan 26 '22 01:01 jborchma

Ok, well that's good.

Can you confirm if your request URL is similar in format to the below?

https://api02.iq.questrade.com/v1/markets/candles/8049?startTime=2020-04-01T00%3A00%3A00-05%3A00&endTime=2020-04-02T00%3A00%3A00-05%3A00&interval=OneDay

My only suspicion is either its an access issue, or the format of the URL is incorrect for the : characters which get transformed to %3A which i tried resolving in the source code by changing the payload param from a dict to a str but to no avail.

jaymon0703 avatar Jan 26 '22 02:01 jaymon0703

Hmm, so the creation of the URL submissions for the API are standardized and I don't see how they could be working correctly for me and then not work in a different case. I would assume this is just the error message encoding that gets sent back from Questrade.

jborchma avatar Jan 29 '22 21:01 jborchma

Gonna close this issue since we never found any issue to fix.

jborchma avatar Feb 18 '23 16:02 jborchma