Network API

Facebook API for Posting, Scheduling, and Analytics

Ayrshare's Facebook API lets developers publish posts, photos, videos, reels, and stories to Facebook Pages via a single REST endpoint. It supports scheduled posts, audience targeting, comments, Messenger, reviews, boosted ads, and analytics across 14+ social networks through one integration.

Your users link their own Facebook Pages through an OAuth flow inside your product, on Ayrshare's approved Meta app. You don't need your own App Review, Business Verification, or Page tokens.

A scheduled Facebook Page post with a Post now button, a new Messenger message webhook, a comment with Reply and Delete, and a Page reach chart showing 842K

One integration, 14+ networks, 30M+ API calls a day.

X
Facebook
Instagram
TikTok
Bluesky
YouTube
LinkedIn
Pinterest
Telegram
Reddit
Threads
Snapchat
Google Business
WhatsApp

4 hours

max Facebook video length

63,206

caption characters

30M+

API calls handled daily

99.99%

API uptime

4 hours

max Facebook video length

63,206

caption characters

30M+

API calls handled daily

99.99%

API uptime

Before you build

What Do You Need to Use the Facebook API?

Meta's Graph API is free to call, but posting to your customers' Pages takes setup before your first request. You need a Meta developer app, the pages_manage_posts permission with its two prerequisites, Advanced Access through Meta's App Review, and Business Verification. Reviews usually take one to three weeks, and a first rejection is common. With Ayrshare, you skip App Review and Business Verification: your users link their Pages and you post on the same day.

Access

A Meta developer app, App Review for Advanced Access, and Business Verification. Standard Access only works on Pages your own developer account manages.

Cost

No fee per call. The cost is engineering time: the review, a Data Use Checkup every 12 months, token upkeep, and Graph API version upgrades.

Account types

Facebook Pages only, linked by one of the Page's admins. Meta's API doesn't allow posting to personal profiles or groups.

Key limits

Each Page gets a call budget that scales with its engaged users, and Meta allows 30 reels per Page in any 24 hours.

Linking two Facebook Pages through Ayrshare's OAuth connect screen, next to the steps of going direct: App Review, Business Verification, a yearly Data Use Checkup, and Graph API upgrades

Post and Schedule to Facebook in Your Language

Each sample publishes a photo post with a link now, then schedules a video for later. Same endpoint, same JSON, in Node.js, Python, PHP, Java, Go, Ruby, C#, or plain cURL. Add a Profile-Key header to post for one of your users.

# 1. Publish now: a photo post with a linkcurl -X POST https://api.ayrshare.com/api/post \  -H "Authorization: Bearer $AYRSHARE_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "post": "Our new analytics dashboard is live. https://example.com/blog/analytics",    "platforms": ["facebook"],    "mediaUrls": ["https://example.com/dashboard.jpg"]  }'
# 2. Schedule for later (ISO 8601, UTC)curl -X POST https://api.ayrshare.com/api/post \  -H "Authorization: Bearer $AYRSHARE_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "post": "Friday product drop.",    "platforms": ["facebook"],    "mediaUrls": ["https://example.com/drop.mp4"],    "scheduleDate": "2026-11-06T17:00:00Z"  }'
Full Post API Reference
The fine print

Facebook API Limits: Post Types, Media, and Characters

Meta's rules in one place. The full list lives in the Facebook media guidelines and the Facebook publishing options.

Post types

2 to 10cards per link carousel

Text, links with automatic previews, photos, video, reels, stories, animated GIFs, and link carousels, on Facebook Pages linked by a Page admin. One post can't mix photos and video.

Images

10 MBper image

JPEG, PNG, BMP, GIF, or TIFF, up to 2048 px on each side. 1200 x 630 px is the recommended size.

Video

10 GBper video

MP4, MOV, or AVI, up to 4 hours. 16:9 landscape or 9:16 portrait, up to 30 FPS. Titles run to 255 characters.

Characters

63,206characters

Line breaks, bold and italic text, and @mentions of other Pages. Per-image captions and alt text are supported.

Reels

30reels per Page per 24 hours

9:16 video from 3 to 90 seconds, up to 2 GB, at least 540 x 960 px.

Stories

60 secmax video story

One photo or one video. Stories don't carry post text, and the media can't have been used in an earlier post.

Audience targeting

25countries per post

Limit a post by minimum age and country, or tilt the feed toward an age range, gender, or relationship status.

Scheduling and limits

300API calls per 5 minutes per profile

Schedule through Ayrshare for any date, or hand the post to Meta Business Suite with scheduledPublishDate, 10 minutes to 29 days out. The 300-call limit is Ayrshare's.

Beyond the basic post

Publish reels with a cover and a collaborator

Set the reels flag on a video post. Add a title, a cover image, and one collaborator Page, which Facebook invites after the reel publishes.

Skip the setup

Why Use Ayrshare Instead of the Facebook API Directly?

Ayrshare runs the Meta app, so your product sends one request and gets back the Facebook post ID and URL. Ayrshare handles the Page linking flow, media upload, link previews, reels processing, and token renewal. When Meta retires a Graph API version or changes a field, the fix ships on our side, not in your sprint.

For a step-by-step walkthrough, read How to Post to a Facebook Page with an API.

See the Facebook Publishing Options
  1. Step 1

    One simple endpoint

    Send one POST request with your post, media URL, and the user's Profile-Key. We do the maintenance, Meta's app audits, and policy enforcement that keep it working.

  2. Step 2

    We deal with Meta

    OAuth tokens, token refresh, media upload, link previews, and reels processing. All data is encrypted at rest and in transit.

  3. Live

    Your data comes back

    Get the live post URL and ID right away, then use the same id to pull the post's analytics and comments, boost it, or edit it.

After you publish

Beyond Posting: The Rest of the Facebook Lifecycle

Facebook is where Ayrshare covers the most ground. Everything below runs through the same Page connection as posting.

Facebook Page analytics (Page likes, reach, reactions, video views) beside a Messenger conversation with an auto-reply and a Page review with a reply box

Analytics

Post and Page metrics in the same JSON shape as every other network. Meta updates them about once a day.

Analytics API

Comments and reviews

Read up to the 1,000 most recent comments on a post, reply with text or an image, and delete. Read and reply to Page ratings and reviews too.

Engagement API

Messages

Read and send Facebook Messenger conversations for each Page, with auto-responses and webhooks for new messages.

Messaging API

Boosted ads

Boost a Page post into an ad with goals, budgets, targeting, and daily insights.

Ads API docs

History

Pull a Page's past posts and stories with metrics, including posts published outside Ayrshare, filtered by date.

History API

Not available on Facebook: posting to personal profiles or groups, and story analytics, which Meta doesn't provide. See every network you can reach with the same integration on the supported networks page.

Common questions

FAQs About the Facebook API

Yes, you can post to Facebook through an API. Ayrshare's Facebook API lets developers publish posts, photos, videos, reels, and stories to Facebook Pages via a single REST endpoint. It supports scheduled posts, audience targeting, comments, Messenger, reviews, boosted ads, and analytics across 14+ social networks through one integration. Start with the Facebook publishing options.

The Facebook API is free to call, since Meta doesn't charge per request for the Graph API. Going direct costs you setup and upkeep instead: App Review, Business Verification, a yearly Data Use Checkup, and Graph API version upgrades. Ayrshare's plans include Facebook Page posting on Ayrshare's approved Meta app, so you can start posting without waiting on review. Compare Ayrshare plans.

To get access to the Facebook API, create a Meta developer app, request the Page permissions you need, complete Business Verification, and pass App Review for Advanced Access. Reviews usually take one to three weeks. With Ayrshare, your users link their Pages through Ayrshare's approved app, and the Post API reference shows the one request you need.

The Facebook API requires pages_manage_posts to publish to a Page, and Meta only grants it together with pages_read_engagement and pages_show_list. Comments, Messenger, and insights each need their own permissions on top. Ayrshare's app already holds all of them, so your users approve one linking screen. See how Ayrshare links your users' accounts.

Yes, you can schedule Facebook posts with an API in two ways. Pass a scheduleDate in ISO 8601 UTC and Ayrshare publishes at that time, for any date. Or pass scheduledPublishDate, 10 minutes to 29 days out, to place the post in Meta Business Suite. The tutorial How to Post to a Facebook Page with an API walks through both.

Yes, you get Facebook Page analytics and comments through the same API and the same Page connection you post with. Post analytics cover reactions, comments, shares, and views. Page analytics need at least 100 likes and refresh about daily. The comments endpoint replies on any Page post, even ones not published through Ayrshare. See the Analytics API.

Your Users Are on Facebook. Your Product Can Be Too.

Get an API key, publish your first Facebook Page post, and turn on the other networks with the same call when you need them.