Skip to content

Wrapper to access the Oura Cloud API, no dependencies.

Notifications You must be signed in to change notification settings

Pinta365/oura-cloud-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Warning

Development of this repository has been stopped. Check out this deno repository for future changes and updates

Also still available for Node.JS at NPM.

Warning


OURA-CLOUD-API (updated for v2 of the API)

This lib was created for my own personal use, putting it up in case anyone else is in need of the same :) Since it's for personal use it only support authentication with access-token, might add OAuth in the future.

Login to the Oura Cloud with your Oura credentials and create an Personal Access Token.
Details around what information the API can return is found here: Oura Cloud API v2

Installation

npm install oura-cloud-api

Example

Replace the accessToken below with your own personal access token found at Personal Access Token

const Client = require("oura-cloud-api");

(async () => {
    
    const accessToken = "RDEOSTZPD4...";
    
    try {
        const client = new Client(accessToken);
        
        const userInfo  = await client.GetPersonalInfo();
        console.log(`The call returned: ${JSON.stringify(userInfo)}`);
        
        const sleep  = await client.getDailyReadiness({ start_date: "2022-08-15", end_date: "2022-08-16" });
        console.log(`The call returned: ${JSON.stringify(sleep)}`);
       
    } catch (error) {

        console.log(`Oh-no, error occured: ${error}`);

    }

})();

Available methods

returns users personal information (e.g. age, email, weight, and height)

GetPersonalInfo()

For the following methods you optionally supply start_date and end_date as an object parameter to specify a time frame ex { start_date: "2022-08-15", end_date: "2022-08-16" }. Previous day will be used if parameter is omitted.

getDailyActivity()

getDailyReadiness()

getDailySleep()

getSession()

getSleep()

getTag()

getWorkout()

For the following methods you optionally supply start_datetime and end_datetime as an object parameter to specify a time frame ex { start_datetime: "2022-08-15T00:00:00", end_datetime: "2022-08-17T00:00:00" }. Previous day will be used if parameter is omitted.

GetHeartrate()

About

Wrapper to access the Oura Cloud API, no dependencies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published