Hi, I a am trying to download my data from the particle dashboard using python. I would like to download a json file of my data in real time as it is published to the Particle Dashboard. Please help. Currently, I am downloading it from my ThingSpeak account.
here is my code:
import json
import urllib
from urllib.request import urlopen
url = urlopen(‘https://api.particle.io/v1/devices/0123456789abcdef01234567/brew
-d access_token=18d1c5d165477448269f57d7cb5e4906280e9be4’)
response = url.read()
data=json.loads(response)
print( data)
CODE FOR THE THINGSPEAK ACCOUNT:
conn = urlopen(“http://api.thingspeak.com/channels/%s/feeds.json?api_key=%s”
% (CHANNEL_ID,READ_API_KEY))
response = conn.read().decode()
#print( “http status code=%s” % (conn.getcode()))
data=json.loads(response)
(This works but the real time feature is very slow)