Giter VIP home page Giter VIP logo

basis-data-export's Introduction

Basis Data Export

Utility that exports and saves your Basis B1 device's uploaded sensor data. You can learn more about Basis at http://www.mybasis.com/

Instructions

Finding Your Basis User ID

  • Log into your Basis account at http://www.mybasis.com.
  • Right-click and access your web browser's developer tools by selecting "Inspect Element" (on Chrome - you can also access this by going to the "View->Developer->Developer Tools" menu):

basis export step 1

  • You should now see the Developer Tools pane:

basis export step 2

  • Go to the "Data" menu and select "Details":

basis export step 3

  • Click on the "Network" tab in the Developer Tools frame and reload the page:

basis export step 4

Scroll down the list of network requests and look for a request that beings with: "https://app.mybasis.com/api/v1/chart/123a4567b89012345678d9e.json?summary=true..."

The letters after "...chart/" and preceding ".json?..." are your Basis user id! Note this string.

Exporting Your Basis Data to Your Computer

  • Set the $basis_userid variable in the script to your Basis user id from the previous step.
  • Run the script from an executable location. The easiest way is to place it under your webserver document root, but CURL also works.
  • By default, the script will export data from the previous day. You can specify the date you would like to export by appending "?date=YYYY-MM-DD" to the script URL (change YYYY-MM-DD to the actual date you would like to export)

basis export step 5a

basis export step 5b

  • Your data will be saved in JSON format in the "data/" folder in the format "basis-data-YYYY-MM-DD.json"

basis export step 6

  • That's it! (for now).

Data Values

Basis currently returns the following data points. They will represent an average (for heart rate) or sum (steps) over the previous 1-minute period:

  • Time - time reading was taken
  • Heart Rate - beats per minute
  • Steps - number of steps taken
  • Calories - number of calories burned
  • GSR - Galvanic skin response (i.e., sweat/skin conductivity. Learn more about GSR here - http://en.wikipedia.org/wiki/Skin_conductance
  • Skin Temperature - skin temperature (degrees F)
  • Air Temperature - air temperatute (degrees F)

There are some other aggregate metrics included in the reponse such as min/max/average/standard deviation metrics for each set of data.

Tips

  • You can set up a cron to run once per day to automatically grab your previous day's data (assuming you are syncing your device each day)

  • If you want to archive data across a date range you can use curl's [ ] syntax to do it easily (thanks to @Edrabbit for the tip!). For example, to get all of May cached in /data:

    curl http://localhost/basisdataexport.php?date=2013-05-[01-31]

basis-data-export's People

Contributors

btroia avatar

Watchers

JT5D avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.