Created
October 10, 2022 23:49
-
-
Save kikura3/b3847100817764fadc63e5c5cae8275d to your computer and use it in GitHub Desktop.
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
from dateutil import rrule | |
from datetime import datetime | |
import requests | |
start = '20220101' | |
end = '20220926' | |
DIGICONOMIST_URL = 'https://digiconomist.net/wp-json/mo/v1/ethereum/stats/' | |
result = [] | |
for dt in rrule.rrule(rrule.DAILY, | |
dtstart=datetime.strptime(start, '%Y%m%d'), | |
until=datetime.strptime(end, '%Y%m%d')): | |
dt_s = dt.strftime('%Y%m%d') | |
url = DIGICONOMIST_URL + dt_s | |
response = requests.get(url) | |
output = response.json() | |
if len(output) != 0: | |
data = output[0] | |
data['date'] = dt_s | |
result.append(data) | |
else: | |
print('data missing for ', dt_s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment