How to count how many photos you have in Google Photos

I'm in the process of copying all my photos from over the years to Google Photos. They currently reside in Apple Photos, which reports exactly how many photos I have. But this seems to be a feature missing from Google Photos. I'm using the Google Photos Backup utility to upload all the photos, and it reports a count. But to be extra confident I'd like to see a count of how many are actually in Google Photos now. This article is about how I was able to get a count of photos from Google Photos.



I built a Google Spreadsheet with some scripting in Google Apps Script to do this. This spreadsheet relies upon the feature of Google Drive that lets you make your Google Photos accessible as a folder in Google Drive. So before using this spreadsheet you need to enable that feature as follows. In Google Drive click Settings in the upper right and then scroll down and check the box alongside "Create a Google Photos folder"
Now click the following link and copy the spreadsheet to your account: Google Photos Count spreadsheet.

When your copy of the spreadsheet opens you'll notice an extra menu item on the toolbar for "Photos". On that menu there will be one entry for "Count". Click this and it will ask you to authorize access to your Google Spreadsheet and your Google Drive. Click to authorize and after a moment or two (longer if you have a lot of photos) it will add a row to the spreadsheet with a timestamp and a count.

Basically the code looks for a folder named "Google Photos" and then counts all the files inside it, and then recurses down into all the folders inside it repeating these steps. Although it's not obvious when you click the Google Photos folder inside Google Drive, the photos appear to be arranged in subfolders based on years. When I first tried to retrieve a list of files inside the Google Photos folder I received an empty list, but that's because everything is in subfolders.

Hopefully you find this useful. You can also schedule the script to run hourly so that it reports a running count while the upload is taking place. This can be done with a trigger added from the Script Editor.

11 comments:

  1. You can also see the total count of your photos here:

    https://www.google.com/settings/dashboard

    ReplyDelete
    Replies
    1. Thanks. That is a lot easier. I couldn't find that when I was uploading. Interestingly the counts don't match. The count on my settings page is 49219, and the count of all the files inside the Google Photos folder is 47701. Maybe if the same photo is in multiple albums it gets counted multiple times on the dashboard?

      Delete
    2. Compare it to your iCloud Photo Library count.

      Delete
    3. I no longer use Apple Photos, so can't compare. But FWIW, my Google dashboard now says 49,320 while my spreadsheet reports 48,157. So I'm not really sure how to reconcile the numbers. The dashboard number has only increased 101 since Mar 17 while my spreadsheet number has gone up 456.

      Delete
  2. Wouldn't it make sense that you would know which is more accurate? How many photos do you think you took between March and May? You can obviously check them by date in google photos. Which is correct?

    ReplyDelete
    Replies
    1. The problem is that while I took 127 new photos between those dates, I was also uploading old photos (with old dates). And I can't tell how many of those there were just by looking at photos.google.com. The dashboard number went up by 101 and the spreadsheet number went up by 456. I can't be sure that all the photos I took on Mar 17 and May 18 had uploaded when I wrote down those numbers in the comments above. So it's not really a good test.

      At 6/30 00:16:29 my spreadsheet showed 48423. I took 9 photos that day (which I can confirm by looking at photos.google.com) and at 7/1 00:17:30 my spreadsheet showed 48432. So it correctly increased by 9.

      Today (7/7) I have taken no photos so far, and my spreadsheet shows 48436 and the dashboard shows 49625. I'll wait a few days after I've taken a few more photos and see if they both increment by the same amount and comment back.

      Delete
  3. This is awesome!! Thank you so much!! :)

    ReplyDelete
  4. I tried this out. Gives me an error 'exceeded maximum execution time' since I have a LOT of photos. Is there a way to adjust the timeout?

    ReplyDelete
    Replies
    1. Unfortunately not. Google Apps Script imposes an execution time limit of 5-6 minutes and it can't be adjusted.

      Delete
    2. Ok FWIW I did find this
      https://www.google.com/settings/dashboard
      The dashboard shows the total number of files

      Delete