Spaces:
Running
Running
Update pages/Sentiment_Data_Input.py
Browse files
pages/Sentiment_Data_Input.py
CHANGED
|
@@ -6,8 +6,6 @@ import datetime
|
|
| 6 |
import sqlite3
|
| 7 |
import pandas as pd
|
| 8 |
|
| 9 |
-
with open('secrets.json') as f:
|
| 10 |
-
content = json.load(f)
|
| 11 |
|
| 12 |
# API DOC: https://finnhub.io/docs/api/introduction
|
| 13 |
|
|
@@ -18,7 +16,7 @@ def get_finnhub_data(example: str) -> json:
|
|
| 18 |
:param1 example: '/company-news?symbol=AAPL&from=2023-08-15&to=2023-08-20'
|
| 19 |
"""
|
| 20 |
base_url = 'https://finnhub.io/api/v1//'
|
| 21 |
-
token = f"&
|
| 22 |
|
| 23 |
request = requests.get(f"{base_url}{example}{token}")
|
| 24 |
return request.json()
|
|
|
|
| 6 |
import sqlite3
|
| 7 |
import pandas as pd
|
| 8 |
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# API DOC: https://finnhub.io/docs/api/introduction
|
| 11 |
|
|
|
|
| 16 |
:param1 example: '/company-news?symbol=AAPL&from=2023-08-15&to=2023-08-20'
|
| 17 |
"""
|
| 18 |
base_url = 'https://finnhub.io/api/v1//'
|
| 19 |
+
token = f"&apikey={os.environ['finnhub_token']}"
|
| 20 |
|
| 21 |
request = requests.get(f"{base_url}{example}{token}")
|
| 22 |
return request.json()
|