Closed benbense closed 3 years ago
Hello @benbense,
I have been using this function to grab the company name based on ticker symbol.
import requests
def get_company_names(symbol):
"Get company name based on symbol/ticker-label"
url = "http://d.yimg.com/autoc.finance.yahoo.com/autoc?query="+symbol+"®ion=1&lang=en"
result = requests.get(url).json()
return result["ResultSet"]["Result"][0]["name"]
You can try it out.
The input is a string with the ticker label. For example:
symbol = "AAPL"
company_name = get_company_names(symbol)
The original function can be found here.
thanks @frank-ceballos for the solution
Is there a way to get the company name by the ticker symbol?