Uploading through the YouTube API
Google's YouTube Data API uploads with videos.insert, a resumable upload of up to 256 GB. It is free, but until your Google Cloud project is verified, every video it uploads is locked to private. Plan for OAuth verification, a daily quota per project, and a second scope to change a video after upload.
Google's API: the parts that matter
Private until verified
From Google's reference: "All videos uploaded via the videos.insert endpoint from unverified API projects created after 28 July 2020 will be restricted to private viewing mode." This is the first wall every developer hits. Your code works, the upload succeeds, and nobody can watch the video.
Getting out of it means OAuth verification for a sensitive scope, which takes a few business days, and a separate compliance audit if you need more quota.
Scopes: upload is not enough
youtube.upload covers videos.insert and thumbnails.set. It does not cover videos.update, which is how you change privacy, title or description later, nor posting a comment. With upload alone, the failure lands in the worst place: the upload succeeds and the next call returns "Request had insufficient authentication scopes", leaving a private video you cannot publish.
apublished requests youtube.upload plus youtube.force-ssl, the narrowest scope that covers both gaps. It is sensitive but not restricted, so it does not trigger Google's third-party security assessment. Restricted scopes such as Gmail or Drive would.
For statistics, youtube.readonly and yt-analytics.readonly are separate again.
Tokens
Google issues one long-lived refresh token and one-hour access tokens. Three surprises from building on it:
- While your consent screen is in Testing, refresh tokens expire after 7 days.
- Each Google account can hold at most 100 refresh tokens per client id; the oldest is invalidated without warning.
- Access can be revoked after 90 consecutive days without use.
Quota
apublished's code works with a cap of 100 videos.insert calls per day per Cloud project, counted across all your users, plus 10,000 units a day for every other call. For one channel, ample. For a product with many users, this is the hardest limit you will face.
A certification sentence
YouTube's Terms of Service require a fixed sentence at your upload or schedule confirmation step, in your product's language. It applies to anything built on the API.
Fields and limits
| Field | Limit (as of November 2026) |
|---|---|
| Video | Up to 256 GB or 12 hours; MP4, MOV, WebM, AVI |
| Title | 100 characters |
| Description | 5,000 bytes, not characters |
| Thumbnail | JPEG or PNG, up to 50 MB via thumbnails.set |
| Made for kids | Must be declared for every video |
| Privacy | public, unlisted, private |
Length also depends on the channel: unverified channels upload up to 15 minutes. Sizes: YouTube video size and YouTube thumbnail size.
Is there a YouTube Shorts API?
No. A Short is an ordinary videos.insert upload. YouTube categorizes videos uploaded since 15 October 2024 as Shorts when they are vertical or square and up to three minutes long. Shorts are capped at 1080p. One rule worth coding for: a Short over one minute with an active Content ID claim is blocked worldwide. Details: YouTube Shorts length.
Direct, or through a publishing API
| YouTube Data API | Publishing API | |
|---|---|---|
| Google verification | Yours | Done by the provider |
| Quota | Your project's | The provider's |
| Resumable upload code | Yours | Handled |
| Cost | Free | Subscription |
| TikTok, Instagram, Facebook | Each a new integration | Same request |
For a YouTube-only tool you control end to end, go direct. For posting to YouTube as one channel among several, a provider saves the verification and the quota math.
The same upload through apublished
Validate first. It changes nothing and returns each violation with the actual and the allowed value:
curl -X POST https://apublished.com/v1/posts:validate \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{
"body": { "items": [{ "text": "Hello" }] },
"targets": [{ "channelId": "…", "settings": { } }]
}'
For YouTube, settings holds title, privacyStatus, madeForKids, and optionally categoryId, tags and license. madeForKids has no default on purpose: it is a legal declaration under COPPA, and the API will not make it for your user. The video goes up first through POST /v1/media (a presigned upload) or POST /v1/media:from-url, then is referenced by its asset id. Videos are never transcoded: a file YouTube would refuse is refused up front, with a reason.
Scheduled videos are uploaded private ahead of time and switched to their final privacy at the set moment. After publishing, title, description, tags, thumbnail and privacy can still be changed. Views, likes, comments, shares, watch time and average view are collected per video.
apublished is a Swiss product billed in Swiss francs, from CHF 19 a month, API on every plan, 7-day free trial, no free plan. Other APIs that cover YouTube include Ayrshare, Upload-Post and Zernio (docs read 11 November 2026); see the social media API comparison. For automation without code, see YouTube uploads with n8n.
FAQ
Why are my API uploads private? Your Cloud project is unverified. Google locks those uploads to private.
How many videos can I upload per day? It depends on your project's quota. apublished's code plans for 100 uploads per project per day.
Can I schedule with the YouTube API? Upload as private, then change privacy at the right time with videos.update. That needs the extra scope.
Do I need a separate API for Shorts? No. Upload a vertical or square video of three minutes or less.
Sources
- YouTube Data API reference: videos.insert, videos, thumbnails.set, checked October 2026.
- YouTube Help: Shorts, upload length, made for kids, checked October 2026.
- apublished provider manifest and agent docs, checked November 2026.
Published November 18, 2026