Saturday, May 18, 2024
HomePythonExtracting Information from Nike Run Membership & Visualizing It

Extracting Information from Nike Run Membership & Visualizing It


Hello beautiful individuals! 👋 Most individuals who know me in particular person know that I like working. I attempt to run no less than twice per week. I correctly began working in Might 2017 and have been working roughly constantly since then. I’ve been utilizing the Nike Run Membership app to log all of my run information. After I began utilizing it I had no concept that I used to be getting sucked right into a walled backyard and there was no official strategy to transfer my information out of the Nike ecosystem.

Now we all know that the app masses information from the server so because of this there may be positively a distant API endpoint which we are able to entry to get uncooked information. Whereas I used to be attempting to reverse engineer the NRC app to permit sniffing of SSL site visitors, I got here throughout a GitHub gist which contained NikePlus API description.

The creator of that gist has put up a bash script which you should use to obtain your whole information from the Nike ecosystem and put it aside domestically in json recordsdata.

Now the tough half is that the endpoint requires Authorization Bearer token which we don’t already know. Because it seems the web Nike web site additionally makes use of the identical authentication backend and makes use of the identical Authorization token because the Nike app. So all now we have to do is go to the NikePlus membership web site and open the developer instruments. With the developer instruments open, log in to your similar Nike account which you utilize with the cell app.

Now seek for a request to api.nike.com and scroll right down to the request headers. You need to have the ability to see the Authorization header.

Nike Website

Copy the Bearer token and move that as an enter to the bash script.

The steps to run the bash script are as follows:

  • Obtain and save the script as nike_activities.bash on Desktop
  • Open the terminal and kind:
chmod u+x ~/Desktop/nike_activities.bash
  • Run the script utilizing the terminal (substitute <bearer_token> along with your precise token):
~/Desktop/nike_activities.bash <bearer_token>

Bash Script Nike

The bash script will obtain your information in activity-* recordsdata within the folder from the place you run the script.

I used my information and a few Jupyter Pocket book and plot.ly magic to create this interactive graph. It incorporates my run information from since I started working.

styled-line

I hope you guys preferred the submit. I’ll attempt to write up a small tutorial for the Python Suggestions weblog the place I’ll clarify how I parsed the JSON recordsdata and made this small plot.

Within the meantime, I hope you all have an exquisite day/evening. I’ll see you within the subsequent article! ❤️ 😊

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments