Google Photos API

Photography / OAuth Advanced HTTPS
Varies by plan (check documentation)

Overview

Google Photos API lets you access, upload, and organize photos and albums stored in a user Google Photos account. It uses OAuth 2.0 for secure authorization, meaning users grant your app permission to their photos. This makes it great for apps that want to back up, display, or manage photo collections.

💡

Beginner Tip

Start by creating OAuth 2.0 credentials in the Google Cloud Console and requesting only the scopes you need (e.g., photoslibrary.readonly for read-only access). Google Photos API has strict quota limits, so avoid fetching all media items in a loop without pagination.

Available Data

image URLs in multiple sizes
photographer credit
image dimensions
download link
color data

Example Response

JSON Response
{
  "id": "Dwu85P9SOIk",
  "urls": {
    "full": "https://images.unsplash.com/photo-...",
    "regular": "https://images.unsplash.com/photo-...?w=1080",
    "thumb": "https://images.unsplash.com/photo-...?w=200"
  },
  "width": 4000,
  "height": 3000,
  "user": {
    "name": "John Doe",
    "username": "johndoe"
  }
}

Field Reference

albums[].id Unique identifier for the album, used to fetch its media items.
albums[].title The display name of the album as set by the user in Google Photos.
albums[].mediaItemsCount The number of media items (photos/videos) contained in the album.
albums[].coverPhotoBaseUrl Base URL for the album cover photo; append width/height parameters to resize (e.g., =w200-h200).
nextPageToken Token to fetch the next page of results; include in the pageToken query parameter of your next request.

Implementation Example

const url = "https://developers.google.com/photos";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized The OAuth access token is missing, expired, or has insufficient scopes.
Refresh the access token using the refresh token, and ensure you requested the correct scope such as https://www.googleapis.com/auth/photoslibrary.readonly.
429 Resource Exhausted You have exceeded the API quota (requests per day or per minute).
Implement exponential backoff, cache responses where possible, and check your quota usage in the Google Cloud Console.
INVALID_ARGUMENT on mediaItems.search The request body is malformed or uses unsupported filter combinations.
Check the official docs for supported filter types; some combinations like date filter plus album filter are not allowed together.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 3/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS UNKNOWN
Category Photography
Difficulty Advanced
Verified: 2026-04-04

Similar APIs

View All →