Platforms
YouTube
Upload videos and Shorts to YouTube via the PostPeer API.
Overview
Upload videos and Shorts to YouTube with full metadata control — titles, descriptions, tags, privacy settings, and categories. PostPeer handles YouTube's chunked upload process and OAuth.
Quick Start
1. Connect a YouTube Account
curl https://api.postpeer.dev/v1/connect/youtube \
-H "x-access-key: YOUR_API_KEY"Returns a Google OAuth URL. The user authorizes video upload permissions. See Connect Accounts for the full OAuth flow.
2. Get the Account ID
curl https://api.postpeer.dev/v1/connect/integrations \
-H "x-access-key: YOUR_API_KEY"Find the integration with "platform": "youtube" and note the id.
3. Upload a Video
curl -X POST "https://api.postpeer.dev/v1/posts" \
-H "x-access-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "How to build a social media scheduler",
"platforms": [
{
"platform": "youtube",
"accountId": "yt_789",
"platformSpecificData": {
"title": "How to Build a Social Media Scheduler",
"privacyStatus": "public",
"tags": ["tutorial", "api", "social media"]
}
}
],
"mediaItems": [
{ "type": "video", "url": "https://cdn.example.com/video.mp4" }
],
"publishNow": true
}'Response:
{
"success": true,
"status": "published",
"postId": "post_ghi789",
"platforms": [
{
"platform": "youtube",
"success": true,
"platformPostUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}
]
}Platform-Specific Data
| Field | Type | Description |
|---|---|---|
title | string | Video title (required) |
description | string | Video description |
privacyStatus | string | "public", "unlisted", or "private" |
tags | string[] | Tags for discoverability |
categoryId | string | YouTube category ID |
Shorts
Upload vertical videos (9:16, up to 60 seconds) and they'll be published as YouTube Shorts:
curl -X POST "https://api.postpeer.dev/v1/posts" \
-H "x-access-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Quick API tip! #shorts",
"platforms": [
{
"platform": "youtube",
"accountId": "yt_789",
"platformSpecificData": {
"title": "Quick API Tip",
"privacyStatus": "public"
}
}
],
"mediaItems": [
{ "type": "video", "url": "https://cdn.example.com/short.mp4" }
],
"publishNow": true
}'Supported Formats
| Type | Formats | Max Size | Max Duration |
|---|---|---|---|
| Video | MP4, MOV, AVI, WMV | 256 GB | 12 hours |
| Shorts | MP4, MOV | 256 GB | 60 seconds |
| Thumbnail | JPG, PNG | 2 MB | — |
Pass a thumbnail URL in mediaItems with "thumbnail" field to set a custom thumbnail.