How to Schedule Facebook Posts via API
Schedule Facebook posts programmatically with the SocialRails API. Covers character limits, page selection, Reels, media support, rate limits, and code examples for automated Facebook posting.
Schedule Facebook posts programmatically using the SocialRails API. This guide covers character limits, supported content types, page selection, code examples, and best practices for automated Facebook posting.
Character Limits
- Regular posts: 63,206 characters
- Comments: 8,000 characters
- URLs: Automatically generate link previews when included in post text
- Ad copy: 125 characters recommended for primary text
Supported Content Types
API Example
# Schedule a Facebook post to a specific page
curl -X POST https://socialrails.com/api/v1/posts \
-H "Authorization: Bearer sr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Excited to announce our latest product update! Check it out at socialrails.com",
"platform": "facebook",
"scheduled_for": "2026-03-15T10:00:00Z",
"platform_settings": {
"facebook": {
"selectedPage": "PAGE_ID"
}
}
}'Posting to Pages
Facebook posting requires selecting a page. Use the selectedPage field in platform settings to specify which page to post to.
Discover your pages by calling the tools endpoint:
curl -X POST https://socialrails.com/api/v1/accounts/:id/tools \
-H "Authorization: Bearer sr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"tool": "pages"
}'selectedPage: Required. The ID of the Facebook page to post to.selectedPages: Post to multiple pages at once by passing an array of page IDs.videoType: Set to"reel"for Reels or"post"for regular video posts.
# Post to multiple pages with a Reel
curl -X POST https://socialrails.com/api/v1/posts \
-H "Authorization: Bearer sr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Check out our latest Reel!",
"platform": "facebook",
"media": ["MEDIA_KEY_FROM_UPLOAD"],
"scheduled_for": "2026-03-15T10:00:00Z",
"platform_settings": {
"facebook": {
"selectedPages": ["PAGE_ID_1", "PAGE_ID_2"],
"videoType": "reel"
}
}
}'First Comment
Automatically post a comment on your Facebook page post right after it goes live. Use this to add a link, question, or extra context to drive engagement without cluttering the main post.
curl -X POST https://socialrails.com/api/v1/posts \
-H "Authorization: Bearer sr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Excited to announce our latest product update!",
"platform": "facebook",
"scheduled_for": "2026-03-15T10:00:00Z",
"first_comment": "Check it out and let us know what you think! Link in bio.",
"platform_settings": {
"facebook": {
"selectedPage": "PAGE_ID"
}
}
}'The first comment is posted as a comment on the page post. Max 2,200 characters.
Best Practices
- Native video: Gets 10x more reach compared to shared link videos
- Reels: Outperform regular video posts in reach and engagement
- Optimal posting times: Tuesday-Thursday, 9am-12pm in your audience's timezone
- External links: Avoid external links in organic posts, Facebook deprioritizes them in the algorithm
- Image posts: Use high-quality visuals, posts with images see 2.3x more engagement
- Post consistently to build audience trust and algorithmic favor
Rate Limits
Facebook's Graph API limits apply in addition to SocialRails rate limits:
- 200 posts per hour per page
- Media uploads: 25 images per hour
- API calls: 200 calls per user per hour
SocialRails handles these limits automatically and will retry failed posts.