Created
June 9, 2021 22:20
-
-
Save 0x4f53/bd7fc6ed95e6abacafa55084867c44c3 to your computer and use it in GitHub Desktop.
Get company ticker symbol / code from name in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Created a new gist which will get this working again. Same code pretty much just using a different Yahoo finance endpoint.
(My username was changed from "bruhbruhroblox" to "leftmove")
Awesome dude! I'll link it up there and credit you.
It does not longer work to me unfortunately @bruhbruhroblox
Hi everyone, it seems that changing my username caused my linked gist to stop working.
@0x4f53 If you can, please link the new gist with the new link.
https://gist.github.com/leftmove/dd9d981c8c37983f61e423a45085e063
I had to change my username as I created it when I was young. Sorry for the incoveinence!
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
Unfortunately, it returns now 403 Client Error: Forbidden for this url.