Post to Facebook Pages programmatically using the PostPost REST API. A simpler alternative to the Facebook Graph API or Meta Marketing API.
Facebook API Overview
PostPost provides a unified REST API for publishing text posts, images (including carousels and albums), and video content to Facebook Pages. Multiple pages per account are supported. No need to manage Facebook OAuth flows, handle Graph API versioning, or set up a Meta Developer app.
Why Use PostPost Instead of Facebook Graph API?
| Feature | PostPost API | Facebook Graph API |
|---|---|---|
| Authentication | Single API key | OAuth 2.0 flow |
| API versioning | Handled | Manual updates required |
| Multi-page support | Built-in | Manual implementation |
| Multi-platform | Post to 11 platforms | Facebook only |
| Setup time | 5 minutes | Hours (app setup) |
| Media handling | Automatic | Manual upload |
Keywords: Facebook API, Facebook Graph API, Facebook posting API, Facebook Page API, post to Facebook programmatically, Facebook REST API, Facebook developer API, Facebook automation API, Facebook content API, Facebook bot API, Meta Graph API
Platform ID Format
facebook-{pageId}Where {pageId} is your Facebook Page ID assigned during account connection via Facebook OAuth. If you manage multiple pages, each page gets its own platform ID.
Requirements
- A Facebook Page (not a personal profile) connected via OAuth through the PostPost dashboard
- Page admin permissions granted during OAuth (OAuth scopes requested:
public_profile,pages_manage_posts,pages_show_list,pages_read_engagement,business_management) - API key from PostPost
Supported Content
| Type | Supported | Limits |
|---|---|---|
| Text | Yes | 2,200 characters (PostPost frontend limit; see note below) |
| Images | Yes | Multiple supported (carousel/album), WebP auto-converted to JPEG |
| Videos | Yes | MP4, MOV, AVI, MKV, WebM formats |
| Multiple Pages | Yes | Each page has its own platform ID |
Token Management
Facebook page tokens have a 59-day lifespan. PostPost automatically handles token refresh so you do not need to manually reconnect your account. However, if the refresh fails (e.g., due to permission changes on Facebook), you will need to reconnect the page through the PostPost dashboard.
Note: The auto-refresh mechanism is handled by a separate internal service and runs independently of the API.
Examples
Post a Text Update
JavaScript (fetch)
const response = await fetch('https://api.postpost.dev/api/v1/create-post', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
content: 'We are thrilled to announce our new product launch! After months of development, we are finally ready to share what we have been building. Visit our website to learn more and sign up for early access.',
platforms: ['facebook-112233445566']
})
});
const data = await response.json();
console.log(data);
// Response: { "success": true, "postGroupId": "abc123..." }Python (requests)
import requests
response = requests.post(
'https://api.postpost.dev/api/v1/create-post',
headers={
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
json={
'content': 'We are thrilled to announce our new product launch! After months of development, we are finally ready to share what we have been building. Visit our website to learn more and sign up for early access.',
'platforms': ['facebook-112233445566']
}
)
data = response.json()
print(data)
# Response: { "success": true, "postGroupId": "abc123..." }cURL
curl -X POST https://api.postpost.dev/api/v1/create-post \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"content": "We are thrilled to announce our new product launch! After months of development, we are finally ready to share what we have been building. Visit our website to learn more and sign up for early access.",
"platforms": ["facebook-112233445566"]
}'
# Response: { "success": true, "postGroupId": "abc123..." }Node.js (axios)
const axios = require('axios');
const response = await axios.post('https://api.postpost.dev/api/v1/create-post', {
content: 'We are thrilled to announce our new product launch! After months of development, we are finally ready to share what we have been building. Visit our website to learn more and sign up for early access.',
platforms: ['facebook-112233445566']
}, {
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
});
console.log(response.data);
// Response: { "success": true, "postGroupId": "abc123..." }Post with Multiple Images
JavaScript (fetch)
const response = await fetch('https://api.postpost.dev/api/v1/create-post', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
content: 'Highlights from our company retreat last weekend! Great team, great memories.',
platforms: ['facebook-112233445566']
})
});
const data = await response.json();
console.log(data);
// Response: { "success": true, "postGroupId": "abc123..." }Python (requests)
import requests
response = requests.post(
'https://api.postpost.dev/api/v1/create-post',
headers={
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
json={
'content': 'Highlights from our company retreat last weekend! Great team, great memories.',
'platforms': ['facebook-112233445566']
}
)
data = response.json()
print(data)
# Response: { "success": true, "postGroupId": "abc123..." }cURL
curl -X POST https://api.postpost.dev/api/v1/create-post \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"content": "Highlights from our company retreat last weekend! Great team, great memories.",
"platforms": ["facebook-112233445566"]
}'
# Response: { "success": true, "postGroupId": "abc123..." }Node.js (axios)
const axios = require('axios');
const response = await axios.post('https://api.postpost.dev/api/v1/create-post', {
content: 'Highlights from our company retreat last weekend! Great team, great memories.',
platforms: ['facebook-112233445566']
}, {
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
});
console.log(response.data);
// Response: { "success": true, "postGroupId": "abc123..." }Note: To attach media to a Facebook post, first create the post, then upload media using the media upload workflow with the returned
postGroupId.
Post to Multiple Facebook Pages
JavaScript (fetch)
const response = await fetch('https://api.postpost.dev/api/v1/create-post', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
content: 'Important announcement: Our offices will be closed on Monday for the holiday. We will resume normal business hours on Tuesday.',
platforms: [
'facebook-112233445566',
'facebook-778899001122'
]
})
});
const data = await response.json();
console.log(data);
// Response: { "success": true, "postGroupId": "abc123..." }Python (requests)
import requests
response = requests.post(
'https://api.postpost.dev/api/v1/create-post',
headers={
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
json={
'content': 'Important announcement: Our offices will be closed on Monday for the holiday. We will resume normal business hours on Tuesday.',
'platforms': [
'facebook-112233445566',
'facebook-778899001122'
]
}
)
data = response.json()
print(data)
# Response: { "success": true, "postGroupId": "abc123..." }cURL
curl -X POST https://api.postpost.dev/api/v1/create-post \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"content": "Important announcement: Our offices will be closed on Monday for the holiday. We will resume normal business hours on Tuesday.",
"platforms": [
"facebook-112233445566",
"facebook-778899001122"
]
}'
# Response: { "success": true, "postGroupId": "abc123..." }Node.js (axios)
const axios = require('axios');
const response = await axios.post('https://api.postpost.dev/api/v1/create-post', {
content: 'Important announcement: Our offices will be closed on Monday for the holiday. We will resume normal business hours on Tuesday.',
platforms: [
'facebook-112233445566',
'facebook-778899001122'
]
}, {
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
});
console.log(response.data);
// Response: { "success": true, "postGroupId": "abc123..." }Platform Quirks
- Pages only, not profiles: PostPost posts to Facebook Pages, not personal profiles. The Facebook API does not allow posting to personal profiles via third-party apps.
- Multiple pages: If you manage multiple Facebook Pages, each page is connected separately and gets its own
facebook-{pageId}platform ID. You can post to multiple pages in a single API call. - WebP auto-conversion: WebP images are automatically converted to JPEG before uploading to Facebook. No action needed on your part.
- 59-day token lifespan: Facebook page access tokens expire after 59 days. PostPost auto-refreshes these tokens, but if the refresh fails silently (e.g., due to permission changes on Facebook's side), posts will start failing without a specific token-related error. If you experience unexplained posting failures, try reconnecting the page through the PostPost dashboard.
- Album behavior: When posting multiple images, Facebook may display them as a carousel or an album depending on the count and the viewer's device.
- Video and images are separate: A single post can contain either images or a video, but not both simultaneously. This is a Facebook platform limitation. Note that PostPost's backend validation does not enforce this mixed media restriction for Facebook (it only does so for Instagram). If Facebook rejects mixed media, the error comes from the Facebook API itself, not from PostPost's validation layer.
- Multi-media code path supports images only: The multi-media code path currently only supports multiple images (photo albums). Multiple videos in a single post are not properly supported — if you attach multiple videos, they will be processed through the photo upload path incorrectly. Use one video per post for reliable behavior.
- Link previews: If your text content includes a URL, Facebook will automatically generate a link preview. This is Facebook's behavior and is not controlled by PostPost.
Character Limits
| Element | Limit |
|---|---|
| Post body | 2,200 characters (PostPost frontend limit; see note below) |
| Comment | 8,000 characters |
Note: The 2,200-character limit is enforced by the PostPost frontend/editor only. The API does not enforce this limit — content up to Facebook's native 63,206-character limit will be accepted.
API Limits
These limits apply when posting via the Facebook Graph API (and by extension, PostPost).
Character Limit
- 2,200 characters maximum for post body via the PostPost frontend/editor. The API does not enforce this limit; content up to Facebook's native 63,206-character limit will be accepted.
- Posts under 80 characters get 66% more engagement
Image Limits (API)
| Property | Limit |
|---|---|
| Max size | 10 MB (PNG recommended max 1 MB to avoid pixelation) |
| Max count | Up to 10 images per post |
| Formats | JPEG, PNG, GIF, BMP, TIFF |
Video Limits (API)
| Property | API Limit | Native Limit |
|---|---|---|
| Duration | 45 minutes max | 240 min (4 hours) |
| Max size | 512 MB (PostPost server limit; Facebook natively allows up to 2 GB via API, 4 GB natively) | 4 GB |
| Formats | MP4, MOV | - |
Reels via API:
- Duration: 90 seconds max
- Pages only (not personal profiles)
Important API Restrictions
- Reels can only be posted to Pages (not personal profiles)
- Rate limit: 30 Reels per day per Page
- Rate formula: 200 x users/hour
Common Error Messages
| Error Code | Description |
|---|---|
Error 1363026 | Video exceeds 45 min duration |
Error 1363023 | File size exceeds 2 GB (note: PostPost's 512 MB server limit will reject files before this Facebook error is reached) |
Error 1363128 | Reels duration outside 3-90 second range |
X (Twitter)
Post to Twitter (X) programmatically using the PostPost REST API. A simpler alternative to the official Twitter API v2, Tweepy, node-twitter-api-v2, or Twitter Java SDK.
Post to Instagram programmatically using the PostPost REST API. A simpler alternative to the Instagram Graph API, Instagram Basic Display API, or Instagrapi.