Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Company profile FinnhubAPIException(status_code: 403) #527

Open
sirio3mil opened this issue Nov 16, 2023 · 1 comment
Open

Company profile FinnhubAPIException(status_code: 403) #527

sirio3mil opened this issue Nov 16, 2023 · 1 comment

Comments

@sirio3mil
Copy link

When I try to get info for ticker with 'dot' I always get 403 error

f.e.

finnhub_client = finnhub.Client(api_key)

symbol = 'ORP.PA'
isin = 'FR0000184798'

res = finnhub_client.company_profile2(symbol=symbol)
print(res)

With ISIN I get the correct answer and ticker match, but if I use symbol with dot I get

     12 # Stock candles
---> 13 res = finnhub_client.company_profile2(symbol=symbol)
     14 print(res)

File /opt/homebrew/lib/python3.11/site-packages/finnhub/client.py:88, in Client.company_profile2(self, **params)
     87 def company_profile2(self, **params):
---> 88     return self._get("/stock/profile2", params=params)

File /opt/homebrew/lib/python3.11/site-packages/finnhub/client.py:71, in Client._get(self, path, **kwargs)
     70 def _get(self, path, **kwargs):
---> 71     return self._request("get", path, **kwargs)

File /opt/homebrew/lib/python3.11/site-packages/finnhub/client.py:41, in Client._request(self, method, path, **kwargs)
     38 kwargs["params"] = self._format_params(kwargs.get("params", {}))
     40 response = getattr(self._session, method)(uri, **kwargs)
---> 41 return self._handle_response(response)

File /opt/homebrew/lib/python3.11/site-packages/finnhub/client.py:46, in Client._handle_response(response)
     43 @staticmethod
     44 def _handle_response(response):
     45     if not response.ok:
---> 46         raise FinnhubAPIException(response)
     48     try:
     49         content_type = response.headers.get('Content-Type', '')

FinnhubAPIException: FinnhubAPIException(status_code: 403): You don't have access to this resource.

this is the proper response using ISIN

{
    "country": "FR",
    "currency": "EUR",
    "estimateCurrency": "EUR",
    "exchange": "NYSE EURONEXT - EURONEXT PARIS",
    "finnhubIndustry": "Health Care",
    "ipo": "2002-04-16",
    "logo": "https://static2.finnhub.io/file/publicdatany/finnhubimage/stock_logo/942958666376.svg",
    "marketCapitalization": 38.789833,
    "name": "Orpea SA",
    "phone": "33147757807.0",
    "shareOutstanding": 1005.5026964743798,
    "ticker": "ORP.PA",
    "weburl": "https://www.orpea.com/"
}
@pparasuram
Copy link

helpless Finnhub, I give up on this software

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants