Nike plus data API access
Posted by Paul, under runningAs Nike + wristband user and a web developer i thought it would interesting if i was able to access the raw data of my runs.
Nike provide various ‘widgets’ that can be embedded into web pages which is convenient and fun. But i find them a little clunky in flash. You can see an example of one I added to this site here. So i decided to see what I could find on the net to access the run data.
It turns out the everyone’s run data is accessible via a URL linking to a XML document. All that is required is your user ID. Simply go to the following URL and insert your user ID at the end of the string.
http://nikeplus.nike.com/nikeplus/v1/services/widget/get_public_run_list.jsp?userID=<YOUR ID HERE>
All my data can be accessed here for example. Please take note about the XML document
- Distances are in kilometres (despite having all my settings in miles).
- Time locals appear to be correct.
- Time is measured in millseconds
Now your probably wondering how do i find out my user ID. Do this:
- Sign into Nike Plus.
- Click ‘My Runs’.
- Click the ‘Share’ button on the top right of your runs.
- Click ‘Add to a Web page’.
- Click ‘Grab the Code’. Now it copied the code to your clip board.
- Open up a text editor and paste it in (ctrl v). You should have something like this below. The ID is highlighted, just copy it out
<object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000″ codebase=”http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0″ width=”198″ height=”145″ id=”Nike+ Runs” align=”middle”><param name=”allowScriptAccess” value=”sameDomain” /><param name=”wmode” value=”transparent” /><param name=”movie” value=”http://nikeplus.nike.com/nikeplus/v1/swf/scrapablewidget/rundetail.swf” /><param name=”quality” value=”high” /><param name=”bgcolor” value=”#ffffff” /><param name=”FlashVars” value=”type=last5Runs&userDefaultUnit=mi&screenName=paulrichards&dateFormat=DD/MM/YY
&id=1759895612®ion=emea&language=en&locale=en_gb”/><embed src=”http://nikeplus.nike.com/nikeplus/v1/swf/scrapablewidget/rundetail.swf” quality=”high” wmode=”transparent” bgcolor=”#ffffff” width=”198″ height=”145″ name=”Nike+ Runs” align=”middle” allowScriptAccess=”sameDomain” FlashVars=”type=last5Runs&userDefaultUnit=mi&screenName=paulrichards&dateFormat=DD/MM/YY&id=1759895612®ion=emea&language=en&locale=en_gb” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer”></embed></object>
Hi,
I’ve done this for some time using AJAX and parsing the nikeplus XML file inside a webbrowser. The problem with that is, that most browsers do not allow accessing XML files, which are not inside the same domain.
So far, there are afaik only two possibilities, how someone could use nike’s XML data:
[1] Get the file every x minutes by using a cronjob on your server (e.g. with wget).
[2] Parse the file within a server language (php, python, java) and output the pure html to the browser.
Yes your are right, it would be far to much for a web browser to process this on the go. I’m working on a little script (in PHP) that will cache the file every now and again and insert the information in a database for easy use.
Do you know an easier way to get your user id?
Hi Paul, I’m also interested in knowing if there’s an easier way of getting the user id. Any step forward on this?
Hi Paul,
I am looking for some help. My sportband is not uploading to Nike+ Website. It is still recording but I get a USB device error when I try and upload. Is there any way using the above methods to upload my run manually?
Many Thanks
Ross Mackenzie
Hi Ross,
I had this problem and took me a while to work out. In the end i realised the sport band was being picky about what usb ports it used. The ones built in on the front of the computer are extensions connected to the usb port on the motherboard. It appears it doesn’t like this.
I then plugged it into the back and it was all ok.
wicked, I didn’t know you can tap right into the API, finally a way to bypass the flash. I might have a go at integrating this into google charts, Thanks very much for sharing!
I’m working on an easy ID finder for my Nike+PHP project, http://nikeplusphp.org
currently, the above way is the easiest.
[...] login ID btw. It’s a 10 digit number assigned by nikeplus.com. I found mine with the help of this page. Their instructions are actually a little old. But I was able to find that same number from the [...]
i cracked it, although Nike’s service isn’t always available for it. http://nikeplusphp.org/nike-id - just fill in the form and you’re presented with your Nike ID.
Post a Comment