Wednesday, August 7, 2024

Extracting running data out of NRC/Nike + (Nike Run Club) using API's

For the past few weeks, I have been struggling to see the running kilometers getting updated in my  Nike + App. It could be a bug or a weird feature of the app and since this was kind of a demotivation, I decided to go ahead and create my own dashboard to calculate the results. Also, for some reason, Nike discontinued viewing and editing activities on the web.

Considering I had about 8 years of data and you never know when this kind of apps stop to exist or when they become paid versions. It's always better to persist your data to a known source and if required use it to feed it into any other application. 

It turns out that there is a lot of additional information the NRC app captures which are typically not shown on the mobile app. Few of the information include 

  1. Total Steps during the workout including detail split between intervals
  2. Weather Details during the workout 
  3. Amount of the time the workout was halted for 
  4. Location details including latitude and longitude information that can help you plot your own Map

I ended up creating a  .NET MVC app for fetching the activities and displaying it locally.

The code can be downloaded here ->  https://github.com/shailendrabhatt/Nike-run-stats 

Below are some screen shots of the App

The code also includes a postman repository which contains a Collection that can also be used to fetch one's activities. Just update the {{access_token}} and run the Get requests.

Note :- Nike no longer supports or does not provide a public or officially supported API for individuals or third party developers to directly access to export workout data. 

Here are few latest ways (As of June 2025) to access the data.

  • Fetching the Authorization token can be tricky and it has an expiry time. For that, you will need a https://www.nike.com/se/en/nrc-app account and fetch the authorization token from the XML HTTP request headers for the URL type api.nike.com. There are few requests hitting this URL and the token can be fetched from any of them.
  • The bearer token can be seen in the URL --> https://api.nike.com/buy/lists/v1/39a71942-a408-4642-84e8-aadd4caffe89/items?filter=country(se) 

  • The API described in the link shows details of  before_time information 
https://api.nike.com/plus/v3/activities/before_id/v3/*?limit=30&types=run%2Cjogging&include_deleted=false 
https://api.nike.com/plus/v3/activities/before_id/v3/before_id?limit=30&types=run%2Cjogging&include_deleted=false
  • Pagination can be easily achieved using the before_id. These ids are of different formats ranging from GUIDs to a single-digit number and can be confusing.

No comments:

Post a Comment

Building Microservices by decreasing Entropy and increasing Negentropy - Series Part 5

Microservice’s journey is all about gradually overhaul, every time you make a change you need to keep the system in a better state or the ...