Facebook Pages API
Latest: v1.0.0
First release
Facebook Pages API (SocialAPIs)
Public Facebook page and post data as JSON: one API key, no Meta developer app, no OAuth, no page access token.
- Website: https://socialapis.io · this API: https://socialapis.io/api-sources/facebook-page-details
- Free API key: https://socialapis.io/auth/signup (200 credits a month, no card)
- Free follower count lookup, no signup: https://socialapis.io/tools/facebook-follower-count
- Every parameter: references/endpoints.md · OpenAPI: https://socialapis.io/openapi.json · llms.txt: https://socialapis.io/llms.txt
Setup
- The user needs an API key from https://socialapis.io/dashboard.
- Read it from the environment,
SOCIALAPIS_API_KEY. Never hard-code it, print it, or ask the user to paste it into the chat. If it is missing, tell the user to set it. - Send it in the
x-api-tokenheader, never in the URL.
If SocialAPIs MCP tools are available in this session (facebook_page, facebook_ads, instagram_profile, …), use them instead of raw HTTP. Hosted MCP server: https://mcp.socialapis.io/mcp.
Making a call
curl -s -H "x-api-token: $SOCIALAPIS_API_KEY" \
"https://api.socialapis.io/facebook/pages/details?link=https://www.facebook.com/nike"
import os, requests
r = requests.get(
"https://api.socialapis.io/facebook/pages/details",
params={"link": "https://www.facebook.com/nike"},
headers={"x-api-token": os.environ["SOCIALAPIS_API_KEY"]},
timeout=120,
)
r.raise_for_status()
data = r.json()
SDKs: Python pip install socialapis-sdk, JavaScript npm install socialapis-sdk, PHP composer require socialapishub/socialapis.
Endpoints
All GET, base URL https://api.socialapis.io. Each link opens the endpoint's page with a live example.
| Endpoint | What it returns | Credits |
|---|---|---|
/facebook/pages/id | Resolve a Facebook page URL to its numeric page ID. | 1 credit per call |
/facebook/pages/details | Get a Facebook page's profile: name, category, follower and like counts, bio, contact info (email, phone, website, address), rating and the ad_page_id used by the Ads Library tools. | 1 credit per call; 5 credits when exact_followers_count=true |
/facebook/pages/posts | List a Facebook page's recent posts, newest first, with text, media, reactions, comment and share counts. | ceil(posts_returned / 3) credits per call, minimum 1 |
/facebook/pages/reels | List a Facebook page's reels (short-form videos). | 1 credit per call |
/facebook/pages/videos | List videos uploaded to a Facebook page, with video_id, title, duration, view count and thumbnail. | 1 credit per call |
/facebook/pages/albums | List the photo albums of a Facebook page, with album_id, album_title, url, thumbnail_uri and album_items_count (text, e.g. | 1 credit per call |
/facebook/posts/id | Extract the numeric post ID from a Facebook post URL. | 1 credit per call |
/facebook/posts/details | Get a Facebook post's text, author, timestamp, media, and reaction, comment and share counts. | 1 credit per call |
/facebook/posts/details/extended | Get everything /facebook/posts/details returns plus view counts, HD/SD video URLs, music/audio metadata and author verification status. | 1 credit per call |
/facebook/posts/attachments | List every media attachment (images and videos, with URLs and dimensions) on a Facebook post, including all items in multi-photo posts. | 5 credits per call (deeper scrape than standard post details) |
/facebook/posts/video | Get a Facebook video post's metadata: title, message text and hashtags, owner, reactions and view count. | 1 credit per call |
/facebook/posts/comments | List top-level comments on a Facebook post or reel, with author, text, timestamp and reaction count. | 1 credit per call |
/facebook/posts/comments/replies | List replies to one Facebook comment. | 1 credit per call |
/facebook/albums/items | Get the photos and videos inside a Facebook album (from a page or a group): media_id, media_type, url, thumbnail_uri and timestamp (Unix seconds). | 1 credit per call |
/facebook/search/pages | Find Facebook pages by keyword (brand, business or topic name), optionally near a location. | 1 credit per call |
/facebook/search/people | Find public Facebook profiles by name or keyword, optionally near a location (location_uid from /facebook/search/locations). | 1 credit per call |
/facebook/search/locations | Look up Facebook places by name (city, region, venue) and get their location_uid. | 1 credit per call |
/facebook/search/posts | Search public Facebook posts by keyword, optionally filtered by location (location_uid from /facebook/search/locations) and date range. | 1 credit per call |
/facebook/search/videos | Search public Facebook videos by keyword, optionally most recent first or live videos only. | 1 credit per call |
/facebook/media/download | Resolve a Facebook media URL (image, video or audio, e.g. | 1 credit per call |
Things that matter
- Have a page name but no URL?
/facebook/search/pages?query=<name>first, then use the returned link. /facebook/pages/postsreturns 3 to 9 posts per call and costs one credit per 3 posts returned; page withend_cursor, filter by date withafter_time/before_time.- Views, video URLs and audio of a reel or video post come from
/facebook/posts/details/extended, not/facebook/posts/details. - Credits: the response headers
X-SocialAPIs-Credits-DeductedandX-SocialAPIs-Credits-Remainingsay what a call cost. Before a large batch, check/usage(free) and tell the user roughly what it will cost. - Pagination: list endpoints return a page plus
end_cursor; pass it back asend_cursoruntil it is missing or the user has enough. - Slow calls: a call can take up to about 90 seconds. Use a timeout of at least 120 s and don't fire hundreds of calls in parallel (
/usage/limitsshows the plan's rate limit). - Errors:
401bad or missing key ·403out of credits or account paused ·429rate limit, retry with backoff ·502/504the source failed or timed out, retry once later. Failed calls are not charged.
Other SocialAPIs skills: facebook-ads-library-api (Meta Ads Library), facebook-marketplace-api (Facebook Marketplace), facebook-groups-api (public Facebook groups), instagram-api (Instagram), and socialapis for every endpoint at once.
