Get started for freeGet started

Guide

YouTube API: uploading videos with videos.insert, step by step

To upload a video through the API for YouTube you call videos.insert with an OAuth token, and a project created after 28 July 2020 has an extra catch: its uploads stay private until it passes an audit.

1. YouTube API: get an OAuth token with an upload scope

The videos.insert page accepts four scopes: youtube.upload, youtube, youtubepartner and youtube.force-ssl. The narrowest that fits is youtube.upload.

The token has to come from the channel owner approving your app, so you need a Google Cloud project and a consent screen of your own.

2. Send the file

The only required query parameter is part, which names the properties you are writing, such as the title and description. The file goes by media upload to the upload endpoint under googleapis.com/upload/youtube/v3/videos.

The documented size ceiling for that upload is 256 GB.

3. Watch for the private-mode rule

Google’s page says videos uploaded through videos.insert from unverified API projects created after 28 July 2020 are restricted to private viewing mode until the project goes through an audit.

So a script that works on your own channel can still publish nothing the public can see until that audit is done.

4. Decide who owns the app

Writing against the API yourself makes sense when YouTube is the only place you post. When a video also goes to Instagram, Facebook, LinkedIn, Threads or X, each has its own app and review to run.

Through Dripost instead

Dripost’s REST API (dripost.com/docs/api) takes a post with a video and a list of platforms, YouTube among them. You connect your channel once in Dripost; there is no Google Cloud project for you to run.

You get the link to the live video back, or the platform’s own reason if it refused. Each post goes to each platform once, and when a result is unclear Dripost asks a person instead of sending again.

Sources

Questions

Which scope does a YouTube upload need?

Google’s videos.insert page accepts youtube.upload, youtube, youtubepartner and youtube.force-ssl.

Why are my API uploads private?

Google restricts uploads from unverified API projects created after 28 July 2020 to private until the project is audited.

Can Dripost’s API upload to YouTube?

Yes. YouTube is one of the platforms a Dripost post can go to.

Is the API for YouTube free?

It is free to use within a daily quota, and an upload spends a large share of that quota. The cost and pricing questions are about asking Google for more.

API pricing on YouTube: what does it cost?

The YouTube Data API has no fee. Each Google Cloud project gets a daily quota, 10,000 units by default, and a project that needs more can apply for a higher quota through Google's audit form. That approval is the real API cost on YouTube.