Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ def get_stock_news(symbol: str)-> str: #it's import to specify the return type
|
|
21 |
|
22 |
api_key = os.getenv("MKTAUX_API_KEY", "YOUR_DEFAULT_API_KEY")
|
23 |
if not api_key:
|
24 |
-
|
25 |
url = f"https://api.marketaux.com/v1/news/all?symbols={symbol}&filter_entities=true&language=en&api_token={api_key}"
|
26 |
|
27 |
response = requests.get(url)
|
|
|
21 |
|
22 |
api_key = os.getenv("MKTAUX_API_KEY", "YOUR_DEFAULT_API_KEY")
|
23 |
if not api_key:
|
24 |
+
raise ValueError("API key is missing! Set MKTAUX_API_KEY in your environment.")
|
25 |
url = f"https://api.marketaux.com/v1/news/all?symbols={symbol}&filter_entities=true&language=en&api_token={api_key}"
|
26 |
|
27 |
response = requests.get(url)
|