Created
October 13, 2020 09:41
-
-
Save thesved/722d23ccdefa0527c4066b2f86ed238f to your computer and use it in GitHub Desktop.
Oura API JavaScript integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. create access token https://cloud.ouraring.com/docs/authentication#create-a-personal-access-token | |
// 2. use API 👍 | |
var OURA_TOKEN = '...'; | |
var date = 'date in `YYYY-MM-DD` format'; | |
var res = await fetch("https://api.ouraring.com/v1/sleep?start="+date+"&end="+date+"&access_token="+OURA_TOKEN); | |
var data = (await res.json()).sleep; | |
data = data.length ? data[0] : {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment