from polygon import RESTClient
from typing import cast
from urllib3 import HTTPResponse
# API key for the stocks
client = RESTClient("w4oXBFSyC3bTkpJeVwSnKt8iuwBgMeMy") # api key in quotes
from polygon import RESTClient
from typing import cast
from urllib3 import HTTPResponse
import time
client = RESTClient("w4oXBFSyC3bTkpJeVwSnKt8iuwBgMeMy") # api_key is used
aggs = client.get_aggs("AAPL", 1, "month", "2021-01-01", "2021-12-01")
data = []
for i in range (12):
data.append({"2021-" +str(i + 1) + "-1:": aggs[i].open})
data.append({"2021-" + str(i + 1) + "-1:": aggs[i].close})
print("2021-" + str(i + 1) + "-1:" + str(aggs[i].open))
print("2021-" + str(i + 1) + "-1:" + str(aggs[i].close))
time.sleep(12)
print(data)
from polygon import RESTClient
from typing import cast
from urllib3 import HTTPResponse
import time
client = RESTClient("w4oXBFSyC3bTkpJeVwSnKt8iuwBgMeMy") # api_key is used
aggs = client.get_aggs("TSLA", 1, "month", "2021-01-01", "2021-12-01")
data = []
for i in range (12):
data.append({"2021-" +str(i + 1) + "-1:": aggs[i].open})
data.append({"2021-" + str(i + 1) + "-1:": aggs[i].close})
print("2021-" + str(i + 1) + "-1:" + str(aggs[i].open))
print("2021-" + str(i + 1) + "-1:" + str(aggs[i].close))
time.sleep(12)
print(data)
from polygon import RESTClient
from typing import cast
from urllib3 import HTTPResponse
import time
client = RESTClient("w4oXBFSyC3bTkpJeVwSnKt8iuwBgMeMy") # api_key is used
aggs = client.get_aggs("GME", 1, "month", "2021-01-01", "2021-12-01")
data = []
for i in range (12):
data.append({"2021-" +str(i + 1) + "-1:": aggs[i].open})
data.append({"2021-" + str(i + 1) + "-1:": aggs[i].close})
print("2021-" + str(i + 1) + "-1:" + str(aggs[i].open))
print("2021-" + str(i + 1) + "-1:" + str(aggs[i].close))
time.sleep(12)
print(data)
from polygon import RESTClient
from typing import cast
from urllib3 import HTTPResponse
import time
client = RESTClient("w4oXBFSyC3bTkpJeVwSnKt8iuwBgMeMy") # api_key is used
aggs = client.get_aggs("GOOGL", 1, "month", "2021-01-01", "2021-12-01")
data = []
for i in range (12):
data.append({"2021-" +str(i + 1) + "-1:": aggs[i].open})
data.append({"2021-" + str(i + 1) + "-1:": aggs[i].close})
print("2021-" + str(i + 1) + "-1:" + str(aggs[i].open))
print("2021-" + str(i + 1) + "-1:" + str(aggs[i].close))
time.sleep(12)
print(data)
from polygon import RESTClient
from typing import cast
from urllib3 import HTTPResponse
import time
client = RESTClient("w4oXBFSyC3bTkpJeVwSnKt8iuwBgMeMy") # api_key is used
aggs = client.get_aggs("AMZN", 1, "month", "2021-01-01", "2021-12-01")
data = []
for i in range (12):
data.append({"2021-" +str(i + 1) + "-1:": aggs[i].open})
data.append({"2021-" + str(i + 1) + "-1:": aggs[i].close})
print("2021-" + str(i + 1) + "-1:" + str(aggs[i].open))
print("2021-" + str(i + 1) + "-1:" + str(aggs[i].close))
time.sleep(12)
print(data)