Hi all,
I am trying to download some historical data from the last 2 months using python but seem to be running into some issues, I was wondering has anyone been using python rather than R that could help me out?
This is where I’m at so far:
import requests
#store API read key
read_key = ‘XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX’
#assigning URL that request is being sent to
my_url = 'https://api.purpleair.com/v1/sensors/' + str(XXXXX)
#assigning context of request
my_headers = {'X-API-Key':read_key}
r = requests.get(my_url, headers=my_headers)
print (r.content)
return (r)