# Facebook Scraper API by SocialScrape (`socialscrape/facebook-scraper-api`) Actor

Scrape Facebook pages, posts, reels, comments, groups, events, Marketplace listings, video transcripts and the Ad Library as JSON. 23 endpoints in one actor, with the same field names on every platform. Pay per result: no API key and no other account needed.

- **URL**: https://apify.com/socialscrape/facebook-scraper-api.md
- **Developed by:** [SocialScrape](https://apify.com/socialscrape) (community)
- **Categories:** Social media, Developer tools
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 86.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does Facebook Scraper API do?

**Facebook Scraper API by SocialScrape** gets Facebook data as JSON: pages and profiles, posts, reels, photos, comments and replies, groups, events, Marketplace listings, video transcripts and the Ad Library. It has 23 endpoints in one actor: pick one, fill in what it needs, and every result becomes a row in the dataset. You pay per result, and there is no API key to bring and no other account to create.

- **No key, no account.** The actor runs on SocialScrape's own API access, so the price on this page is the whole price.
- **You pay for results.** One row in the dataset is one result. A request that fails or finds nothing adds no row and costs nothing.
- **One shape on every platform.** SocialScrape returns profiles, posts, comments and transcripts with the same field names on every platform, so one parser covers them all.
- **Nothing to maintain.** There are no scrapers to run and nothing to patch when Facebook changes. The actor makes plain API calls, so a single request finishes in seconds.
- **Everything Apify adds.** Schedule runs, call the actor from the Apify API, send rows to other tools through integrations, and export the dataset as JSON, CSV or Excel.

The same data is available directly through the [SocialScrape API](https://socialscrape.dev/facebook-api?utm_source=apify.com\&utm_medium=directory\&utm_campaign=listing), for when you would rather call it from your own code: [API docs](https://socialscrape.dev/docs) | [Pricing](https://socialscrape.dev/pricing)

### What Facebook data can you get?

| Endpoint | `endpoint` value | Needs | One result is |
|---|---|---|---|
| Ad Library search | `ad_library.search` | `query` | An ad |
| Ad Library ads by page | `ad_library.company.ads` | `id` or `company_name` | An ad |
| Ad Library ad details | `ad_library.ad` | `id` or `url` | An ad |
| Ad Library ad transcript | `ad_library.ad.transcript` | `id` or `url` | A transcript |
| Ad Library advertiser search | `ad_library.search.companies` | `query` | An advertiser |
| Profile or page | `profile` | `url` | A profile |
| Profile posts | `profile.posts` | `url` or `id` | A post |
| Profile reels | `profile.reels` | `url` | A post |
| Profile photos | `profile.photos` | `url` | A post |
| Page events | `profile.events` | `url` | An event |
| Video search | `search.videos` | `query` | A post |
| Post details | `post` | `url` | A post |
| Video transcript | `post.transcript` | `url` | A transcript |
| Post comments | `post.comments` | `feedback_id` or `url` | A comment |
| Comment replies | `post.comment.replies` | `feedback_id` or `url` | A comment |
| Public group | `group` | `url` or `id` | A community |
| Public group posts | `group.posts` | `url` or `id` | A post |
| Marketplace location search | `marketplace.location.search` | `query` | A location |
| Marketplace search | `marketplace.search` | `lat` or `location` | A product |
| Marketplace listing | `marketplace.item` | `url` or `id` | A product |
| Events search | `events.search` | `query` | An event |
| City events | `events` | `url` | An event |
| Event details | `event` | `url` or `id` | An event |

### How to use Facebook Scraper API

1. Pick an **Endpoint** and fill in the fields it needs. The help under each field says which endpoints use it.
2. For a list, set **Max pages** to follow the cursor, and **Max items** to stop at a number of results.
3. Click **Start**. Rows land in the dataset, and a `SUMMARY` record holds the pages and results of the run.

### How much does it cost?

This actor costs **$3.00 per 1,000 results**. A result is one row in the dataset, and the table above says what a row is for each endpoint. There is nothing else to buy: no SocialScrape key, account or subscription.

- **A request that fails or finds nothing is free.** It adds no row, so there is nothing to charge.
- **A list costs what its rows cost.** A page of 20 posts is 20 results. **Max pages** and **Max items** bound a run.
- **You set the ceiling.** **Max items** stops a run at a number of results, and the maximum charge you set for a run in Apify is honoured: the actor stops fetching when it is reached.

### Input

Every run needs `endpoint`, plus the fields that endpoint needs (the **Needs** column above). For example:

```json
{
  "endpoint": "profile",
  "url": "https://www.facebook.com/nasa"
}
```

### Output

One dataset row per result. A single object (a profile, a post) is one row, and a list is one row per item.

A `profile` run with the input above returns one row like this. This row is from a run on Apify on 2026-11-12; the signature on a picture address is cut off and `extra` is shortened here.

```json
{
  "object": "profile",
  "platform": "facebook",
  "id": "100044561550831",
  "handle": "NASA",
  "name": "NASA - National Aeronautics and Space Administration",
  "headline": null,
  "url": "https://www.facebook.com/NASA/",
  "kind": "page",
  "bio": "Explore the universe and discover our home planet. \nThere's space for everybody. ✨",
  "avatar_url": "https://scontent-det1-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png",
  "banner_url": "https://scontent-det1-1.xx.fbcdn.net/v/t39.99422-6/809146614_4484013928506139_3181913787670602881_n.png",
  "verified": true,
  "is_private": false,
  "external_url": "https://www.nasa.gov/nasa-app/",
  "links": [
    {
      "title": "nasa.gov/nasa-app",
      "url": "https://www.nasa.gov/nasa-app/"
    }
  ],
  "location": null,
  "category": "Government organization",
  "created_at": null,
  "stats": {
    "followers": 28728930,
    "following": 52,
    "posts": null,
    "likes": null,
    "views": null
  },
  "extra": {
    "page_id": "54971236771",
    "website": "https://www.nasa.gov/nasa-app/",
    "talking_about": 87586
  }
}
```

Every row carries the fields of its type, with the same names on every platform. A field the platform does not give is `null`.

| Row type | Fields |
|---|---|
| Ad | `platform`, `id`, `url`, `advertiser` (`platform`, `id`, `name`, `url`, `page_id`, `country`, `verified`, `ad_count`, `extra`), `status`, `started_at`, `ended_at`, `title`, `body`, `cta_text`, `landing_url`, `format`, `media` (`thumbnail_url`, `video_url`, `audio_url`, `image_urls`, `width`, `height`), `regions`, `publisher_platforms`, `impressions` (`lower`, `upper`, `currency`), `spend` (`lower`, `upper`, `currency`), `extra` |
| Transcript | `platform`, `video_id`, `url`, `language`, `source`, `duration_seconds`, `text`, `segments`, `available_languages`, `extra` |
| Advertiser | `platform`, `id`, `name`, `url`, `page_id`, `country`, `verified`, `ad_count`, `extra` |
| Profile | `platform`, `id`, `handle`, `name`, `headline`, `url`, `kind`, `bio`, `avatar_url`, `banner_url`, `verified`, `is_private`, `external_url`, `links`, `location`, `category`, `created_at`, `stats` (`followers`, `following`, `posts`, `likes`, `views`), `extra` |
| Post | `platform`, `id`, `url`, `type`, `author` (`id`, `handle`, `name`, `url`, `avatar_url`, `verified`), `title`, `text`, `published_at`, `duration_seconds`, `language`, `hashtags`, `mentions`, `stats` (`views`, `likes`, `comments`, `shares`, `saves`, `dislikes`), `media` (`thumbnail_url`, `video_url`, `audio_url`, `image_urls`, `width`, `height`), `song` (`id`, `title`, `artist`, `url`), `location` (`name`, `address`, `city`, `region`, `country`, `latitude`, `longitude`), `is_pinned`, `is_sponsored`, `extra` |
| Event | `platform`, `id`, `url`, `title`, `description`, `starts_at`, `ends_at`, `place` (`name`, `address`, `city`, `region`, `country`, `latitude`, `longitude`), `is_online`, `host` (`id`, `handle`, `name`, `url`, `avatar_url`, `verified`), `going_count`, `interested_count`, `cover_url`, `extra` |
| Comment | `platform`, `id`, `url`, `post_id`, `parent_id`, `author` (`id`, `handle`, `name`, `url`, `avatar_url`, `verified`), `text`, `published_at`, `stats` (`likes`, `replies`, `dislikes`), `is_pinned`, `is_by_creator`, `extra` |
| Community | `platform`, `id`, `url`, `kind`, `name`, `title`, `description`, `avatar_url`, `banner_url`, `member_count`, `online_count`, `is_nsfw`, `is_private`, `verified`, `created_at`, `extra` |
| Location | `platform`, `id`, `name`, `region`, `country`, `latitude`, `longitude`, `extra` |
| Product | `platform`, `id`, `url`, `title`, `description`, `price` (`amount`, `currency`, `original_amount`, `display`), `seller` (`id`, `handle`, `name`, `url`, `avatar_url`, `verified`), `rating`, `review_count`, `sold_count`, `image_urls`, `category`, `in_stock`, `location` (`name`, `address`, `city`, `region`, `country`, `latitude`, `longitude`), `published_at`, `extra` |

The full response reference is in the [API docs](https://socialscrape.dev/docs).

### FAQ

#### Do I need a SocialScrape account or an API key?

No. The actor calls the SocialScrape API on its own access, and you pay Apify for the results. There is no key to paste and nothing to sign up for.

#### What counts as a result?

One row in the dataset: a profile for `profile`, and the **One result is** column above for every other endpoint. A page of a list is as many results as it has items.

#### What happens when a request fails?

A failed request adds no row, so it costs nothing. When the API marks a failure as retryable the actor tries again, up to two more times. Any other failure stops the run with the error code and the request id.

#### How do I get more than one page?

Set **Max pages**, up to 500. The actor follows the cursor for that many pages. **Max items** stops the run early once enough results are in. The `SUMMARY` record holds the next cursor when there is more.

#### How do I limit what a run costs?

**Max items** stops a run at a number of results, and the maximum charge you set for a run in Apify is honoured. When the run reaches it the actor stops fetching, so you are not charged past it and nothing is fetched that you did not ask to pay for.

#### Can I get the same data without Apify?

Yes. The same endpoints are a plain HTTP API at SocialScrape, with SDKs for Python and JavaScript and an MCP server for Claude and Cursor. It is priced on its own, apart from this actor: see the [Facebook API page](https://socialscrape.dev/facebook-api?utm_source=apify.com\&utm_medium=directory\&utm_campaign=listing), the [API docs](https://socialscrape.dev/docs) and the [pricing page](https://socialscrape.dev/pricing).

#### Where do I get help?

Email hello@socialscrape.dev, or open an issue on the actor's Issues tab.

# Actor input Schema

## `endpoint` (type: `string`):

What to fetch. The fields below are shared by the endpoints; each endpoint uses only the ones it needs.

## `query` (type: `string`):

For ad_library.search: Keyword to search for. For ad_library.search.companies, search.videos, events.search: Search terms. For marketplace.location.search: City or area name. For marketplace.search: Search keyword. Required unless `category_id` is given.

## `sort` (type: `string`):

For ad_library.search, ad_library.company.ads: Changing it restarts the cursor chain (one of: relevance, impressions, newest). For post.comments: Order of results. Changing it restarts the cursor chain (one of: top, newest, oldest). For group.posts: Order of results. Changing it restarts the cursor chain (one of: chronological, top, recent_activity, chronological_listings). For marketplace.search: Order of results. Changing it restarts the cursor chain (one of: relevance, distance, newest, price_low, price_high).

## `match` (type: `string`):

Match any of the words, or the exact phrase. Used by: ad_library.search.

## `ad_type` (type: `string`):

All ads, or only political and issue ads. Used by: ad_library.search.

## `language` (type: `string`):

Only ads in this language, a 2-letter code (EN, ES, FR). Used by: ad_library.company.ads, ad_library.search.

## `status` (type: `string`):

Ad status. Used by: ad_library.company.ads, ad_library.search.

## `media_type` (type: `string`):

Creative type. `meme` is Meta's word for text on an image. Used by: ad_library.company.ads, ad_library.search.

## `start_date` (type: `string`):

Impressions window start, YYYY-MM-DD. Used by: ad_library.company.ads, ad_library.search.

## `end_date` (type: `string`):

Impressions window end, YYYY-MM-DD. Used by: ad_library.company.ads, ad_library.search.

## `region` (type: `string`):

Two-letter country code (ISO 3166-1) for results that vary by country. Used by: ad_library.company.ads, ad_library.search.

## `trim` (type: `boolean`):

Smaller response: drops null fields and `extra`.

## `raw` (type: `boolean`):

Also return the platform's original object as `raw`.

## `max_age_days` (type: `number`):

Accept a cached result fetched within this many days. It answers faster.

## `id` (type: `string`):

For ad_library.company.ads: Ad Library page id of the advertiser (from advertiser search). For ad_library.ad, ad_library.ad.transcript: Ad id in the library. For profile.posts: The profile or page id, as `profile` returns it in `id`. For group, group.posts: Numeric group id; use it instead of `url` if you have it. For marketplace.item: Listing id. For event: Event id.

## `company_name` (type: `string`):

Advertiser name (resolved to a page id). Used by: ad_library.company.ads.

## `url` (type: `string`):

For ad_library.ad, ad_library.ad.transcript: Ad Library URL (facebook.com/ads/library/?id=...). For profile, profile.posts, profile.reels, profile.photos, profile.events: Profile or page URL. For post, post.transcript, post.comments, post.comment.replies: Post, video or reel URL. For group, group.posts: Public group URL (facebook.com/groups/...). Sub-pages such as /about work too. For marketplace.item: Listing URL (facebook.com/marketplace/item/<id>). For events: City events page (facebook.com/events/explore/<city>/<id>). For event: Event URL (facebook.com/events/<id>).

## `get_transcript` (type: `boolean`):

For ad_library.ad: Accepted for compatibility. A video ad's transcript is its own call, `ad/transcript` (AI transcription, metered); this flag only adds a pointer to it in `extra.transcript_hint`. For post: Include the video's existing captions in `extra.transcript` (none if it has none; `post/transcript` also transcribes the audio with AI).

## `get_business_hours` (type: `boolean`):

Include the business hours. Used by: profile.

## `include_gated_profile` (type: `boolean`):

Return limited public fields for gated or age-restricted pages. Ignored for normal public pages. Used by: profile.

## `feedback_id` (type: `string`):

For post.comments: The post's feedback id (from `post`); using it instead of `url` makes the request much faster. For post.comment.replies: The comment's feedback id (not the comment id), from `post/comments`.

## `comment_id` (type: `string`):

Id of the parent comment. Used by: post.comment.replies.

## `expansion_token` (type: `string`):

The comment's expansion token, from `post/comments`. Used by: post.comment.replies.

## `location` (type: `string`):

City or area to search around ("Austin, TX"). Used by: events.search, marketplace.search.

## `lat` (type: `number`):

Latitude of the search centre. Used by: marketplace.search.

## `lng` (type: `number`):

Longitude of the search centre. Used by: marketplace.search.

## `category_id` (type: `string`):

Marketplace category id. Without a keyword only these browse: Antiques 393860164117441, Appliances 678754142233400, Bicycles 1658310421102081, Boats 712638205822882, Electronics 1792291877663080, Furniture 1583634935226685, Garden 800089866739547, Household 1569171756675761, Tools 1670493229902393, Trailers 655837954899686, Vehicles 807311116002614 (or 546583916084032). Other ids need a keyword. Used by: marketplace.search.

## `radius_km` (type: `number`):

Search radius in km. Used by: marketplace.search.

## `min_price` (type: `number`):

Lowest listing price. Used by: marketplace.search.

## `max_price` (type: `number`):

Highest listing price. Used by: marketplace.search.

## `delivery_method` (type: `string`):

Delivery filter. Used by: marketplace.search.

## `condition` (type: `string`):

Condition filter. Used by: marketplace.search.

## `date_listed` (type: `string`):

Listed within. Uses the UI's calendar-day buckets. Used by: marketplace.search.

## `availability` (type: `string`):

Availability filter. Used by: marketplace.search.

## `time` (type: `string`):

Time frame; default all time. Used by: events.

## `maxPages` (type: `integer`):

Follow the cursor for up to this many pages. You pay for the results, not for the pages.

## `maxItems` (type: `integer`):

Stop after this many results. 0 means no limit other than Max pages.

## Actor input object example

```json
{
  "endpoint": "profile",
  "trim": false,
  "raw": false,
  "url": "https://www.facebook.com/nasa",
  "get_transcript": false,
  "get_business_hours": false,
  "include_gated_profile": false,
  "maxPages": 1,
  "maxItems": 0
}
```

# Actor output Schema

## `results` (type: `string`):

One dataset row per result.

## `summary` (type: `string`):

Pages and results of the run, why it stopped, and the next cursor when there is more.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "url": "https://www.facebook.com/nasa"
};

// Run the Actor and wait for it to finish
const run = await client.actor("socialscrape/facebook-scraper-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "url": "https://www.facebook.com/nasa" }

# Run the Actor and wait for it to finish
run = client.actor("socialscrape/facebook-scraper-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "url": "https://www.facebook.com/nasa"
}' |
apify call socialscrape/facebook-scraper-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,socialscrape/facebook-scraper-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/CgFKCxl0tOSRgMD1c/builds/0pQVaytPmTH2IpBnf/openapi.json
