Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ def get_dcf_of_company(company_name: str) -> str:
|
|
| 24 |
try:
|
| 25 |
# Step 1: Retrieve the stock ticker symbol
|
| 26 |
global api_key
|
| 27 |
-
search_url = f'https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords={company_name}&apikey=
|
| 28 |
response = requests.get(search_url)
|
| 29 |
data = response.json()
|
| 30 |
if 'bestMatches' in data and len(data['bestMatches']) > 0:
|
|
@@ -33,7 +33,7 @@ def get_dcf_of_company(company_name: str) -> str:
|
|
| 33 |
return f"No stock symbol found for company '{company_name}'."
|
| 34 |
|
| 35 |
# Step 2: Retrieve the company's financial data
|
| 36 |
-
overview_url = f'https://www.alphavantage.co/query?function=OVERVIEW&symbol={symbol}&apikey=
|
| 37 |
response = requests.get(overview_url)
|
| 38 |
overview = response.json()
|
| 39 |
if not overview:
|
|
|
|
| 24 |
try:
|
| 25 |
# Step 1: Retrieve the stock ticker symbol
|
| 26 |
global api_key
|
| 27 |
+
search_url = f'https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords={company_name}&apikey=NR9AFISYRYH2B5U3'
|
| 28 |
response = requests.get(search_url)
|
| 29 |
data = response.json()
|
| 30 |
if 'bestMatches' in data and len(data['bestMatches']) > 0:
|
|
|
|
| 33 |
return f"No stock symbol found for company '{company_name}'."
|
| 34 |
|
| 35 |
# Step 2: Retrieve the company's financial data
|
| 36 |
+
overview_url = f'https://www.alphavantage.co/query?function=OVERVIEW&symbol={symbol}&apikey=NR9AFISYRYH2B5U3'
|
| 37 |
response = requests.get(overview_url)
|
| 38 |
overview = response.json()
|
| 39 |
if not overview:
|