IntegrationsAdvanced

How to Bulk Update Titles and Tags Across Many Videos via API

Read every video on your channel, then rewrite titles, descriptions, or tags in bulk with a guarded update script.

10 minAdvanced

Rebranding a series or fixing a typo across 80 videos by hand is misery. This guide lists every video on your channel through the API, then applies a bulk edit (such as adding a tag or appending a line to descriptions) with a dry-run mode so you preview before anything changes.

What you need

  • client_secret.json with the youtube.force-ssl scope
  • Python 3.9+ and the google client
  • A clear rule for what to change (the example adds a tag)

Step 1: List all your uploads

Every channel has an uploads playlist. Find its id from channels.list, then page through playlistItems.list to collect all video ids. This avoids the search endpoint, which costs far more quota.

bulk.py
from upload import service

def all_video_ids(yt):
    ch = yt.channels().list(part="contentDetails", mine=True).execute()
    uploads = ch["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
    ids, token = [], None
    while True:
        res = yt.playlistItems().list(
            part="contentDetails", playlistId=uploads,
            maxResults=50, pageToken=token,
        ).execute()
        ids += [i["contentDetails"]["videoId"] for i in res["items"]]
        token = res.get("nextPageToken")
        if not token:
            return ids

Step 2: Apply the change with a dry run

The videos.update call replaces the whole snippet, so you must read the current snippet, modify it, and write it back. Keep a DRY_RUN flag that prints what would change without calling update until you trust it.

bulk.py
DRY_RUN = True
NEW_TAG = "season-2"

def add_tag(yt, video_id):
    v = yt.videos().list(part="snippet", id=video_id).execute()["items"][0]
    snip = v["snippet"]
    tags = snip.get("tags", [])
    if NEW_TAG in tags:
        return
    tags.append(NEW_TAG)
    snip["tags"] = tags
    print(f"{video_id}: + {NEW_TAG}")
    if not DRY_RUN:
        yt.videos().update(part="snippet", body={"id": video_id, "snippet": snip}).execute()

if __name__ == "__main__":
    yt = service()
    for vid in all_video_ids(yt):
        add_tag(yt, vid)
zsh — bulk-edit (dry run)
$python bulk.py
dQw4w9WgXcQ: + season-2
9bZkp7q19f0: + season-2
nothing changed yet; flip DRY_RUN to False to apply
$
Update replaces, it does not merge
videos.update overwrites the entire snippet you send. Always read the current snippet first and modify it, or you will wipe titles and descriptions you meant to keep.

Step 3: Mind the quota

Each update costs about 50 quota units. With a 10,000 unit daily budget you can touch roughly 200 videos per day, so split very large channels across multiple days or request a quota increase.

Result

After a dry run you trust, flip DRY_RUN to False and the script tags or rewrites your whole back catalog in one pass, with the console listing every change it makes.

Watch related tutorials

Tags
#api#bulk-edit#titles#tags#python