The NestStructure package provides APIs for nest device.
If you want, I have a runtime client which uses this API.
The code is licensed under the permissive Apache v2.0 licence. This means you can do what you like with the software, as long as you include the required notices. Read this for a summary.