APIs for the Internet of Things: ThingSpeak, Pachube and Fitbit
When Marc Andreessen, one of the great gurus of venture capital investments in startups, wrote ‘Why Software is Eating The World’ in The Wall Street Journal back in August 2011, he probably already had in mind what APIs (application programming interfaces) would represent for developing software and new business models. It can be said that APIs are eating the world and an example is their influence on the Internet of Things (IoT).
These APIs enable developers to connect to the world of objects and interrelate the devices surrounding us: ‘plugging in’ our body to monitors of vital signs, automating our home, almost turning our vehicle into a living being… APIs have become the lifeblood of software and the so-called Internet of Things wouldn’t exist without them. APIs incorporate and work with data that facilitate the connection between objects.
Today most solutions of the Internet of Things revolve around four basic pillars which are mobility, social economy, analysis of large volumes of data and cloud-based computing. According to a Cisco study, the estimated global market around IoT will rise to $14.4 trillion in 2022, a figure that has grown steadily in recent years. Therefore, there is business for developers and APIs are one of the main keys.
We will try to analyze three APIs of the Internet of Things here from a huge list of interfaces that are already operating in this expanding market:
The ThingSpeak API always works with data; that is its specialty. This open API for the Internet of Things allows you to collect, store, analyze, visualize and act on the information collected in sensors and devices such as mobile and web applications, social networks like Twitter, messaging solutions, VoIP and cloud-based solutions such as Twilio, open source hardware such as Arduino, Raspberry Pi and BeagleBone (the kings of the Internet of Things and robotics) or computer calculation languages like MATLAB… ThingSpeak is an API known among developers and already has a large community.
ThingSpeak API always works with channels, which contain data, location and status fields. To start working with this interface a channel needs to be created, where the information on devices and applications will be collected, data that can subsequently be analyzed and visualized in graphics (this is a fairly comprehensive tutorial on how to create graphics with ThingSpeak) and the final step is to operate on these documents. The process with the API is always the same.
In the end, the project path with the API will look similar to the following, replacing the fields CHANNEL_ID and FIELD_ID with the data from the newly-opened channel.
An example of the type of graphics that be can be created as a result of the collection, analysis and visualization with ThingSpeak are these temperature measurements:
Pachube’s API allows you to store, share and analyze real-time energy or environmental data collected by sensors in buildings and other devices. All the functionality of Pachube’s system is provided by the API, which aids the information generated by buildings, energy meters or mobile devices with sensors being collected and analyzed and all these objects connected to each other. It is the true Internet of Things.
Pachube’s API functions in EEML (Extended Markup Language Environments), a protocol for exchanging data from sensors in remote environments, whether physical or also virtual (a typical example is the connection with Second Life objects). The fact that there is a universal protocol is what enables people to share with the community millions of pieces of real-time data from objects, devices or spaces around the world.
The steps to start working with Pachube are quite simple:
● Add a device: developers give a name, description, and privacy permissions to the device they want to add and an ID is automatically assigned as well as the API key required to connect the terminal.
● Connect the device: the ID and API key need to be copied into the object code to establish a two-way relationship between the two. Not only devices can be connected, but also apps and services. To make that connection, there are all kinds of libraries here for Android devices, programmed in Java objects, C, Objective-C, Python, PHP, Ruby and JavaScript devices, and tutorials for open hardware such as Arduino or Raspberry Pi.
● Test run: once added and connected, developers can begin to see data values updated in real time on their channel and debug irregular changes seen in that information.
Fitbit’s API aids developers with the work of interacting with the data collected by any of the Fitbit products whether it be an application, a device or service. Today, Fitbit’s API supports most languages for reading and writing information, but they offer a community for developers where it is possible to make suggestions and evolve the API.
What Fitbit’s API ultimately allows is for anyone to be able to develop an app to access and manipulate data collected for a Fitbit device, provided it meets two obvious requirements: this must be data related to the actual user and no other person and meet the conditions of use established by the documentation of the actual API.
How can you start to try and work with Fitbit’s API?
● Registering the app: registering the app makes it possible to obtain the customer’s credentials from the API. To do this you must first have an account in the Fitbit service (it is completely free of charge to open).
● Developers must choose a OAuth 2.0 library that operates with the programming language and development framework used for the data stream. Without this library, the authorization protocol cannot be created.
API requests require the credentials of an authorized user.
If you are interested in the world of APIs, find out more about BBVA’s APIs here.
Banco Bilbao Vizcaya Argentaria, S.A. owner of this portal uses cookies and/or similar technologies of its own and third parties for the purposes of personalization, analytics, behavioral advertising or advertising related to your preferences based on a profile prepared from your browsing habits (e.g. pages visited). If you wish to obtain more detailed information, consult our Cookies Policy.
Cookie settings panel
These are the advanced settings for first-party and third-party cookies. Here you can change the parameters that will affect your browsing experience on this website.
Technical Cookies (required)
These cookies are used to give you secure access to areas with personal information and to identify you when you log in.
Name
Owner
Duration
Description
gobp.lang
BBVA
1 month
Language preference
aceptarCookies
BBVA
1 year
Configuration Accepted Cookies
_abck
BBVA
1 year
Helps protect against malicious website attacks
bm_sz
BBVA
4 hours
Helps protect against malicious website attacks
ADRUM_BTs
Salesforce Marketing Cloud
Session
Required for monitoring of the service, inherent to SFMC
ADRUM_BT1
Salesforce Marketing Cloud
Session
Required for monitoring of the service, inherent to SFMC
ADRUM_BTa
Salesforce Marketing Cloud
Session
Required for monitoring of the service, inherent to SFMC
ADRUM_BT
Salesforce Marketing Cloud
Session
Required for monitoring of the service, inherent to SFMC
xt_0d95e
Salesforce Marketing Cloud
Session
Remember user preferences (if any)
__s9744cdb192d044faa1bf201d29fafd1e
Salesforce Marketing Cloud
Session
Remember user preferences (if any)
wpml_browser_redirect_test
WPML
Session
Text translation in the portal
wp-wpml_current_language
WPML
24 hours
Text translation in the portal
Analytics Cookies
They are used to track the activity or number of visits anonymously. Thanks to them we can constantly improve your browsing experience
Your browsing experience is constantly improving.
With your selection, we cannot offer you a continuously improved browsing experience.
Name
Owner
Duration
Description
AMCV_***
Adobe Analytics
Session
Unique Visitor IDs used in Cloud Marketing solutions
AMCVS_***
Adobe Analytics
2 years
Unique Visitor IDs used in Cloud Marketing solutions
demdex (safari)
Adobe Analytics
180 days
Create and store unique and persistent identifiers
sessionID
Adobe Analytics
Session
Launch's internal cookie used to identify the user
gpv_URL
Adobe Analytics
Session
Adobe Analytics plugin: getPreviousValue Capture the value of a certain variable in the following page view, in this case the prop1
gpv_level1
Adobe Analytics
Session
Cookie used to store the DataLayer levl1 of the previous page.
gpv_pageIntent
Adobe Analytics
Session
Cookie used to store the pageIntent of the previous page.
gpv_pageName
Adobe Analytics
Session
Cookie used to store the pagename of the previous page.
aocs
Adobe Analytics
Session
Cookie that stores the first values collected at the beginning of a process.
TTC
Adobe Analytics
Session
Cookie used to store the time between the App Page Visit event and the App Completed event.
TTCL
Adobe Analytics
Session
Cookie used to store the time between the LogIn event and App Completed.
s_cc
Adobe Analytics
Session
Determine if cookies are active
s_hc
Adobe Analytics
Session
Cookie used by Adobe for analytical purposes
s_ht
Adobe Analytics
Session
Cookie used by Adobe for analytical purposes
s_nr
Adobe Analytics
2 years
Determine the number of user visits
s_ppv
Adobe Analytics
Permanent
Adobe Analytics plugin: getPercentPageViewed Determine what percentage of the page a user views
s_sq
Adobe Analytics
Session
ClickMap/ActivityMap features
s_tp
Adobe Analytics
Session
Cookie used by Adobe for analytical purposes
s_visit
Adobe Analytics
2 years
Cookie used by Adobe to know when a session has been started.
Advertising Cookies
They allow the advertising shown to you to be customized and relevant to you. Thanks to these cookies, you will not see ads that you are not interested in.
The advertising is customized to you and your preferences.
Your choice means you will not see customized ads, only generic ones.
Name
Owner
Duration
Description
OT2
VersaTag
90 days
VersaTag Cookie used to store a user id and the number of user visits.
u2
VersaTag
90 days
VersaTag Cookie where the user ID is stored
TargetingInfo 2
MediaMind
1 year
Cookie that serves to assign a unique random number that generates MediaMind.
Customization Cookies
These cookies are related to general features such as the browser you use.
Your experience and content have been customized.
With your selection, we cannot offer you a continuously improved browsing experience.
Name
Owner
Duration
Description
mbox
Adobe Target
9 days
Cookie used by Adobe Target to test user experience customization.
Looks like you’re browsing from MexicoSpainArgentinaPeruColombiaBelgiumChileUSAFranceHong KongItalyPortugalUnited KingdomTurkeyUruguayVenezuelaAlemania, so let’s show you the custom content for your
location. Change
Select a country
In order to access the private area and corresponding sandbox, select the country of the APIs you want to use.