finnhub-python icon indicating copy to clipboard operation
finnhub-python copied to clipboard

Tick data rate limited incorrectly unless endpoint explicitly set to ticks.finnhub.io

Open Madman600 opened this issue 4 years ago • 4 comments

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.

Madman600 avatar Sep 24 '20 18:09 Madman600

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 print(finnhub_client.stock_tick('AAPL', '2020-03-25', 500, 0)) File "C:\Users\soren\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\finnhub\client.py", line 217, in stock_tick return self._get("/stock/tick", params=params) File "C:\Users\soren\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\finnhub\client.py", line 69, in _get return self._request("get", path, **kwargs) File "C:\Users\soren\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\finnhub\client.py", line 39, in _request return self._handle_response(response) File "C:\Users\soren\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\finnhub\client.py", line 44, 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]

kwsorensen avatar Sep 27 '20 04:09 kwsorensen

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]```

aseams avatar Jun 16 '22 14:06 aseams

              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

quanthero avatar Jul 03 '22 03:07 quanthero

it works for me

quanthero avatar Jul 03 '22 03:07 quanthero