Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ operations (listing videos, comments, channel info) cost 1 unit, while write ope
updating video metadata or moderating comments cost 50 units each. Bulk updates can consume quota
quickly. When exceeded, the API returns a 403 error; quota resets at midnight Pacific Time.

| Action | Examples | Approx. cost |
|--------|----------|--------------|
| Read | list videos, comments, playlists; analytics queries | 1 unit |
| Write | update a video, moderate a comment, add or reorder playlist items, schedule a broadcast | 50 units |
| Search | `search.list`, used by `playlists add --from-search` | 100 units |
| Upload | `videos.insert` | ~1600 units |

A full per-operation breakdown lives in the
[API quota docs](https://jdwit.github.io/ytstudio-cli/api-quota/).

You can request a quota increase via **IAM & Admin** → **Quotas** in the
[Google Cloud Console](https://console.cloud.google.com/). See the
[official quota documentation](https://developers.google.com/youtube/v3/getting-started#quota) for
Expand Down
38 changes: 22 additions & 16 deletions docs/api-quota.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

The YouTube Data API enforces a daily quota of **10 000 units per project**
by default. Most read operations (`videos.list`, `comments.list`, channel
info) cost 1 unit, while write operations like `videos.update`,
`liveBroadcasts.insert`/`update`, and `comments.setModerationStatus` cost
about 50 units each.
info) cost 1 unit, while write operations like `videos.update`, playlist
edits, `liveBroadcasts.insert`/`update`, and `comments.setModerationStatus`
cost about 50 units each. `search.list` (behind `playlists add --from-search`)
is the notable exception at 100 units per call.

When you exceed the quota, the API returns HTTP 403 with a
`quotaExceeded` reason. ytstudio surfaces a clear error and exits.
Expand All @@ -16,19 +17,24 @@ not eat into the table below.

## Data API cost cheatsheet

| Operation | Approx. quota cost |
|-------------------------------------|--------------------|
| `videos.list` | 1 unit |
| `commentThreads.list` | 1 unit |
| `channels.list` | 1 unit |
| `liveBroadcasts.list` | 1 unit |
| `videos.update` | 50 units |
| `comments.setModerationStatus` | 50 units |
| `liveBroadcasts.insert` | 50 units |
| `liveBroadcasts.update` | 50 units |
| `liveBroadcasts.transition` | 50 units |
| `videos.insert` (upload) | ~1600 units |
| `thumbnails.set` | 50 units |
| Operation | Approx. quota cost |
|----------------------------------------------|--------------------|
| `videos.list` | 1 unit |
| `commentThreads.list` | 1 unit |
| `channels.list` | 1 unit |
| `liveBroadcasts.list` | 1 unit |
| `playlists.list` | 1 unit |
| `playlistItems.list` | 1 unit |
| `search.list` | 100 units |
| `videos.update` | 50 units |
| `comments.setModerationStatus` | 50 units |
| `playlists.insert` / `update` / `delete` | 50 units |
| `playlistItems.insert` / `update` / `delete` | 50 units |
| `liveBroadcasts.insert` | 50 units |
| `liveBroadcasts.update` | 50 units |
| `liveBroadcasts.transition` | 50 units |
| `thumbnails.set` | 50 units |
| `videos.insert` (upload) | ~1600 units |

At ~1600 units per upload, the default 10 000-unit daily budget covers about
six new videos per day. Use `ytstudio videos upload --max N` to cap a run
Expand Down