How do I upload videos to YouTube with an API?
Send a multipart/form-data request to Upload-Post's POST https://api.upload-post.com/api/upload with the video file (or URL), a title (required for YouTube), user and platform[]=youtube. Upload-Post ships its own dedicated YouTube API quota, so you don't need a Google Cloud project, YouTube Data API keys or a quota-increase request. You just connect the YouTube channel once via Google OAuth in the dashboard.
Steps
- Create an account at upload-post.com and generate an API key under API Keys (Authentication).
- Connect the YouTube channel at Manage Users via Google OAuth (or a white-label JWT link for your users).
- Upload:
- cURL
- Python
- JavaScript
curl \
-H 'Authorization: Apikey your-api-key-here' \
-F 'video=@/path/to/your/video.mp4' \
-F 'title="Your Video Title"' \
-F 'description="Your video description"' \
-F 'user="test"' \
-F 'platform[]=youtube' \
-F 'tags[]=tutorial' \
-F 'tags[]=howto' \
-X POST https://api.upload-post.com/api/upload
import requests
response = requests.post(
"https://api.upload-post.com/api/upload",
headers={"Authorization": "Apikey your-api-key-here"},
files={"video": open("/path/to/your/video.mp4", "rb")},
data=[
("title", "Your Video Title"),
("description", "Your video description"),
("user", "test"),
("platform[]", "youtube"),
("tags[]", "tutorial"),
("tags[]", "howto"),
],
)
print(response.json())
import fs from "node:fs";
const form = new FormData();
form.append("video", new Blob([fs.readFileSync("/path/to/your/video.mp4")]), "video.mp4");
form.append("title", "Your Video Title");
form.append("description", "Your video description");
form.append("user", "test");
form.append("platform[]", "youtube");
form.append("tags[]", "tutorial");
form.append("tags[]", "howto");
const response = await fetch("https://api.upload-post.com/api/upload", {
method: "POST",
headers: { Authorization: "Apikey your-api-key-here" },
body: form,
});
console.log(await response.json());
YouTube Shorts
There is no separate Shorts endpoint: YouTube automatically classifies a video as a Short when it is 60 seconds or less and vertical (9:16) or square (1:1). Upload it exactly like any other video.
Useful YouTube parameters
Full list in the Upload Video reference:
| Parameter | What it does | Default |
|---|---|---|
youtube_title / youtube_description | YouTube-specific title/description (fall back to title) | title |
tags[] | Video tags | [] |
categoryId | YouTube category | "22" |
privacyStatus | public, unlisted or private | public |
thumbnail / thumbnail_url | Custom thumbnail (file or URL, ≤ 2 MB; not supported for Shorts) | none |
youtube_playlist_id | Playlist ID(s) to add the video to after publishing (comma-separated) | none |
youtube_subtitle_file_{N} + youtube_subtitle_language_{N} | Subtitle tracks (SRT/VTT/…) | none |
containsSyntheticMedia | Declare AI-generated content | false |
selfDeclaredMadeForKids | COPPA declaration | false |
scheduled_date | ISO-8601 date to schedule the post | none |
Limits and gotchas
titleis required for YouTube uploads.- Daily cap: YouTube videos are capped per connected channel per rolling 24 h; see upload limits.
- Big files: use
async_upload=trueand poll Upload Status; synchronous requests fall back to background after 59 s. - Quota: you no longer need your own Google Cloud quota (background here).
- Formats: see Video Requirements.