Skip to content

Instantly share code, notes, and snippets.

@0x4f53
Created June 9, 2021 22:20
Show Gist options
  • Save 0x4f53/bd7fc6ed95e6abacafa55084867c44c3 to your computer and use it in GitHub Desktop.
Save 0x4f53/bd7fc6ed95e6abacafa55084867c44c3 to your computer and use it in GitHub Desktop.
Get company ticker symbol / code from name in Python
import requests
def getTicker (company_name):
url = "https://s.yimg.com/aq/autoc"
parameters = {'query': company_name, 'lang': 'en-US'}
response = requests.get(url = url, params = parameters)
data = response.json()
company_code = data['ResultSet']['Result'][0]['symbol']
return company_code
@0x4f53
Copy link
Author

0x4f53 commented May 29, 2024

Done, we all do things we find silly as we grow up 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment