How to Schedule YouTube Posts via API
Schedule YouTube videos and Shorts programmatically with the SocialRails API. Covers video requirements, description limits, thumbnail uploads, and code examples for automated YouTube posting.
Schedule YouTube videos and Shorts programmatically using the SocialRails API. This guide covers video requirements, description limits, thumbnail uploads, code examples, and best practices for automated YouTube posting.
Character Limits
- Descriptions: 5,000 characters
- Titles: 100 characters
- Tags: 500 characters total across all tags
- Hashtags: Maximum 15 per description, first 3 appear above the title
Supported Content Types
API Example
# Upload video first
curl -X POST https://socialrails.com/api/v1/media/upload \
-H "Authorization: Bearer sr_live_YOUR_KEY" \
-F "file=@my-video.mp4"
# Then schedule the YouTube post
curl -X POST https://socialrails.com/api/v1/posts \
-H "Authorization: Bearer sr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "How to automate your social media posting with the SocialRails API. In this tutorial, we walk through setting up API keys, scheduling posts, and managing multiple platforms from a single endpoint.\n\n#socialrails #api #socialmedia #automation",
"platform": "youtube",
"media": ["VIDEO_MEDIA_KEY"],
"scheduled_for": "2026-03-15T15:00:00Z"
}'Video Requirements
Video is always required for YouTube posts. SocialRails handles the YouTube upload process via the YouTube Data API.
- Supported formats: MP4, MOV, AVI, WMV, FLV, WebM
- Maximum file size: 256GB (or 12 hours, whichever is less)
- Shorts: Vertical video (9:16 aspect ratio), up to 60 seconds
- Regular videos: No maximum duration (within file size limits)
- Resolution: 1080p or higher recommended for best quality
No special platform_settings are currently required for YouTube. SocialRails automatically detects Shorts based on video duration and aspect ratio.
# Schedule a YouTube Short
curl -X POST https://socialrails.com/api/v1/posts \
-H "Authorization: Bearer sr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Quick tip: use the SocialRails API to schedule across all platforms at once! #shorts #socialmedia #api",
"platform": "youtube",
"media": ["SHORT_VIDEO_MEDIA_KEY"],
"scheduled_for": "2026-03-15T18:00:00Z"
}'Thumbnail Uploads
Upload a custom thumbnail image using the thumbnail media type:
# Upload a thumbnail
curl -X POST https://socialrails.com/api/v1/media/upload \
-H "Authorization: Bearer sr_live_YOUR_KEY" \
-F "file=@thumbnail.jpg" \
-F "type=thumbnail"Include the thumbnail media key alongside your video when creating the post. Custom thumbnails significantly improve click-through rates.
Best Practices
- Custom thumbnails: Upload a custom thumbnail for every video, they are the single biggest factor in click-through rates
- SEO-optimized descriptions: Include relevant keywords in the first 2-3 lines of the description, YouTube uses this for search ranking
- First 48 hours: The first 48 hours after upload are crucial for the YouTube algorithm, promote your video across other channels immediately
- Shorts for discovery: Use Shorts to reach new audiences, then funnel them to your longer content
- Titles: Keep titles under 60 characters so they don't get truncated in search results
- Tags: Use a mix of broad and specific tags, front-load the most important ones
- Publish consistently on a schedule your audience can rely on
Rate Limits
YouTube Data API quota limits apply in addition to SocialRails rate limits:
- 10,000 units per day per project
- Video upload: 1,600 units per upload
- Other write operations: 50 units each
- Approximately 6 video uploads per day within default quota
SocialRails handles these limits automatically and will retry failed posts.