-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 additions
and
10 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
import requests | ||
import os | ||
|
||
def get_data(): | ||
# res = requests.get("https://dummyjson.com/products?limit=10&select=id,title,brand,price") | ||
# data = res.json().get('products') | ||
# print(f"Loaded {len(data)} rows of JSON from the API") | ||
# return data | ||
|
||
# r = requests.get("https://www.goodjudgment.io/futurefirst/api/forecasts", headers = {"Authorization": "Bearer 8030152dfa8a9930ec132f831500dd54c55c1889"}) | ||
r = requests.get("https://goodjudgment.io/futurefirst/api/fcsv", headers = {"Authorization": "Bearer 8030152dfa8a9930ec132f831500dd54c55c1889"}) | ||
|
||
# Retrieve the environment variable "key" | ||
key = os.getenv("FUTURE_FIRST") | ||
|
||
#r.json() | ||
#r.json()["status"] | ||
# r = requests.get("https://goodjudgment.io/futurefirst/api/fcsv", headers = {"Authorization": "Bearer 8030152dfa8a9930ec132f831500dd54c55c1889"}) | ||
|
||
r = requests.get( | ||
"https://goodjudgment.io/futurefirst/api/fcsv", | ||
headers = {"Authorization": "Bearer " + key} | ||
) | ||
|
||
data = r.json()["data"] | ||
print(f"Loaded {len(data)} rows of CSV from the API") | ||
return data | ||
|
||
#res = r.json() | ||
|
||
|
||
|
||
|