Mock sample for your project: Google Home API

Integrate with "Google Home API" from google.home in no time with Mockoon's ready to use mock sample

Google Home

google.home

Version: 2.0


Use this API in your project

Speed up your application development by using "Google Home API" ready-to-use mock sample. Mocking this API will help you accelerate your development lifecycles and allow you to stop relying on an external API to get the job done. No more API keys to provision, accesses to configure or unplanned downtime, just work.
Enhance your development infrastructure by mocking third party APIs during integrating testing.

Description

Google Home Local API
This is an unofficial documentation of the local API used by the Home app to communicate with GH devices.
GitHub Repo
GitHub stars GitHub license
Getting Started
Requests must be made over HTTPS, port 8443, so the base URL for these endpoints is: https:// :8443/setup/
Get the IP of Google Home from the Google Home app (Device Settings -> End of the list) or from your router.
GET requests are simple, in the browser kind.
POST requests need to set the header (when there's a body): content-type: application/json
Authentication
Since June 2019, most requests (with exceptions like /setup/eureka_info) need a local authorization token.
There are 3 kinds of tokens involved here:
Local Authorization Token
This token must be sent in all requests in the header cast-local-authorization-token. It is short-lived (~1 day) and may change unexpectedly (with a sync, change in homegraph, etc.)
Get this token
With access to an android device, get this token directly by either method.
Without a device, or to integrate it with a script, use an access token to get the homegraph and extract the token. To get an access token, read the next section. Check the example section for more info.
Access Token
This is a standard google oauth2 access token. It is in the form ya29.*.
This gives access to the Google Home Foyer API. These expire in an hour.
Use this to get the homegraph (and then the local authorization token above).
Get this token
To get this access token, either a Google account username/password or a Google Master Token is needed. More info in the gist.
Use the script from this gist.
Master Token
This is in the form aas_et/* and can be used to request access tokens.
Get this token
The same script in the gist that gets the access token can also get the master token. Needs Google account creds.
Example
Here's the whole flow from just a pair of username/password to using the local API.
Prerequisites:
grpcurl
Proto files (preserve folder structure)
1. Get an access token with the script
Download get_tokens.py
Fill in username and password