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.


As 2022 starts, let’s take some time to share our goals for CircuitPython in 2022. Just like past years (full summary 2019, 2020, and 2021), we’d like everyone in the CircuitPython community to contribute by posting their thoughts to some public place on the Internet. Here are a few ways to post: a video on YouTub, a post on the CircuitPython forum, a blog post on your site, a series of Tweets, a Gist on GitHub. We want to hear from you. When you post, please add #CircuitPython2022 and email circuitpython2022@adafruit.com to let us know about your post so we can blog it up here.

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 32,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 — Pololu’s account of the chip shortage

Wearables — Monster-inspired costuming!

Electronics — How to make your own magnetic field probe!

Python for Microcontrollers — Python on Microcontrollers Newsletter: New Releases of MicroPython and CircuitPython and more! #Python #CircuitPython @micropython @ThePSF

Adafruit IoT Monthly — 2021 in Recap!

Microsoft MakeCode — MakeCode Thank You!

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 1/18/22 KB2040 Kee Boar @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.