Skip to main content

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​

NameTypeRequiredDescription
linkstringYesFacebook 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​

NameTypeRequiredDescription
linkstringYesFacebook page URL
exact_followers_countbooleanNoWhen 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_sectionstringNoWhich 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​

NameTypeRequiredDescription
linkstringYesFacebook page URL from which to extract posts
limitnumberNoMaximum number of posts to return. Default: 3. Minimum: 3. Maximum: 9.
end_cursorstringNoCursor for pagination to retrieve the next set of posts
after_timestringNoOnly include posts published after this timestamp (ISO 8601 format)
before_timestringNoOnly include posts published before this timestamp (ISO 8601 format)
timezonestringNoTimezone 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​

NameTypeRequiredDescription
linkstringYesFacebook page URL
end_cursorstringNoCursor 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​

NameTypeRequiredDescription
linkstringYesFacebook page URL
end_cursorstringNoCursor 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​

NameTypeRequiredDescription
profile_idstringYesFacebook page ID (get it from /facebook/pages/id)
limitnumberNoNumber of albums to return. Default: 8. Minimum: 8. Maximum: 16.
end_cursorstringNoCursor 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​

NameTypeRequiredDescription
linkstringYesFacebook 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​

NameTypeRequiredDescription
linkstringYesFacebook 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​

NameTypeRequiredDescription
linkstringYesFacebook group URL
limitnumberNoMaximum number of posts to return. Default: 3. Minimum: 3. Maximum: 9.
end_cursorstringNoCursor for pagination to retrieve the next set of posts
after_timestringNoReturn posts published after this timestamp (ISO 8601 or Unix)
before_timestringNoReturn posts published before this timestamp (ISO 8601 or Unix)
timezonestringNoTimezone 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​

NameTypeRequiredDescription
linkstringYesFacebook group URL
end_cursorstringNoCursor 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​

NameTypeRequiredDescription
group_idstringYesFacebook group ID (get it from /facebook/groups/id)
limitnumberNoNumber 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​

NameTypeRequiredDescription
album_idstringYesAlbum ID from /facebook/pages/albums or /facebook/groups/albums
end_cursorstringNoCursor 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​

NameTypeRequiredDescription
linkstringYesFacebook 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​

NameTypeRequiredDescription
linkstringYesFacebook 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​

NameTypeRequiredDescription
linkstringYesFacebook 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​

NameTypeRequiredDescription
post_idstringYesFacebook 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​

NameTypeRequiredDescription
video_idstringYesFacebook 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​

NameTypeRequiredDescription
linkstringYesFacebook post or reel URL
end_cursorstringNoPagination cursor to retrieve the next page of comments
include_reply_infobooleanNoWhen 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​

NameTypeRequiredDescription
comment_feedback_idstringYesThe feedback ID of the parent comment. Obtained from the comments endpoint with include_reply_info=true.
expansion_tokenstringYesPagination 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 Pages​

Search for Facebook pages by keyword with optional location filtering.

Endpoint​

GET /facebook/search/pages

Parameters​

NameTypeRequiredDescription
querystringYesSearch query
location_uidstringNoLocation UID for filtering. Obtain from the /facebook/search/locations endpoint.
end_cursorstringNoPagination 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​

NameTypeRequiredDescription
querystringYesSearch query
location_uidstringNoLocation UID for filtering. Obtain from the /facebook/search/locations endpoint.
end_cursorstringNoPagination 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​

NameTypeRequiredDescription
querystringYesSearch 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​

NameTypeRequiredDescription
querystringYesSearch query
location_uidstringNoLocation UID for filtering. Obtain from the /facebook/search/locations endpoint.
start_timestringNoFilter posts after this date (YYYY-MM-DD)
end_timestringNoFilter posts before this date (YYYY-MM-DD)
recent_postsbooleanNoWhen true, shows only recent posts
end_cursorstringNoPagination 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​

NameTypeRequiredDescription
querystringYesSearch query
most_recentbooleanNoWhen true, shows most recent videos first
videos_livebooleanNoWhen true, filters for live videos only
fieldsstringNoComma-separated list of keys to include in the response. Supports dot notation.
end_cursorstringNoPagination 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​

NameTypeRequiredDescription
querystringNoSearch term
category_urlstringNoCategory URL slug
proxy_countrystringNoOptional premium proxy country
commerce_search_sort_bystringNoSort: BEST_MATCH, CREATION_TIME_DESCEND, PRICE_ASCEND, etc.
commerce_search_and_rp_conditionstringNoCondition filter: new, used_like_new, used_good, used_fair
filter_location_latitudestringNoGPS latitude coordinate
filter_location_longitudestringNoGPS longitude coordinate
filter_price_lower_boundnumberNoMinimum price
filter_price_upper_boundnumberNoMaximum price
filter_radius_kmnumberNoSearch radius in km
posted_todaybooleanNoLimit to items posted today
exact_matchbooleanNoExact match search
end_cursorstringNoPagination cursor
fieldsstringNoComma-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​

NameTypeRequiredDescription
listing_idstringYesMarketplace 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​

NameTypeRequiredDescription
seller_idstringYesSeller 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​

NameTypeRequiredDescription
citystringYesCity name
countrystringNoCountry name or code
exactly_onebooleanNoReturn 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​

NameTypeRequiredDescription
sort_bystringNoSort: CREATION_TIME_DESCEND, PRICE_ASCEND, VEHICLE_MILEAGE_ASCEND, VEHICLE_YEAR_ASCEND, etc.
filter_location_latitudestringNoGPS latitude
filter_location_longitudestringNoGPS longitude
filter_price_lower_boundnumberNoMinimum price
filter_price_upper_boundnumberNoMaximum price
filter_radius_kmnumberNoRadius in km
is_c2c_listing_onlybooleanNoIndividual sellers only
exact_matchbooleanNoExact match search
end_cursorstringNoPagination 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​

NameTypeRequiredDescription
sort_bystringNoSort: CREATION_TIME_DESCEND, PRICE_ASCEND, BEST_MATCH, etc.
filter_location_latitudestringNoGPS latitude
filter_location_longitudestringNoGPS longitude
filter_price_lower_boundnumberNoMinimum price
filter_price_upper_boundnumberNoMaximum price
filter_radius_kmnumberNoRadius in km
filter_bedrooms_minnumberNoMin bedrooms
filter_bedrooms_maxnumberNoMax bedrooms
filter_bathrooms_minnumberNoMin bathrooms
filter_bathrooms_maxnumberNoMax bathrooms
is_c2c_listing_onlybooleanNoIndividual sellers only
end_cursorstringNoPagination 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​

NameTypeRequiredDescription
urlstringYesFacebook 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.