-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunfirst.py
More file actions
30 lines (28 loc) · 740 Bytes
/
runfirst.py
File metadata and controls
30 lines (28 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#%%
import requests
import datetime
dataset = []
#%%
tickers = ['AMZN', 'IBM', 'GM', 'GOOGL', 'FDX']
for i in tickers:
url = 'https://www.alphavantage.co/query?function=TIME_SERIES_WEEKLY&symbol=' + i + '&apikey=Y757ROOTC67QABNT'
r = requests.get(url)
data = r.json()
dataset.append(data)
#%%
# tickers = ['TSLA', 'MA']
# for i in tickers:
# url = 'https://www.alphavantage.co/query?function=TIME_SERIES_WEEKLY&symbol=' + i + '&apikey=Y757ROOTC67QABNT'
# r = requests.get(url)
# data = r.json()
# dataset.append(data)
# %%
f = open('dataset.txt', 'w')
f.write(str(dataset))
f.close()
# %%
import datetime
str(datetime.date(2021,9,10)-datetime.timedelta(7*2))
# %%
len(dataset)
# %%