YouTube API
Use the Crosspostify API to upload videos and YouTube Shorts to YouTube — with full title, description, privacy settings, category, and tag support.
YouTube is the world's largest video platform. The Crosspostify YouTube API integration lets you programmatically upload long-form videos and Shorts to one or more YouTube channels — with full control over title, description, privacy, category, and tags.
This page covers everything specific to YouTube when using the Crosspostify API. For general authentication, rate limits, and error handling, see the full API Reference.
YouTube-Specific Parameters
YouTube has the richest set of per-post parameters of any platform on Crosspostify. Unlike social platforms, YouTube treats every upload as a standalone piece of content with its own metadata.
accountId✓ AppliesRequired. Your YouTube channel ID from /social-accounts.title✓ AppliesRequired for YouTube. The video title shown in search and on the watch page. Max 100 characters.caption✓ AppliesUsed as the video description. Supports links, hashtags, and chapter timestamps.privacy✓ AppliesYouTube exclusive. Controls visibility: "public", "unlisted", or "private". Defaults to "public".categoryId✓ AppliesYouTube exclusive. Numeric string ID for the YouTube video category (e.g. "22" for People & Blogs).tags✓ AppliesYouTube exclusive. Array of keyword tags to improve discoverability. Max 500 characters total.is_aigc✗ IgnoredTikTok only — ignored for YouTube.facebookFirstComment✗ IgnoredFacebook only — ignored for YouTube.textFormatPresetId✗ IgnoredFacebook only — ignored for YouTube.boardId✗ IgnoredPinterest only — ignored for YouTube.Supported Endpoints
YouTube is video-only. Both regular videos and Shorts use the same /post/video endpoint — YouTube automatically classifies Shorts based on duration and aspect ratio.
YouTube does not support image posts or text-only posts via the API. Only video uploads are supported. Community posts are not available through the Crosspostify API.
/post/videoLong-form VideoUpload a long-form video to a YouTube channel. Supports full metadata including title, description, privacy, category, and tags.
YouTube Video Notes
titleis required for YouTube — unlike other platforms where it's optional or unusedcaptionmaps to the YouTube video description field- Add chapter timestamps in the description (e.g.
00:00 Intro) for automatic chapter markers - Use
privacy: "private"to upload without publishing, then manually review before going public - Upload your video first via
POST /mediaand use the returnedmediaId - All datetime values must be in UTC timezone (ISO 8601 format with
Zsuffix)
Request Body
mediaIdstringrequiredThe ID of the uploaded video file. Obtain this from POST /media.
scheduledDatestringoptionalSchedule the video to go live at a future time (ISO 8601 with 'Z' suffix). Video will be set to 'private' until then.
postsarrayrequiredArray of post objects. Include one object per YouTube channel.
posts[].accountIdstringrequiredThe YouTube channel ID. Retrieve from GET /social-accounts.
posts[].titlestringrequiredThe video title. Shown in search results and on the watch page. Max 100 characters.
posts[].captionstringoptionalThe video description. Supports plain text, links, hashtags, and chapter timestamps. Max 5,000 characters.
posts[].privacystringoptionalVisibility setting. One of: "public", "unlisted", or "private". Defaults to "public".
posts[].categoryIdstringoptionalYouTube category ID as a numeric string (e.g. "22" for People & Blogs). See the Categories section below.
posts[].tagsarrayoptionalArray of keyword strings to improve discoverability. Total length of all tags must not exceed 500 characters.
Response
Code Example
curl -X POST "https://v1.api.crosspostify.com/post/video" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"mediaId": "vid_12345",
"scheduledDate": "2025-06-01T14:00:00Z",
"posts": [
{
"accountId": "acc_youtube_456",
"title": "My Awesome Video Title",
"caption": "Full video description here. Supports links, hashtags, and timestamps.\n\n00:00 Intro\n01:30 Main Content\n05:00 Outro",
"privacy": "public",
"categoryId": "22",
"tags": ["tutorial", "howto", "youtube"]
}
]
}'/post/videoYouTube ShortsUpload a YouTube Short using the same /post/video endpoint. YouTube automatically classifies the video as a Short based on its duration and aspect ratio — no special flag needed.
YouTube Shorts Classification
- YouTube auto-classifies as a Short if: duration is ≤ 60 seconds AND aspect ratio is 9:16 (vertical)
- Adding
#Shortsto the title or description helps YouTube classify it faster - Shorts appear in the dedicated Shorts feed and on the channel's Shorts tab
titleis still required — keep it punchy and under 100 characters- Tags and category still apply and help with discoverability
Request Body
mediaIdstringrequiredThe ID of the uploaded short video file (≤60s, 9:16 aspect ratio). Obtain from POST /media.
scheduledDatestringoptionalSchedule the Short to go live at a future time (ISO 8601 with 'Z' suffix).
postsarrayrequiredArray of post objects. Include one object per YouTube channel.
posts[].accountIdstringrequiredThe YouTube channel ID. Retrieve from GET /social-accounts.
posts[].titlestringrequiredThe Short title. Include "#Shorts" to help YouTube classify it. Max 100 characters.
posts[].captionstringoptionalThe Short description. Include "#Shorts" here too for faster classification. Max 5,000 characters.
posts[].privacystringoptionalVisibility: "public", "unlisted", or "private". Defaults to "public".
posts[].categoryIdstringoptionalYouTube category ID as a numeric string.
posts[].tagsarrayoptionalArray of keyword tags. Max 500 characters total.
Response
Code Example
curl -X POST "https://v1.api.crosspostify.com/post/video" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"mediaId": "vid_short_789",
"scheduledDate": "2025-06-01T14:00:00Z",
"posts": [
{
"accountId": "acc_youtube_456",
"title": "Quick tip you need to know! #Shorts",
"caption": "Drop a comment if this helped! 👇 #Shorts #Tutorial",
"privacy": "public"
}
]
}'Privacy Settings
YouTube is the only platform on Crosspostify with explicit privacy controls per upload. Use the privacy parameter to control who can see the video.
publicunlistedprivateWhen you use scheduledDate, YouTube sets the video to private internally until the scheduled time, then automatically switches it to public. You do not need to set privacy: "private" manually for scheduled posts.
Video Categories
Use the categoryId parameter to assign your video to a YouTube category. This helps YouTube's algorithm surface your content to the right audience.
1Film & Animation2Autos & Vehicles10Music15Pets & Animals17Sports19Travel & Events20Gaming22People & Blogs23Comedy24Entertainment25News & Politics26Howto & Style27Education28Science & Technology29Nonprofits & ActivismContent Guidelines
YouTube has strict technical requirements for uploads. Videos that don't meet these specs may be rejected or processed with degraded quality.
Long-form Video Requirements
- Format: MP4 (H.264 + AAC recommended)
- Max file size: 256GB (YouTube limit)
- Max duration: 12 hours (verified accounts)
- Recommended resolution: 1080p or 4K
- Recommended ratio: 16:9 (landscape)
- Frame rate: 24, 25, 30, 48, 50, or 60fps
YouTube Shorts Requirements
- Max duration: 60 seconds
- Aspect ratio: 9:16 (vertical) required
- Min resolution: 1080×1920px recommended
- Format: MP4 (H.264 + AAC recommended)
- Add #Shorts to title or description
- Frame rate: 30 or 60fps recommended
Title & Description Tips
- Title: max 100 characters
- Description: max 5,000 characters
- Put keywords in the first 2-3 words of title
- Add chapter timestamps (00:00 format) for chapters
- First 150 chars of description shown in search
- Tags: max 500 characters total across all tags
Scheduling
- Minimum lead time: ~15 minutes ahead
- All times must be UTC (ISO 8601 + Z)
- Omit scheduledDate to publish immediately
- Scheduled videos are private until publish time
- No maximum scheduling window enforced