Facebook API
Access Facebook pages, groups, albums, posts, comments, search, Marketplace and media.
Base URL https://api.socialapis.io. Every call needs your API key in the x-api-token header.
Pages
Get Page ID
Get Facebook page id
Endpoint
GET /facebook/pages/id
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook page URL |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/pages/id?link=https%3A%2F%2Fwww.facebook.com%2Fnike' \
--header 'x-api-token: YOUR_API_KEY'
Get Page Details
Get Facebook page details.
Endpoint
GET /facebook/pages/details
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook page URL |
| exact_followers_count | boolean | No | When true, performs a deeper scrape to return the exact follower count (e.g. 38_493_217 instead of '38M'). Default: false. Pricing: charges 5 credits when true, 1 credit otherwise. |
| page_section | string | No | Which section to return. default: the page's standard details. about: details read from the page's About tab. work_and_education: the standard details plus the profile's work and education history (work_and_education.work, .college, .high_school; each entry has title, organization, period, location and description). Default: default. |
Pricing
Per call: 1 credit; 5 credits when exact_followers_count=true.
1 credit per call by default; 5 credits when exact_followers_count=true (deeper scrape to resolve exact follower count instead of the rounded display value).
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/pages/details?link=https%3A%2F%2Fwww.facebook.com%2Fnike' \
--header 'x-api-token: YOUR_API_KEY'
Example Response
{
"page_id": "15087023444",
"name": "Nike",
"username": "nike",
"followers_count": 38500000,
"verified": true,
"category": "Sports & Recreation",
"website": "http://www.nike.com",
"description": "Just Do It",
"cover_image": "https://scontent.xx.fbcdn.net/v/…"
}
cover_image is the page's or profile's cover photo in full resolution. website is the page's own website: social or photo-sharing profiles listed among its links (Instagram, Flickr, TikTok, …) are skipped.
Work & education (page_section=work_and_education)
Adds a work_and_education object with the history listed on a profile's About → Work and education tab. Each entry has the role (title), the organization (name, Facebook id, url, type, logo), the period, the location and the description the person wrote. Empty sections are []; work_and_education is null if the tab couldn't be read.
curl --request GET \
--url 'https://api.socialapis.io/facebook/pages/details?link=https%3A%2F%2Fwww.facebook.com%2Fsmwahidun&page_section=work_and_education' \
--header 'x-api-token: YOUR_API_KEY'
"work_and_education": {
"work": [
{
"title": "Head Of Marketing at Pine Ridge Education & Immigration",
"organization": {
"name": "Pine Ridge Education & Immigration",
"id": "1313625248506065",
"url": "https://www.facebook.com/Pine-Ridge-Education-Immigration-1313625248506065/",
"type": "Page",
"logo": "https://scontent.xx.fbcdn.net/v/…"
},
"period": "20 August 2023 - Present",
"location": "Dhaka, Bangladesh",
"description": "…",
"details": []
}
],
"college": [],
"high_school": []
}
Get Page Posts
Get Facebook page posts.
Endpoint
GET /facebook/pages/posts
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook page URL from which to extract posts |
| limit | number | No | Maximum number of posts to return. Default: 3. Minimum: 3. Maximum: 9. |
| end_cursor | string | No | Cursor for pagination to retrieve the next set of posts |
| after_time | string | No | Only include posts published after this timestamp (ISO 8601 format) |
| before_time | string | No | Only include posts published before this timestamp (ISO 8601 format) |
| timezone | string | No | Timezone used for formatting post timestamps (e.g., 'UTC', 'America/New_York') |
Pricing
Per call: 1 credit; round(limit ÷ 3) credits when limit is set, up to 3.
round(limit / 3) credits per call when limit is above 3, minimum 1: limit 3-4 = 1 credit, 5-7 = 2, 8-9 = 3.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/pages/posts?link=https%3A%2F%2Ffacebook.com%2Fnike&after_time=2025-01-01' \
--header 'x-api-token: YOUR_API_KEY'
Example Response
{
"posts": [
{
"post_id": "123456789",
"text": "Just Do It ✓",
"created_time": "2025-01-15T10:30:00Z",
"likes": 15000,
"comments": 500,
"shares": 200,
"media": [
{
"type": "image",
"url": "https://..."
}
]
}
],
"pagination": {
"next_cursor": "abc123"
}
}
Get Page Reels
Get Facebook page reels
Endpoint
GET /facebook/pages/reels
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook page URL |
| end_cursor | string | No | Cursor for pagination to retrieve the next set of posts |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/pages/reels?link=https%3A%2F%2Fwww.facebook.com%2Fnike' \
--header 'x-api-token: YOUR_API_KEY'
Get Page Videos
Get Facebook page videos
Endpoint
GET /facebook/pages/videos
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook page URL |
| end_cursor | string | No | Cursor for pagination to retrieve the next set of posts |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/pages/videos?link=https%3A%2F%2Fwww.facebook.com%2Fnike' \
--header 'x-api-token: YOUR_API_KEY'
Get Page Albums
List the photo albums of a Facebook page (album_id, album_title, url, thumbnail_uri, album_items_count). Use the album_id with /facebook/albums/items to get the photos.
Endpoint
GET /facebook/pages/albums
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| profile_id | string | Yes | Facebook page ID (get it from /facebook/pages/id) |
| limit | number | No | Number of albums to return. Default: 8. Minimum: 8. Maximum: 16. |
| end_cursor | string | No | Cursor for pagination to retrieve the next set of albums |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/pages/albums?profile_id=100044395330646' \
--header 'x-api-token: YOUR_API_KEY'
Groups
Get Group ID
Retrieve the Facebook Group ID from a public group link.
Endpoint
GET /facebook/groups/id
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook group URL |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/groups/id?link=YOUR_GROUP_URL' \
--header 'x-api-token: YOUR_API_KEY'
Get Group Details
Get detailed metadata and statistics about a Facebook group including member count, description, and rules.
Endpoint
GET /facebook/groups/details
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook group URL |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/groups/details?link=YOUR_GROUP_URL' \
--header 'x-api-token: YOUR_API_KEY'
Get Group Posts
Fetch recent posts from a Facebook group, including text, media, reactions, and comments.
Endpoint
GET /facebook/groups/posts
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook group URL |
| limit | number | No | Maximum number of posts to return. Default: 3. Minimum: 3. Maximum: 9. |
| end_cursor | string | No | Cursor for pagination to retrieve the next set of posts |
| after_time | string | No | Return posts published after this timestamp (ISO 8601 or Unix) |
| before_time | string | No | Return posts published before this timestamp (ISO 8601 or Unix) |
| timezone | string | No | Timezone for returned timestamps, e.g., UTC |
Pricing
Per call: 1 credit; round(limit ÷ 3) credits when limit is set, up to 3.
round(limit / 3) credits per call when limit is above 3, minimum 1: limit 3-4 = 1 credit, 5-7 = 2, 8-9 = 3.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/groups/posts?link=YOUR_GROUP_URL' \
--header 'x-api-token: YOUR_API_KEY'
Get Group Videos
Get videos from a Facebook group with pagination.
Endpoint
GET /facebook/groups/videos
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook group URL |
| end_cursor | string | No | Cursor for pagination to retrieve the next set of videos |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/groups/videos?link=YOUR_GROUP_URL' \
--header 'x-api-token: YOUR_API_KEY'
Get Group Albums
List the photo albums of a Facebook group (album_id, album_title, url, thumbnail_uri, photos_count, videos_count). Use the album_id with /facebook/albums/items to get the photos.
Endpoint
GET /facebook/groups/albums
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| group_id | string | Yes | Facebook group ID (get it from /facebook/groups/id) |
| limit | number | No | Number of albums to return. Default: 8. Minimum: 8. Maximum: 16. |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/groups/albums?group_id=YOUR_GROUP_ID' \
--header 'x-api-token: YOUR_API_KEY'
Albums
Get Album Items
Get the photos and videos inside a Facebook album, from a page or a group. Takes the album id returned by /facebook/pages/albums or /facebook/groups/albums.
Endpoint
GET /facebook/albums/items
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| album_id | string | Yes | Album ID from /facebook/pages/albums or /facebook/groups/albums |
| end_cursor | string | No | Cursor for pagination to retrieve the next set of items |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/albums/items?album_id=826298618859975' \
--header 'x-api-token: YOUR_API_KEY'
Posts and comments
Get Post ID
Extract the Facebook post ID from a given post link.
Endpoint
GET /facebook/posts/id
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook post URL |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/posts/id?link=YOUR_POST_URL' \
--header 'x-api-token: YOUR_API_KEY'
Get Post Details
Get detailed data about a Facebook post including reactions, media, and user info.
Endpoint
GET /facebook/posts/details
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook post URL |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/posts/details?link=YOUR_POST_URL' \
--header 'x-api-token: YOUR_API_KEY'
Get Post Details (Extended)
Get extended details about a Facebook post including views, video URLs, music info, and author verification.
Endpoint
GET /facebook/posts/details/extended
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook post URL |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/posts/details/extended?link=YOUR_POST_URL' \
--header 'x-api-token: YOUR_API_KEY'
Get Post Attachments
Get details of all media attachments for a given Facebook post.
Endpoint
GET /facebook/posts/attachments
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| post_id | string | Yes | Facebook post ID |
Pricing
Per call: 5 credits.
5 credits per call (deeper scrape than the standard post-details endpoint).
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/posts/attachments?post_id=YOUR_POST_ID' \
--header 'x-api-token: YOUR_API_KEY'
Get Video Details
Retrieve video metadata, feedback stats, and post context for a Facebook video post.
Endpoint
GET /facebook/posts/video
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| video_id | string | Yes | Facebook video ID |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/posts/video?video_id=YOUR_VIDEO_ID' \
--header 'x-api-token: YOUR_API_KEY'
Get Post Comments
Retrieve top-level comments from a Facebook post or reel.
Endpoint
GET /facebook/posts/comments
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| link | string | Yes | Facebook post or reel URL |
| end_cursor | string | No | Pagination cursor to retrieve the next page of comments |
| include_reply_info | boolean | No | When true, includes comment_feedback_id and expansion_token in each comment. These are required to fetch replies via the /facebook/posts/comments/replies endpoint. |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/posts/comments?link=YOUR_POST_URL' \
--header 'x-api-token: YOUR_API_KEY'
Get Comment Replies
Fetch replies to a specific comment on a Facebook post. Requires comment_feedback_id and expansion_token obtained from the /facebook/posts/comments endpoint with include_reply_info=true.
Endpoint
GET /facebook/posts/comments/replies
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| comment_feedback_id | string | Yes | The feedback ID of the parent comment. Obtained from the comments endpoint with include_reply_info=true. |
| expansion_token | string | Yes | Pagination token for loading replies. Obtained from the comments endpoint with include_reply_info=true. |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/posts/comments/replies?comment_feedback_id=YOUR_COMMENT_FEEDBACK_ID&expansion_token=YOUR_EXPANSION_TOKEN' \
--header 'x-api-token: YOUR_API_KEY'
Search
Search Pages
Search for Facebook pages by keyword with optional location filtering.
Endpoint
GET /facebook/search/pages
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Search query |
| location_uid | string | No | Location UID for filtering. Obtain from the /facebook/search/locations endpoint. |
| end_cursor | string | No | Pagination cursor to retrieve the next page of results |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/search/pages?query=coffee' \
--header 'x-api-token: YOUR_API_KEY'
Search People
Search for Facebook people/profiles by keyword with optional location filtering.
Endpoint
GET /facebook/search/people
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Search query |
| location_uid | string | No | Location UID for filtering. Obtain from the /facebook/search/locations endpoint. |
| end_cursor | string | No | Pagination cursor to retrieve the next page of results |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/search/people?query=coffee' \
--header 'x-api-token: YOUR_API_KEY'
Search Locations
Search for Facebook locations by keyword. Returns location UIDs that can be used to filter other search endpoints.
Endpoint
GET /facebook/search/locations
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Search query (city, place, landmark, etc.) |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/search/locations?query=coffee' \
--header 'x-api-token: YOUR_API_KEY'
Search Posts
Search for Facebook posts by keyword with optional location and time filters.
Endpoint
GET /facebook/search/posts
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Search query |
| location_uid | string | No | Location UID for filtering. Obtain from the /facebook/search/locations endpoint. |
| start_time | string | No | Filter posts after this date (YYYY-MM-DD) |
| end_time | string | No | Filter posts before this date (YYYY-MM-DD) |
| recent_posts | boolean | No | When true, shows only recent posts |
| end_cursor | string | No | Pagination cursor to retrieve the next page of results |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/search/posts?query=coffee' \
--header 'x-api-token: YOUR_API_KEY'
Search Videos
Search for Facebook videos by keyword with optional recency and live filters.
Endpoint
GET /facebook/search/videos
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Search query |
| most_recent | boolean | No | When true, shows most recent videos first |
| videos_live | boolean | No | When true, filters for live videos only |
| fields | string | No | Comma-separated list of keys to include in the response. Supports dot notation. |
| end_cursor | string | No | Pagination cursor to retrieve the next page of results |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/search/videos?query=coffee' \
--header 'x-api-token: YOUR_API_KEY'
Marketplace
Search Marketplace
Search Facebook Marketplace items with filters for location, price, category, condition, and more.
Endpoint
GET /facebook/marketplace/search
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | No | Search term |
| category_url | string | No | Category URL slug |
| proxy_country | string | No | Optional premium proxy country |
| commerce_search_sort_by | string | No | Sort: BEST_MATCH, CREATION_TIME_DESCEND, PRICE_ASCEND, etc. |
| commerce_search_and_rp_condition | string | No | Condition filter: new, used_like_new, used_good, used_fair |
| filter_location_latitude | string | No | GPS latitude coordinate |
| filter_location_longitude | string | No | GPS longitude coordinate |
| filter_price_lower_bound | number | No | Minimum price |
| filter_price_upper_bound | number | No | Maximum price |
| filter_radius_km | number | No | Search radius in km |
| posted_today | boolean | No | Limit to items posted today |
| exact_match | boolean | No | Exact match search |
| end_cursor | string | No | Pagination cursor |
| fields | string | No | Comma-separated keys to include (e.g. 'items.id,items.title,page_info.end_cursor'). Invalid keys are ignored. |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/marketplace/search' \
--header 'x-api-token: YOUR_API_KEY'
Get Listing Details
Get detailed info about a single Marketplace listing.
Endpoint
GET /facebook/marketplace/listing
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| listing_id | string | Yes | Marketplace Listing ID |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/marketplace/listing?listing_id=YOUR_LISTING_ID' \
--header 'x-api-token: YOUR_API_KEY'
Get Seller Details
Get seller profile, ratings, reviews, and badges.
Endpoint
GET /facebook/marketplace/seller
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| seller_id | string | Yes | Seller ID |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/marketplace/seller?seller_id=YOUR_SELLER_ID' \
--header 'x-api-token: YOUR_API_KEY'
List Marketplace Categories
Get all Marketplace categories with seo_url and category ID values.
Endpoint
GET /facebook/marketplace/categories
Parameters
None.
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/marketplace/categories' \
--header 'x-api-token: YOUR_API_KEY'
Get City Coordinates
Get GPS coordinates for a city to use as Marketplace location filters.
Endpoint
GET /facebook/marketplace/city-coordinates
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| city | string | Yes | City name |
| country | string | No | Country name or code |
| exactly_one | boolean | No | Return exactly one result |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/marketplace/city-coordinates?city=Paris' \
--header 'x-api-token: YOUR_API_KEY'
Search Vehicles
Search Marketplace vehicle listings with filters for location, price, mileage, year, and more.
Endpoint
GET /facebook/marketplace/vehicles
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| sort_by | string | No | Sort: CREATION_TIME_DESCEND, PRICE_ASCEND, VEHICLE_MILEAGE_ASCEND, VEHICLE_YEAR_ASCEND, etc. |
| filter_location_latitude | string | No | GPS latitude |
| filter_location_longitude | string | No | GPS longitude |
| filter_price_lower_bound | number | No | Minimum price |
| filter_price_upper_bound | number | No | Maximum price |
| filter_radius_km | number | No | Radius in km |
| is_c2c_listing_only | boolean | No | Individual sellers only |
| exact_match | boolean | No | Exact match search |
| end_cursor | string | No | Pagination cursor |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/marketplace/vehicles' \
--header 'x-api-token: YOUR_API_KEY'
Search Rentals
Search Marketplace rental property listings with filters for bedrooms, bathrooms, location, and price.
Endpoint
GET /facebook/marketplace/rentals
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| sort_by | string | No | Sort: CREATION_TIME_DESCEND, PRICE_ASCEND, BEST_MATCH, etc. |
| filter_location_latitude | string | No | GPS latitude |
| filter_location_longitude | string | No | GPS longitude |
| filter_price_lower_bound | number | No | Minimum price |
| filter_price_upper_bound | number | No | Maximum price |
| filter_radius_km | number | No | Radius in km |
| filter_bedrooms_min | number | No | Min bedrooms |
| filter_bedrooms_max | number | No | Max bedrooms |
| filter_bathrooms_min | number | No | Min bathrooms |
| filter_bathrooms_max | number | No | Max bathrooms |
| is_c2c_listing_only | boolean | No | Individual sellers only |
| end_cursor | string | No | Pagination cursor |
Pricing
Per call: 1 credit.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/marketplace/rentals' \
--header 'x-api-token: YOUR_API_KEY'
Media download
Download Media
Download media (images, videos, audio) from Facebook URLs.
Endpoint
GET /facebook/media/download
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Facebook media URL to download |
Pricing
Per call: 1 credit; up to 100 credits per call depending on the result.
1 credit per MB of the file (rounded up), minimum 1, up to 100 credits (files up to 100 MB). The price is known after the download; if your balance is lower, only what is left is charged.
Example Request
curl --request GET \
--url 'https://api.socialapis.io/facebook/media/download?url=YOUR_URL' \
--header 'x-api-token: YOUR_API_KEY'
Verifying what you were charged
Every paid response carries an X-SocialAPIs-Credits-Deducted header with the exact credit amount charged for that request. Variable-priced endpoints (page and group posts, media download) report the resolved amount here, so you can reconcile usage without checking the dashboard. Prices on this page come from the live endpoint catalog when the docs were built; socialapis.io/openapi.json always has the current ones.