As we are profiling APIs across different industries we are always on the look out for other interesting streaming APIs. Sure, we’d like for everyone to be using Streamdata.io, but we are in the business of understanding the world of APIs, and helping shine a light on interesting use cases–even if they aren’t always ours. One streaming API we stumbled across recently is the Nest API, out of the home automation provider Nest, who doesn’t just have a streaming API, they have one powered by Server-Sent Events (SSE)–just like Streamdata.io delivers!
The Nest streaming API is meant to support clients connecting directly to Nest services, as well as supporting cloud-to-cloud integrations, allowing for API consumers to listen for changes, instead of polling the REST API for anything new. To use the API you use the same endpoint as the regular API (developer-api.nest.com), or other more precise path, but instead of sending an application/json content type you send a text/event-stream. Once connected, you will receive updates for the Nest device as each event occurs, delivered as long running HTTP connection, aka SSE.
Next we will work to profile the Nest API using OpenAPI, then we’ll see if we can push the API specification to also cover the streaming edition of the API. After that, we will play around to see if we can profile and extend the AsyncAPI specification, providing a more event-driven approach to defining what is possible with the Nest API. Crafting a machine readable definition that describes the surface area of the API, but also the topical subscription opportunities for streaming events from the devices in our homes that we are connecting to the Internet.