finnhub-python
finnhub-python copied to clipboard
Tick data rate limited incorrectly unless endpoint explicitly set to ticks.finnhub.io
I'm on the basic plan.
If I make a call to get tick data I'm incorrectly rate limited to 60 requests/minute. If I change the API_URL to "https://tick.finnhub.io/api/v1" then I'm rate limited correctly to 150/minute.
I just downloaded the python api to test it out.
Ran the code from the readme and received an error at line 147.
# Tick Data
print(finnhub_client.stock_tick('AAPL', '2020-03-25', 500, 0))
File "example.py", line 147, in
Still happening with the readme examples.
File "c:\Users\[USER]\Documents\Code Stuff\python\HoldingsReportGenerator\main.py", line 154, in <module>
print(finnhub_client.stock_tick('AAPL', '2020-03-25', 500, 0))
File "C:\Users\[USER]\AppData\Local\Programs\Python\Python310\lib\site-packages\finnhub\client.py", line 235, in stock_tick
return self._get("/stock/tick", params=params)
File "C:\Users\[USER]\AppData\Local\Programs\Python\Python310\lib\site-packages\finnhub\client.py", line 71, in _get
return self._request("get", path, **kwargs)
File "C:\Users\[USER]\AppData\Local\Programs\Python\Python310\lib\site-packages\finnhub\client.py", line 41, in _request
return self._handle_response(response)
File "C:\Users\[USER]\AppData\Local\Programs\Python\Python310\lib\site-packages\finnhub\client.py", line 46, in _handle_response
raise FinnhubAPIException(response)
finnhub.exceptions.FinnhubAPIException: FinnhubAPIException(status_code: 401): JSON error message from Finnhub: You don't have access to this resources. Please contact [email protected]```
c count p s skip t total v x
0 [1, 24] 500 255.00 AAPL 0 1585123200073 755758 2513 P 1 [1, 24, 12] 500 255.00 AAPL 0 1585123200315 755758 24 P 2 [1, 24, 12] 500 255.00 AAPL 0 1585123200381 755758 1 P 3 [1, 24, 12] 500 255.00 AAPL 0 1585123200381 755758 49 P 4 [1, 8, 24, 12] 500 255.00 AAPL 0 1585123200475 755758 1 P .. ... ... ... ... ... ... ... ... .. 495 [1, 8, 24, 12] 500 254.50 AAPL 0 1585124243237 755758 87 Q 496 [1, 24, 12] 500 254.99 AAPL 0 1585124251405 755758 40 Q 497 [1, 24, 12] 500 254.97 AAPL 0 1585124254835 755758 10 Q 498 [1, 24, 12] 500 254.99 AAPL 0 1585124259561 755758 1 P 499 [1, 24, 12] 500 254.97 AAPL 0 1585124260010 755758 30 Q
it works for me