Platform GuidesHow to Schedule YouTube Posts via API

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

TypeSupportedNotes
VideosYesRequired for all YouTube posts
ShortsYesVertical video up to 60 seconds
Text onlyNoVideo is required for all uploads
Community postsNoNot supported via API

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.

Frequently Asked Questions

What are the character limits for YouTube video descriptions and titles?
YouTube video descriptions can be up to 5,000 characters and titles up to 100 characters. You can include up to 15 hashtags in the description, and the first 3 hashtags appear above the video title. Total tag length across all tags is limited to 500 characters.
What are the video requirements for YouTube API uploads?
YouTube requires video content for all posts. Supported formats include MP4, MOV, AVI, WMV, FLV, and WebM with a maximum file size of 256GB. For Shorts, use vertical video (9:16) up to 60 seconds. SocialRails handles the YouTube Data API upload process automatically.
How do I upload YouTube Shorts via API?
Upload a vertical video (9:16 aspect ratio) up to 60 seconds long via /api/v1/media/upload, then create a post with platform set to 'youtube'. SocialRails automatically detects Shorts based on video duration and aspect ratio. Include #shorts in your description for optimal discovery.
Can I upload custom thumbnails for YouTube videos via API?
Yes. Upload a thumbnail image via /api/v1/media/upload with the type set to 'thumbnail', then include the thumbnail media key when creating your YouTube post. Custom thumbnails are the single biggest factor in click-through rates and are highly recommended for every video.