Fitbit is one of the most developer-friendly wearable companies. If you’re a budding Fitbit app developer or a hobbyist hacker who wants to get the most out of your device, the Fitbit API is easy to play around with. Their documentation is extensive, and they offer recommended libraries for .NET, Python, Unity, Node.js, and more.
Itching to tackle a project that will help you use your Fitbit better? Here are a few neat functions that will help you get your creative juices flowing.
1) Get Minute-By-Minute (And Even Second-By-Second) Data
Typically, Fitbit limits who has access to intraday time series API endpoints. If you want to use data about your heart rate on a second-to-second basis or steps counted on a minute-by-minute basis, you’d have to submit a use-case review. This can be a problem — for people who truly want to quantify the self, intraday data just isn’t going to cut it.
However, just last year, Fitbit made it easier to get more granular data from a personal device. But there’s a catch — you can only get the data for applications for your personal use. They introduced a new OAuth 2.0 application type called “Personal.” You can select it when registering or editing the setting of an application.
Selecting this will revoke access to all tokens, which cannot be undone. But it will allow you instant access to your registered beats per minute (BPM) at any particular second, among other data. That can be super valuable if you want to analyze what gets your heart racing during the day.
2) Switch Off Your Electronics
What is more effective in actually getting you to work out: the carrot or the stick? If you’re more of a “stick” type, then you might consider using the API to automatically punish yourself if you don’t meet certain workout goals. And what better way to punish yourself than by turning off the very things that are probably preventing you from working out in the first place: your home electronics?
Charalampos, a blogger for Building Internet of Things, used the Fitbit API and the Belkin Wemo Switch to threaten spoiling the food in his refrigerator. He wrote a script that checks how many steps he tracks every evening. If it falls below a particular threshold, the script sends a warning email. If it’s still below the threshold after one hour, it switches off his fridge using the Wemo Switch.
Charalampos says that he used his fridge because he doesn’t watch TV. But if you find yourself failing to get in your daily steps because you’re glued to your couch, then tying your step count to a functioning entertainment system might help you take a few more laps around your block.
3) Create An Office Step Competition Dashboard
Step competitions are popular in offices that want to encourage their workers to be more active. But they have a serious drawback: they usually rely on workers to plug in their own information. And since many people have other things they’d rather be doing, that can lead to missing or inaccurate data.
Fortunately, it’s pretty straightforward to use the Fitbit API to create a special company app that counts steps. Developers over at IBM Developerworks created simple instructions to build a contest app using the Fitbit API, Bluemix, Twilio, PHP, JSON, and MySQL. Steps are automatically pulled from participants’ Fitbits and displayed on the dashboard. The final product even includes leaderboards and graphical analytics, so anyone can see who’s walking the most.
4) Hack The Fitbit API Without Coding
Of course, you don’t need to be a coding wizard in order to hack your fitbit. The automation enabler IfThisThenThat allows you to connect your Fitbit to your other apps and devices. IFTTT already has dozens of Fitbit recipes, many of which were authored by Fitbit themselves.
Here are a few examples.
Do you prefer having your data in neat columns and rows rather than the Fitbit App? This recipe will plug in your daily information, so you can more easily analyze your progress over time.
If you’re more motivated by Twitter likes than the threat of your LCD television turning off, you can automatically Tweet every time you hit your step goal.
Turn The Lights On When You Wake Up
Want one less thing to do in your early morning grogginess? Connect your Fitbit to your Philips Hue lightbulb. When your Fitbit detects that you are no longer sleeping, it can flick on the light for you.