Platform GuidesHow to Schedule Instagram Posts via API

How to Schedule Instagram Posts via API

Schedule Instagram posts programmatically with the SocialRails API. Covers image requirements, caption limits, media uploads, and code examples for automated Instagram posting.

Schedule Instagram posts programmatically using the SocialRails API. This guide covers image requirements, caption limits, media uploads, code examples, and best practices for automated Instagram posting.

Character Limits

  • Caption: 2,200 characters
  • Hashtags: Maximum 30 per post (20 recommended)
  • Bio: 150 characters
  • Comments: 2,200 characters

Supported Content Types

TypeSupportedNotes
Photo postsYesJPEG or PNG, minimum 320px, max 1080x1350px
Carousel postsComing soonUp to 10 images/videos
ReelsComing soonUp to 90 seconds
StoriesNoNot supported via Content Publishing API
IGTVDeprecatedUse Reels instead

API Example

# Upload media first
curl -X POST https://socialrails.com/api/v1/media/upload \
  -H "Authorization: Bearer sr_live_YOUR_KEY" \
  -F "file=@my-photo.jpg"
 
# Then schedule the post with the media
curl -X POST https://socialrails.com/api/v1/posts \
  -H "Authorization: Bearer sr_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Launching something new today!\n\nAfter months of building, we are excited to share our public API with the world.\n\n#launch #api #socialrails #buildinpublic",
    "platform": "instagram",
    "media": ["MEDIA_KEY_FROM_UPLOAD"],
    "scheduled_for": "2026-03-05T12:00:00Z"
  }'

Image Requirements

  • Aspect ratios: Square (1:1), Landscape (1.91:1), Portrait (4:5)
  • Minimum resolution: 320px on shortest side
  • Maximum resolution: 1080px wide
  • File size: Up to 8MB for images
  • Format: JPEG and PNG (JPEG recommended for smaller file size)

Best Practices

  • Optimal posting times: Monday-Friday, 11am-1pm and 7-9pm
  • Hashtag strategy: Mix popular (100K+ posts) and niche (1K-50K posts) hashtags
  • Caption length: First 125 characters appear above the fold, front-load the hook
  • Line breaks: Use empty lines between paragraphs for readability
  • CTA: End captions with a question or call-to-action to increase comments
  • Post consistently, the algorithm favors regular posting schedules

Important Notes

  • Instagram requires a Business or Creator account for API posting
  • Posts must include an image or video, text-only posts are not supported
  • The Instagram API publishes posts immediately or at the scheduled time, there's no "draft" state on Instagram itself

Frequently Asked Questions

Can I schedule Instagram posts through an API?
Yes. The SocialRails API lets you schedule Instagram posts by uploading media via /api/v1/media/upload, then creating a post with the platform set to 'instagram' and a scheduled_for timestamp. Instagram requires a Business or Creator account for API posting.
What image sizes does Instagram accept via API?
Instagram supports square (1:1), landscape (1.91:1), and portrait (4:5) aspect ratios. The minimum resolution is 320px on the shortest side, maximum is 1080px wide. Files must be JPEG or PNG, up to 8MB.
What is the Instagram caption character limit?
Instagram captions can be up to 2,200 characters with a maximum of 30 hashtags per post (20 recommended). The first 125 characters appear above the fold in the feed, so front-load important content.
Can I post text-only content to Instagram via API?
No. Instagram requires every post to include at least one image or video. Text-only posts are not supported on the platform. Upload media first using the /api/v1/media/upload endpoint before creating your post.
Updated 2 days ago