Updated June 17, 2019: This is now broken for Nest/DropCam devices. It will still work for anything that has a web accessible image URL. Clint points out in the comments below that you can fix up the URL for Nest cams but it looks like you need to be logged into nest.com so it doesn't work from Apps Script. Google is also retiring Works with Nest because they're "...reimagining how technology and services can deliver simple and helpful experiences in your home..." which apparently translates to only working with Google Assistant. I'll update this post if I figure out a work around.
Here's an easy way to capture frames from a DropCam to Google Drive. This only works if you have a public feed for your DropCam.
Go to the public page for your DropCam (Settings -> Public -> Short URL Link) and then view source for that page. Near the top you can find the still image URL for your DropCam:
<meta property="og:image" content="https://nexusapi.dropcam.com/get_image?uuid=12345&height=200" />
In Google Drive create a new Apps Script (If you don't already have Apps Script you can find it via Connect more apps...). Paste in the following code:
Replace the uuid parameter in the URL with the uuid from the still image URL for your DropCam. Note that the height parameter in the script has been changed to 1280 to get the largest possible image. A timestamp is being used to add a random cache busting parameter to the still image URL and is also used as the filename for the image.
The script will save the images to a folder called DCFrames - either create this folder in your drive or change this parameter to the desired folder.
Run the script and check that it's working. If everything looks good go to Resources -> Current project's triggers in the Apps Script editor. You can now set up a timer to save a frame as frequently as every minute (which I'm using to collect frames to make a daily time lapse movie). You can also ask Apps Script to send you an email when the script fails.
Updated 2015-07-01: DropCam is now Nest Cam - assuming that Nest keep the API going everything should keep working as above for both types of camera.
Worked like a charm. Thanks!
Works! Just tried my old drop cam. At least I can get some free usage out of it!
Unfortunately I have a relatively new Nest Cam and can't find the UUID or URL for the still image. I don't think Nest Cam now allows an image to be grabbed via a script such as this. Am I correct? Great weather spot but old Ambient Cam has failed but have Nest Cam. Help appreciated.
Just tried with a new nest cam that I hadn't shared before and it worked for me. Go to camera sharing in settings, share publicly, go to the 'share this link' URL, view source and find the og:image meta property. The cam I tested is a Nest Outdoor cam and it doesn't allow a height of 1280 but 1000 works fine. If you have the cam shared send me the URL by email ([email protected]) and I can take a look.
Works great with latest Nest outdoor cam for me. Perfect for timelapse. But is there a way to save to a "static" file to use on something like weather underground? I messed around by saving it to a file name, instead of "timestamp" but google drive just keeps saving multiple files with the same name instead of overwriting the old file.
Hi Gary - could you use the original URL for this? I.e. point Weather Underground at the public URL for the cam? Probably don't need to save to Google Drive if you just want the latest image.
We've been using this for awhile - but today it seems to be broke.
We are getting pages that say "forbidden."
Anyone else having issues?
Suddenly stopped working for me as well. Any fixes or work arounds possible?
I can't take credit for this one - but the fix seems to be............
1) replace dropcam.com with camera.home.nest.com
2) then at the end of the request add &public=
last section of the "live feed" url
So for a
UUID of 12345
and last portion live video url of ABCDE
*my use does not need the callback information - but I would imagine you could leave that in
I'm so glad that there is a fix! Thanks for sharing.
I'm now able to the the image using the URL in a browser, but still get a FORBIDDEN error message through the google script.
At least we're making progress!
Has anyone been able to make it work beyond viewing the still in a browser?
My Google script is still giving me the FORBIDDEN error.
Mine is dead too. I have a timelapse script that's been running for a couple of years, and I can see by the timestamps that it stopped working at 11am on April 9, 2019, California time. Now the image returns some HTML that says "forbidden".
Interestingly it died last year for a couple of months too, so who knows, maybe it's intermittent.
If anyone figured out a fix, please post!
This works for me for saving timed snapshots into a Google Drive folder. What script are you all using to make a time lapse?
Does this still work? I just added a Nest cam and the still image URL always leads to a page that says "forbidden".
Same for me (I get a page saying forbidden). Cleve, I responded to you awhile ago but I don't think it posted. I wrote a python script to capture it. What url are you using for the image?
Incidentally here's a timelapse movie I made using the principles in this script:
@Wrybread Great video. This is what I'm looking to do. Would you mind sharing your script? My google/gmail account is clevelandernest ....I'm not familiar with python, so I would not know where to start in writing one myself. I'm assuming the python script runs on Google Drive and creates the video there? I don't have a dropcam, I'm using a Hikvision IP security cam, so unfortunately my URL format would not work for accessing a dropcam.
All, It looks like this won't work with apps script any more. See the update at the top of the post. The new image URL requires you to be logged in at nest.com, and Google is shutting down the Nest API next month so it doesn't look like that will be a path forward either. Will update if I come up with a way around this but doesn't look good right now.
Robert, I can't load my image URL even when I'm logged in to my Nest account. Can you post a sample URL you're using?
I'm using this:
https: SLASH SLASH nexusapi-us1.dropcam DOT com/get_image?uuid=MYUUID&width=1000
(Obviously replacing MYUUID with my camera's UUID). Getting rid of the width parameter doesn't fix it. When I log into my Nest account with Chrome and then load that URL in Chrome I still get "forbidden".
I'm hoping there's some other address though, since I can make a Python script that first logs in and then downloads the image.
And @Cleve, most cameras have URLs for getting still images, and most are easier to get than with Nest cameras, assuming you're on the same network. Here's a page showing the format for your camera:
ipcamtalk DOT com/threads/get-still-image-through-url-from-hikvision-nvr-solved.6279/
I'll try to post my scripts to github this week. FYI I have a cron job running on a web server every minute grabbing and saving an image. If you don't have access to a webserver that lets you run Python scripts and schedule tasks using cron you could also have it run on any computer, but the nice thing about a webserver is it's out of sight out of mind, just does it's thing remotely for years.
My second script builds the timelapse video from a directory of still images. You could also use commercial applications for that, and possibly freeware ones, there's a ton of them out there. But I'll post that one too.
I posted my script to download images from cameras here:
github DOT com/wrybread/Python-Security-Camera-Image-Downloader-For-Timelapses
Oops, I changed the name of the github repo to:
github DOT com/wrybread/Python-Security-Camera-Timelapser
@Wrybread Thanks for the scripts! I will give this a shot on my home computer and see how it works...Unfortunately, I don't have access to a web server. I already have mine sending a snapshot every minute to a directory in Google Drive. I set a Google API script to make a new folder/directory in Drive each day with that day's date as the name. Then a second script to grab the snapshot every minute and save to the folder named after the current date. So I basically end up with a folder/directory on Drive named "June-14-2019" that contains over a thousand images (one from each minute that day), another folder/directory "June-15-2019" with an image of every minute from that day, etc...I was hoping I could somehow make another Google API Script that would take each day's folder of images and make a daily time lapse (using Google Drive's resources, instead of having a script on the computer locally download over a Gig of images, encode to mp4 and re-upload the finished video to the web)..This does not seem possible though, since there's apparently no way of installing an encoder like FFMPEG on Google Drive....I can sync the images to Google Photos and use the animation function to to create a timelapse. It works, but that platform is limited to only 50 photos per animation; Not even enough to cover one hour considering I take one image per minute...And no way of combining multiple animations into one without downloading locally. Weather Underground does what I'm looking for, but their time lapse is resized so small that it's blurry.
For Nest Cam users, I assume there's no way to email a snapshot on a time interval? If it can email snapshots to your gmail account as attachments, those images will show up on Google Drive. Alternatively, if you can FTP images from the cam to the internet, that would open up other work arounds for grabbing the latest image on a time interval. Lastly, I wonder if there's a way to pass along the log in credentials with the URL. For example, on some of my security cams that are password protected, I can add "username:password" in an area inside the URL which causes external media players to play the live video screen without prompting me to enter login credentials. If Nest Cam supports that, it may allow the script to essentially "log in" to your account as it's requesting the image instead of hitting a "forbidden" error.
If you manage to get a url that gives you an image, an easy way is to use www.teleport.io to grab those images and create time-lapse and historical record automatically.
I got it working, Nest Cam and www.teleport.io, am now able to capture time-lapse with it quite reliably.
1. Go to your public Nest Cam page video.nest.com/live/FSh..
2. View source on it and extract the RTMP url from the page html source i.e. rtmps://stream-uc2-bravo.dropcam.com/nexus/fad5..
3. Create a Teleport feed and enter this url in the feed dashboard under Capture image -> 'Manual url'
Timelapse is now automatically created. You can also view all historical images, as well as embed the player on your own website.