did you grab the correct baby_id from the results?
I got babies[0].id
. for GET /babies/1234/events
EDIT: seems like it should be babies[0].uid
EDIT2: Be careful the events endpoint isnāt paginated by default, put a ?limit=100
on it to make sure it doesnāt take forever to return.
Here is the info from the apk:
https://mega.nz/folder/CPgFHDDR#XaQECBeO1DhFkqEHZ3KJTw
I have very little experience in using this info, but assuming the info in the file
smali_classes2 > nanit \ baby > login
may help?
if you check out nanit/res/values/strings.xml
thereās a bunch of paths listed, unfortunately in my exploration I havenāt been able to figure out how to put them together to find other endpoints. Iām looking for the stuff that populates the insights tab. But that may just be client-side aggregation of data from /events
are you able to load any of the event video urls?
Sorry if I missed this but does anybody have a link to the Nanit API docs or anything? I canāt find any info about the API.
Iām going to try creating an integration.
No formal documentation but a bit of info a few posts up. Bless you for taking a crack at this, just took the plunge with a second monitor. Lol
are you able to play the videos?
Iām not sure how to structure the video with the key (so getting access denied)
At the bottom of the request, the videos are hosted on cloud front and I can play those. I canāt play the ones hosted by AWS.
Iām happy to help out with this project. I reached out to Nanit support and confirmed that they have to public API.
What are you all using to MITM the Nanit requests in an unencrypted format?
Iāve tried using Charles and mitmproxy to figure out APIs to control the camera, but no luck. There seem to be no outgoing requests when I turn on the night light. Is this because camera control is implemented using websockets? If so, what should I look for to sniff out the camera controls?
Thatās all cool Iām in to sniff around
Here is an incomplete postman collection of Nanit API calls. Mostly GETs. All from nanit/res/values/strings.xml
Also found these lines:
<string name="local_live_stream_url">rtmps://%1$s/nanit/local</string>
<string name="local_live_stream_url_no_tls">rtmp://%1$s/nanit/local</string>
<string name="nanit_base_media_url">rtmps://media-secured.nanit.com/</string>
%1$s
probably needs to be replaced with either "public_address"
or "private_address"
from GET /babies
response. But this is as close as cloud get to live streaming. Donāt know much about rtmps protocol.
Tried vlc -v tmps://<address>/nanit/local/?access_token=<token>
Does not play.
I also couldnāt get rtmpdump
working with that url
Hi All,
While I wouldnāt be very useful as a developer, Iām happy to help test out an integration. I have a Nanit and Home Assistant running on a Synology NAS.
My two kids share a room, with the older one 7 years older than the new baby. Assuming there is a way to develop a state definition of in crib, alseep, crib empty (or something like that), I could imagine fantastic uses cases; hallway light in front of the kids room red when the baby is asleep, auto put Alexa on do not disturb or set Sonos volume to 0. Would also be nice to be able to pull the temperature & humidity data (one less sensor to buy), but that seems less critical.
Anyway, excited to help in anyway I can and happy to test any code.
Thanks,
- Adi
Hi everyone! Iām quite new at this! I think Iām missing the first step that allows me to find my access token. Is someone able to share steps in how to first connect to Nanitās API? Sorry if Iām not using the right terminology.
Dave
Hello guys, I did some digging and was able to stream the live feed. I hasnāt figure out how to connect to the camera locally yet, but you can load the cam stream through their servers (as the mobile app does).
The URL is: rtmps://media-secured.nanit.com/nanit/{{baby_uid}}.{{access_token}}
You can get both baby_uid and access_token through the API, I used the attached Postman collection in one of the posts above (thank you!).
I was able to successfully dump the stream to file with both rtmpdump and ffmpeg. However I was not able to open the stream directly in VLC. There seem to be some wonky support for RTMPS.
Currently I am using ffmpeg + nginx to restream the cam locally using HLS (so that it can be opened in Safari and from there AirPlay it to my TV in full resolution).
Hope these pieces of information will help somebody.
Happy hacking
Hi Dave,
have you used the attached Postman collection for that? If so, you need to set your login / password as environment variables inside of Postman and run the first request. In the response body you will see access token.
A.
would you mind sharing more detail on how to get the stream to be usable?
do you need to refresh the token - it so how do you do that?
holy crap - that works, and really well - thanks for the url! hero
I wonder if there is a docker rtmpdump - then can add the output as a generic IP camera hmmmmm
EDIT:
docker run --name=nanit --restart=unless-stopped -v /mnt/user/appdata/nanit:/tmp/workdir amine/alpine-rtmpdump -r rtmps://media-secured.nanit.com/nanit/{BABYID}.{AccessToken} -o nanit.mp4