Using CURL to Collect Oura Ring Sleep, Activity and Readiness Data

You have probably experienced frustration when trying to gather insights from your sleep, exercise, weight and diet tracking devices. Should I got to bed earlier? Eat more protein? Exercise at a lower intensity? The trouble is that each device tends to have have a customized app or website which makes comparing the data complicated. In this post I’ll showing how the Oura Ring like many trackers offers a REST interface which makes pulling down data from many tracking sites and combining it into one place a possibility. It also allows one to free their data and keep a personal backup.

While this demonstration is based on the Oura Ring aside from the initial setup the process will be quite similar for most fitness trackers.

Step 1: Setup an Application

  • this does require an Oura Ring account
  • website: https://cloud.ouraring.com/docs/
  • click on ‘My Applications
  • Display name: Adafruit REST Demo
  • Website: localhost
  • Click: ‘Save

Step 2: Get a Token

  • click the top URL [server-size flow authorization]
  • accepts the privacy policy
  • click ‘Submit POST request
  • the next page will be one line of text save the value for “access token”
  • mine looked like this: “WGZGSPT6PEDN5RQALOSRY5RKJNCIJ3UB”
  • don’t worry I deleted this before this post went out.

Step 3: Last Nights Sleep Data Using CURL

  • $ curl –header “Authorization: Bearer WGZGSPT6PEDN5RQALOSRY5RKJNCIJ3UB” https://api.ouraring.com/v1/sleep?start=2017-10-01

    {“sleep”: [{“deep”: 6480, “bedtime_start”: “2017-10-01T22:17:01-06:00”, “rmssd”: 57, “light”: 10380, “hypnogram_5min”: “4442111111111121121111222222444244444222222222211111122222243333333222211232333444”, “restless”: 30, “awake”: 4110, “breath_average”: 14, “efficiency”: 83, “hr_5min”: “summary_date”: “2017-10-01”, “score_alignment”: 100, “duration”: 24600, “timezone”: -360, “total”: 20490, “score_efficiency”: 79, “temperature_delta”: -0.03, “score_rem”: 54, “onset_latency”: 900, “rem”: 3630, “bedtime_end”: “2017-10-02T05:07:01-06:00”, “is_longest”: 1, “score”: 75, “hr_lowest”: 51, “score_latency”: 99, “score_total”: 58, “score_disturbances”: 77, “hr_average”: 55.375, “midpoint_time”: 12390, “score_deep”: 97, “rmssd_5min”:

Step 4: Yesterdays Exercise Data Using CURL

  • $ curl –header “Authorization: Bearer WGZGSPT6PEDN5RQALOSRY5RKJNCIJ3UB” https://api.ouraring.com/v1/activity?start=2017-10-01

    {“activity”: [{“met_min_inactive”: 5, “met_min_high”: 115, “score_training_volume”: 100, “score_meet_daily_targets”: 100, “inactivity_alerts”: 0, “score_training_frequency”: 100, “met_min_medium”: 652, “class_5min”: “daily_movement”: 21612, “non_wear”: 132, “summary_date”: “2017-10-01”, “inactive”: 409, “cal_total”: 2938, “timezone”: -360, “rest”: 465, “score_stay_active”: 86, “low”: 248, “day_start”: “2017-10-01T04:00:00-06:00”, “met_min_low”: 179, “high”: 15, “medium”: 171, “met_1min”:

Step 5: Yesterdays Readiness Assessment Using CURL

  • $ curl –header “Authorization: Bearer WGZGSPT6PEDN5RQALOSRY5RKJNCIJ3UB” https://api.ouraring.com/v1/readiness?start=2017-10-01

    {“readiness”: [{“score_previous_night”: 63, “score_temperature”: 100, “summary_date”: “2017-10-01”, “period_id”: 0, “score_sleep_balance”: 64, “score_activity_balance”: 11, “score”: 55, “score_previous_day”: 42, “score_recovery_index”: 77, “

Two Thoughts:

  • I’m only showing one days worth of data and I cropped out the raw data as it is a little overwhelming. If we wanted to see months or years at a time simply adding ‘\&end=2017-10-02′ would provide a start and stop range that is easily adjusted on the command line. 
  • Oura and most other fitness trackers have great apps and websites for us to utilize. However, those of us who want to passively track our data and review it in one location we need to write some code. More posts to come on crossing tracking boundaries.


Eink, E-paper, Think Ink – Collin shares six segments pondering the unusual low-power display technology that somehow still seems a bit sci-fi – http://adafruit.com/thinkink

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Join 26,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


Maker Business — To make it through a tough business cycle, layoffs should be a last resort

Wearables — Be outdoor ready

Electronics — When do I use X10?

Python for Microcontrollers — Python on Microcontrollers Newsletter: COVID tracking, OSHWA proposals and much more! #Python #Adafruit #CircuitPython @micropython @ThePSF

Adafruit IoT Monthly — Our Favorite IoT Projects from 2020

Microsoft MakeCode — Space Jam, The MakeCode Show & More!

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — JP’s Product Pick of the Week — 4pm Eastern TODAY! 1/19/21 @adafruit @johnedgarpark #adafruit #newproductpick

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



No Comments

No comments yet.

Sorry, the comment form is closed at this time.