API Introduction

Get to know the Nest API, how to communicate with the Nest service, access shared data values and manage data access controls and security protocol

API OverviewThe Nest API is a near real-time data API, offering subscription-based access to data shared by Nest devices. With the Nest API, you can build clients that access Nest device data, and get the ability to read or write these shared data values:

Nest Learning Thermostat

  • View current temperature
  • View or set target temperature
  • Set fan timer
  • View or set temperature mode
  • View humidity
  • View online status and last connection information

Nest Protect Smoke + CO Alarm

  • View CO or smoke status
  • View battery health state
  • View last manual test status and timestamp for last manual test
  • View online status and last connection information

Home

  • View a list of devices in the home
  • View energy event status (Rush Hour Rewards)
  • View or set Away state
  • View postal or zip code
  • Set ETA
  • Write your product data to the Nest service with the Resource Use API and share your energy savings in the Nest Energy Report

See the API Reference to explore the data model >

Getting Started with the Nest API

1. Register for the Nest Developer Program

Visit the Nest Developer Portal to create an account and register as a developer.

2. Build with Firebase Client Libraries

Download the official Firebase client libraries (Web, iOS and Android), which allow you to synchronize your data with a subscription-based, near-real time platform. As you develop your client, you’ll find these resources useful: Firebase Data Structure, Reading and Writing data. Be sure to follow the design and branding guidelines.

In cases where the platform you’re developing your integration on has no available Firebase library, you may want to use REST or REST Streaming instead.

3. Test with the Nest Developer Chrome Extension

Use the Nest Developer Chrome Extension to simulate Nest device behaviors and test your product against common system events or sensor conditions.
Learn more about the Nest Developer Chrome Extension >

Nest Developer Tool

How the Nest API Works

The clients you build will use Firebase client libraries to subscribe to data values via the Nest API. When a subscribed data value changes, the new data values are updated in real time, and stored as a standard JSON document. Your client can then update a display or trigger an action, based on the subscribed data.

How the Nest API works

Explore the data model in this interactive API Reference >

API viewer

Example

Let’s say you want to create a client for the Nest Learning Thermostat that monitors two values: current temperature and target temperature. To watch for changes in both of these data attributes, you would subscribe to the thermostat object in a structure, then:

  1. When your customer adjusts the temperature at the Nest Thermostat, the target temperature changes and the Nest service updates the JSON doc, which is synchronized in real time
  2. Your client listens for changes, then:
    • displays the new target temperature
    • updates the current temperature as it changes

You can subscribe to individual data values or to parent data objects in the hierarchy. When you subscribe to a parent object (structures, thermostats or smoke_co_alarms), you can get all the data values in the object.
Learn more about subscriptions and how to access data locations by URL >

Shared device data and permissions

The ability to read or write a data value is controlled by permissions. When a data value is associated with a Read permission, your client can read that data location. If associated with a Write permission, then your client can write to that data location.
Find more information on permissions and shared data values >

Data access control

Works with NestWhen you register a client with the Nest Developer Program, you will select the permissions that are relevant to your product, and provide a description of the possible actions your client might take.

Your customers see these permissions and descriptions when they grant your client access to their Nest device data.
Find more information about selecting permissions >

About security protocol

We use OAuth 2.0 for authorization. OAuth is a means to securely create a trust agreement between a resource owner (a Nest user), a client (a product or service developed by a Nest developer) and a resource server (Nest’s API servers).

Technical Requirements for Developers

You should have knowledge of common programming languages, platforms, authorization and communication protocols, such as:

  • Programming languages: Java, Objective-C, JavaScript
  • Platforms: iOS, Android, web, Mac OS, Windows, Linux, Rails, Django
  • Server-side JavaScript/Java programming
  • OAuth 2.0 (authorization)
  • Firebase (client libraries used by the Nest API)

Guidelines and Compliance

When you register for the Nest Developer Program we’ll ask you to agree to the Developer Program Terms of Service, and to follow the Nest Branding, UX, and Marketing Guidelines.

If you fail to comply with these agreements, we have the right to suspend your developer account, close all active sessions and revoke all access tokens.