Download data from particle dashboard to python using urlopen

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(‘
-d access_token=18d1c5d165477448269f57d7cb5e4906280e9be4’)

response =
print( data)

conn = urlopen(“
response =
#print( “http status code=%s” % (conn.getcode()))

(This works but the real time feature is very slow)

I’m not a Python guy, but I guess there you could also subscribe to the SSE stream.

If you’re using Chrome try this link to see the eventstream


And for a particular device add the device ID as you did in your function call above.

Hi, tried that and it just keeps loading. doesnt give me any data

That’s some quirk I sometimes see with Chrome too, but when I click in the browser window and the address bare (sometimes back and forth a few times, it starts updating).

thank, i will try that later today

Just tried it again and obviously Chrome has changed this a bit and now the link would work without the keyword view-source:<yourAccessToken>