How to download raw, time-stamped overnight SpO2 and HR data?

I am attempting to get my raw, time-stamped overnight SpO2 and HR data for analysis in the statistical software I use for work. Unfortunately, I've been able to find nothing but summary statistics, e.g. average SpO2, lowest SpO2, average HR. The places I've looked for the raw data include 24-hour FIT files and the archive of JSON files that I got from the download-all-your-data link for my account. It's the SpO2 data that I'm most interested in, specifically the data that Garmin Connect has to have to make this graph, seen on my account in Health Stats/Sleep.

I know I'm not the first person to go looking for this data, but the other threads I've found have so far not provided a solution. If there's one out there that does, please just point me to it!

  • Not exactly what you're looking for, but:

    Export daily HR data: https://forums.garmin.com/apps-software/mobile-apps-web/f/garmin-connect-web/426084/daily-heart-rate-csv-report/1990446 

    Export SpO2 data (hourly averages): https://forums.garmin.com/apps-software/mobile-apps-web/f/garmin-connect-web/421117/where-can-i-find-my-spo2-data/1970545 

    I see that the graph on the sleep page you posted has SpO2 data in 5 minute increments. I can make a script to export that - I'll update this post when it's ready.

    If you don't want to wait for the script, you can do it yourself:

    - Using a computer, open connect.garmin.com and login

    - From the same tab, open your browser's dev tools 

    CTRL-SHIFT-I (Windows)

    CMD-OPTION-I (Mac)

    - In the same tab, navigate to the sleep page and the date you want to export

    - Switch back to the dev tools and open the network tab

    - In the filter text field, type "dailysleepdata". This should match exactly one network request

    - Click on the matched network request and select the Response tab

    The response tab will contain a JSON object that has all the data that can be displayed on the sleep chart, including SpO2 in 5 minute increments. Copy this JSON object and do whatever you want with the data.

  • You can also explore the same data by using the Preview tab.

  •  The threads you linked describe multiple approaches to getting the data I'm looking for (SpO2 at the most granular level possible). I'm working through those so I can't report yet on whether there's something in there that will work, however the two approaches I most commonly see described are both running into dead ends. Those are the archive of JSON files that can be downloaded via the "all your data" link in Connect's account preferences, and the export link for FIT files in Connect/Health Stats/Sleep. The JSON files I was able to download contain only summary statistics, e.g. nightly average and low. The FIT files are similarly limited. I won't have much time to work on this today, but later this week and this weekend I'll be doing more.

  • I'll try this when I get a chance. 5 minute increments would be a large improvement on nightly summary stats, but I'd still prefer the raw time-stamped measurements if possible so that I can do my own analysis in R.

  • I know exactly what I linked to — a specific comment in each of two threads which contains a script that I wrote to export data:

    - daily hr (in 2 minute intervals) (same as what’s shown on the Connect heart rate page, not the sleep page) 

    - spo2 data (in hourly intervals) (same as what’s shown on the Connect pulse ox page, not the sleep page)

    The 3rd method I posted in this thread exports sleep data (with spo2 in 5 min intervals) (same as that’s shown on the sleep page in Connect, which is literally what you asked for although you may not have realized that the sleep page doesn’t use the raw data that you described

    In each case, the mechanism for exporting data is simply to access the same API that the corresponding Connect page uses, which is easily discovered by using the network tab of the browser dev tools as described above.  

    If you want some sort of higher resolution raw data that’s captured by the device, it may not even be available via the same apis that Connect uses, bc Connect may not even store that data. For example, even though the watch may sample hr data more frequently than every 2 minutes, I don’t know of any way to get that data via Connect or Connect APIs. I don’t know about the data archive that Garmin provides — if it contains FIT files, then those FIT files *may* contain raw data, but I’m not sure.

    Your best bet may be to look at raw FIT files on the device and either reverse engineer their contents or see if fitfileviewer.com will decode their contents for you. 

  • Thanks, this is really helpful! I hadn't realized that you linked specific comments; I just scanned the whole threads where those comments were and recognized some approaches that I'd tried and some that I hadn't. Also, you're correct that I didn't realize the graph showed 5 minute intervals. Thanks for pointing that out. Your suggestion to check out FIT files on the device also seems promising. It makes sense that there may be higher resolution data there than in Connect.