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

symbol lookup is not returning useful results #43

Open
Commod0re opened this issue Apr 4, 2022 · 3 comments
Open

symbol lookup is not returning useful results #43

Commod0re opened this issue Apr 4, 2022 · 3 comments

Comments

@Commod0re
Copy link

the API docs show the following example:

import finnhub
finnhub_client = finnhub.Client(api_key="")

print(finnhub_client.symbol_lookup('apple'))

with a sample response:

{
  "count": 4,
  "result": [
    {
      "description": "APPLE INC",
      "displaySymbol": "AAPL",
      "symbol": "AAPL",
      "type": "Common Stock"
    },
    {
      "description": "APPLE INC",
      "displaySymbol": "AAPL.SW",
      "symbol": "AAPL.SW",
      "type": "Common Stock"
    },
    {
      "description": "APPLE INC",
      "displaySymbol": "APC.BE",
      "symbol": "APC.BE",
      "type": "Common Stock"
    },
    {
      "description": "APPLE INC",
      "displaySymbol": "APC.DE",
      "symbol": "APC.DE",
      "type": "Common Stock"
    }
  ]
}

but I am currently getting wildly different results, and AAPL is not among them:

{'count': 22,
 'result': [{'description': 'Apple',
   'displaySymbol': 'A19C0M.DU',
   'symbol': 'A19C0M.DU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'APC5.BE',
   'symbol': 'APC5.BE',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A2R7JV.BE',
   'symbol': 'A2R7JV.BE',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A3KUT4.BE',
   'symbol': 'A3KUT4.BE',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A1HKKY.HA',
   'symbol': 'A1HKKY.HA',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A3KUT3.DU',
   'symbol': 'A3KUT3.DU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'APCU.HM',
   'symbol': 'APCU.HM',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A2R7JV.MU',
   'symbol': 'A2R7JV.MU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A3KUT6.DU',
   'symbol': 'A3KUT6.DU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'APCU.MU',
   'symbol': 'APCU.MU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A3KUT6.MU',
   'symbol': 'A3KUT6.MU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A2R7JT.BE',
   'symbol': 'A2R7JT.BE',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A3KUT5.DU',
   'symbol': 'A3KUT5.DU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'APCL.HM',
   'symbol': 'APCL.HM',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A3KUT5.MU',
   'symbol': 'A3KUT5.MU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A3KUT3.MU',
   'symbol': 'A3KUT3.MU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'APC5.DU',
   'symbol': 'APC5.DU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'APCU.DU',
   'symbol': 'APCU.DU',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'APCA.HM',
   'symbol': 'APCA.HM',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A1HKKY.BE',
   'symbol': 'A1HKKY.BE',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'APCT.BE',
   'symbol': 'APCT.BE',
   'type': ''},
  {'description': 'Apple',
   'displaySymbol': 'A1HKKY.MU',
   'symbol': 'A1HKKY.MU',
   'type': ''}]}

I don't have access to any of these symbols under my current plan, and even if I did, none of these results are expected

@Commod0re
Copy link
Author

I should also note that the sample used to be representative of what this API returned, but this is no longer the case

@abh1nh
Copy link

abh1nh commented Jan 23, 2023

Sorry this is extremely late but I was having the same issue and I'm new to finnhub. Did you figure out what the issue was?

@Commod0re
Copy link
Author

The response I eventually got from Finnhub was to not use symbol_lookup at all, and instead use stock_symbols to build my own daily lookup table

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