# Google Photos on boxd

> Google Photos is a cloud-based photo storage and organization service offering automatic backups, AI-assisted search, and shared albums for personal and collaborative media management.

- Page: https://boxd.sh/integrations/googlephotos/
- CLI: `run googlephotos` (14 commands)
- SDK: `import { googlephotos } from "@boxd/run"`; every parameter and response type is at `@boxd/run/googlephotos`
- Triggers: none
- Connect: `run auth googlephotos` (Sign in with Google Photos), or https://app.boxd.sh/integrations/detail/googlephotos
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth googlephotos      # once: prints a link to connect your account
run googlephotos           # list its commands
run googlephotos list-albums
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, googlephotos } from "@boxd/run";

every("1 hour", async () => {
  const result = await googlephotos.listAlbums({});
  console.log(result);
});
```

Run it with `run googlephotos.run.ts`. Google Photos has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run googlephotos <command> --help` lists the optional ones. "common" marks what `run googlephotos` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `add-enrichment` | `googlephotos.addEnrichment()` | `--albumId` `--albumPosition` `--newEnrichmentItem` | 0 | Adds an enrichment at a specified position in a defined album |
| `batch-add-media-items` | `googlephotos.batchAddMediaItems()` | `--albumId` `--mediaItemIds` | 0 | Adds one or more media items to an album in Google Photos |
| `batch-create-media-items` | `googlephotos.batchCreateMediaItems()` | — | 5 | Batch upload and create media items in Google Photos |
| `batch-get-media-items` | `googlephotos.batchGetMediaItems()` | `--mediaItemIds` | 0 | Returns the list of media items for the specified media item identifiers |
| `create-album` | `googlephotos.createAlbum()` | `--title` | 0 | Creates a new album in Google Photos |
| `get-album` | `googlephotos.getAlbum()` | `--albumId` | 0 | Returns the album based on the specified albumId |
| `get-media-item-download` | `googlephotos.getMediaItemDownload()` | `--mediaItemId` | 0 | Downloads a media item from Google Photos and returns it as a file |
| `list-albums` | `googlephotos.listAlbums()` | — | 3 | Lists all albums shown to a user in the Albums tab of Google Photos |
| `list-media-items` | `googlephotos.listMediaItems()` | — | 2 | Lists media items created by this application from Google Photos |
| `list-shared-albums` | `googlephotos.listSharedAlbums()` | — | 3 | [DEPRECATED - sunset March 31, 2025] Lists all shared albums available in the Sharing tab of the user's Google Photos app |
| `search-media-items` | `googlephotos.searchMediaItems()` | — | 5 | Searches for media items in a user's Google Photos library |
| `update-album` | `googlephotos.updateAlbum()` | `--albumId` | 2 | Updates an album's title or cover photo in Google Photos |
| `update-media-item` | `googlephotos.updateMediaItem()` | `--description` `--mediaItemId` | 0 | Updates a media item's description in Google Photos |
| `upload-media` | `googlephotos.uploadMedia()` | — | 4 | Upload a media file to Google Photos |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
