# Facebook Scraper: Pages, Posts, Groups, Comments & Marketplace (`scrapysocial/facebook-scraper`) Actor

Scrape Facebook search (people, Pages, groups, events, places, posts, videos, hashtags), profiles and Pages, posts, photos, group feeds and members, comments and replies, videos, Marketplace listings and sellers, events. Real-time, clean JSON. Pay only for results.

- **URL**: https://apify.com/scrapysocial/facebook-scraper.md
- **Developed by:** [Scrapy Social](https://apify.com/scrapysocial) (community)
- **Categories:** Social media, Lead generation, E-commerce
- **Features:** Limited permissions
- **Stats:** 19 total users, 8 monthly users, 99.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.80 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Facebook Scraper: Pages, Posts, Groups, Comments & Marketplace

People, Pages, groups, posts, comments, videos, Marketplace and events from Facebook as one consistent JSON shape, with automatic pagination and batch input.

**37 endpoints** · real-time data · no Facebook account or cookies needed · automatic pagination · batch input · pay only for results ($3.50 / 1,000 results, down to $1.80 on higher Apify plans).

### What can this scraper do?

- **Search**: Search people, Search pages, Search groups, Search events, Search places, Search posts, Search videos, Hashtag posts
- **User**: Profile / Page info, Profile about, Profile posts, Followers / following / friends, Profile photos, Search a profile’s posts
- **Group**: Group info, Group about, Group posts, Group members, Group photos, Group videos, Group events, Search a group’s posts
- **Post**: Post detail, Post comments, Comment replies
- **Video**: Video / reel detail
- **Marketplace**: Marketplace search, Marketplace listing, Marketplace listing photos, Marketplace seller, Marketplace seller listings
- **Event**: Event detail
- **Utility**: Search suggestions, Search filter ids, Search filters, Resolve Facebook URL, Marketplace locations

### Use cases

- Brand monitoring: keyword and hashtag post search, Page posts and comment threads.
- Community research: group info, posts, members, photos, videos and events.
- Lead generation: people, Page, place and group search with location filters.
- E-commerce intelligence: Marketplace search by location, listing detail, photos and seller inventory.

### Why this scraper

- **Clean, consistent JSON.** The same fields (`id`, `author`, `stats`, `createdAt` …) across endpoints, so you write your parser once.
- **Real-time.** Every run fetches live data; nothing is served from a stale database.
- **No login, no blocking headaches.** Sessions, proxies, signatures and retries are handled for you.
- **Pagination built in.** Set *Max results per query*; the actor follows cursors for you and de-duplicates.
- **Batch mode.** Many usernames / posts / keywords in one run.
- **Fair billing.** Not-found lookups and failed calls are never charged.

### How to use it

1. Pick **What to scrape** (for example *Search posts*).
2. Fill the fields that endpoint uses (each field lists the endpoints that use it). Leave the others empty.
3. Set **Max results per query**, then click **Start**.
4. Download the results as JSON, CSV, Excel or HTML, or read them through the Apify API.

#### Input examples

**Search posts by keyword**

```json
{
  "endpoint": "search-posts",
  "keyword": "coffee",
  "maxItems": 100
}
```

**A Page's latest posts**

```json
{
  "endpoint": "user-posts",
  "username": "NASA",
  "maxItems": 100
}
```

**Posts in a public group**

```json
{
  "endpoint": "group-posts",
  "groupId": "2255223818160754",
  "maxItems": 100
}
```

**Marketplace listings near Jakarta**

```json
{
  "endpoint": "marketplace-search",
  "keyword": "iphone",
  "latitude": "-6.2088",
  "longitude": "106.8456",
  "maxItems": 100
}
```

**Several Pages / profiles in one run (batch)**

```json
{
  "endpoint": "user-info",
  "batch": [
    {
      "username": "NASA"
    },
    {
      "username": "zuck"
    }
  ],
  "maxItems": 50
}
```

### Output

Each result is one dataset row. List endpoints produce one row per item; lookups produce one row. Every row has a `_meta` object (endpoint, query, page, scrapedAt). Trend lists and similar responses also carry the list's own fields under `_context`. Example row from **Search posts**:

```json
{
  "id": "1830085652453993",
  "url": "https://www.facebook.com/reel/2267289317184621/",
  "text": "‼️ COFFEE SHOP BUKA SAMPE JAM 12 MALAM!\nDan matcha nya salah satu tempat matcha favorit tim Enjoy Bekasi nih. Karena tempat nya nyaman dan artsy, dan ini buk...",
  "createdAt": 1794485415,
  "author": {
    "id": "100063577273388",
    "name": "Enjoy Bekasi",
    "url": "https://www.facebook.com/enjoybekasi",
    "type": "User"
  },
  "reactionCount": 131,
  "commentCount": 0,
  "shareCount": 2,
  "media": [
    {
      "id": "2267289317184621",
      "type": "Video",
      "url": "https://www.facebook.com/reel/2267289317184621/",
      "image": "https://scontent.fcgk18-2.fna.fbcdn.net/v/t51.82787-10/902591661_1125261686804747_47433295?…"
    },
    {
      "id": "2267289317184621",
      "type": "Video",
      "url": "https://www.facebook.com/reel/2267289317184621/",
      "image": "https://scontent.fcgk18-2.fna.fbcdn.net/v/t51.82787-10/902591661_1125261686804747_47433295?…"
    }
  ],
  "feedbackId": "ZmVlZGJhY2s6cGZiaWQwS3J4SE4xQVFmazIxSmJxMjJqOWR2QXFXSEplSGRxcEtCUnE5Ym5CcGZiU3A2ZFZXVng4WU5ENG9lWjRoZHdRRmw=",
  "storyId": "UzpfSTEwMDA2MzU3NzI3MzM4ODoxODMwMDg1NjUyNDUzOTkzOjE4MzAwODU2NTI0NTM5OTM=",
  "_meta": {
    "endpoint": "search-posts",
    "query": {
      "keyword": "coffee"
    },
    "page": 1,
    "scrapedAt": "2026-11-11T08:00:00.000Z"
  }
}
```

A run summary (results, pages, not found, failed, stop reason) is saved to the key-value store as `OUTPUT`.

### Endpoints

| Group | Endpoint (`endpoint` value) | What you get | Paginated |
|---|---|---|---|
| Search | Search people (`search-people`) | Find Facebook profiles by name, optionally filtered by city, school or employer. | yes |
| Search | Search pages (`search-pages`) | Find Facebook Pages (businesses, brands, public figures) by keyword, city and category. | yes |
| Search | Search groups (`search-groups`) | Find Facebook groups by keyword, optionally only public groups or groups in a city. | yes |
| Search | Search events (`search-events`) | Find public Facebook events by keyword, city, date and category. | yes |
| Search | Search places (`search-places`) | Find places and local businesses by keyword, city, price level and opening status. | yes |
| Search | Search posts (`search-posts`) | Find public posts by keyword, optionally newest first or from a city. | yes |
| Search | Search videos (`search-videos`) | Find Facebook videos and reels by keyword. | yes |
| Search | Hashtag posts (`search-hashtag`) | Public posts for a hashtag, like facebook.com/hashtag/{tag}. | yes |
| User | Profile / Page info (`user-info`) | Name, pictures, cover, follower text, verified flag, category and intro of a profile or Page. |  |
| User | Profile about (`user-about`) | About section of a profile or Page: intro, work, education, contact info, places, personal details. |  |
| User | Profile posts (`user-posts`) | Posts on a profile or Page timeline, newest first. | yes |
| User | Followers / following / friends (`user-connections`) | People and Pages that follow a profile, that it follows, or its friends. | yes |
| User | Profile photos (`user-photos`) | Photos uploaded by or tagged with a profile / Page. | yes |
| User | Search a profile’s posts (`user-search-posts`) | Search inside one profile or Page’s posts. | yes |
| Group | Group info (`group-info`) | Name, URL, cover photo, privacy and member count of a group. |  |
| Group | Group about (`group-about`) | Description, privacy, visibility, admins and exact member count of a group. |  |
| Group | Group posts (`group-posts`) | Posts in a public group (or a group the session account joined). | yes |
| Group | Group members (`group-members`) | Newest members of a group with their join time. | yes |
| Group | Group photos (`group-photos`) | Photos posted in a group. | yes |
| Group | Group videos (`group-videos`) | Videos posted in a group. | yes |
| Group | Group events (`group-events`) | Upcoming and recent past events of a group. |  |
| Group | Search a group’s posts (`group-search-posts`) | Search inside one group’s posts. | yes |
| Post | Post detail (`post-detail`) | One post with text, author, time, counts and media. |  |
| Post | Post comments (`post-comments`) | Top-level comments of a post (relevant, newest or all). | yes |
| Post | Comment replies (`post-comment-replies`) | Replies to one comment. | yes |
| Video | Video / reel detail (`video-detail`) | Caption, owner, duration, time, counts and playable DASH tracks of a video or reel. |  |
| Marketplace | Marketplace search (`marketplace-search`) | Search Marketplace listings near a location with price, condition and sort filters. | yes |
| Marketplace | Marketplace listing (`marketplace-listing`) | Full listing: title, description, price, condition, location, seller, delivery and status. |  |
| Marketplace | Marketplace listing photos (`marketplace-listing-photos`) | All photos of a Marketplace listing. |  |
| Marketplace | Marketplace seller (`marketplace-seller`) | Seller profile: name, location, listing count and rating visibility. |  |
| Marketplace | Marketplace seller listings (`marketplace-seller-listings`) | Listings of one seller (in stock or sold). | yes |
| Event | Event detail (`event-detail`) | Public event: name, description, time, place, hosts and attendance. |  |
| Utility | Search suggestions (`search-suggestions`) | Autocomplete suggestions for a partial search text. |  |
| Utility | Search filter ids (`search-filter-values`) | Find the numeric id of a city, school or employer for search filters. |  |
| Utility | Search filters (`search-filters`) | Filters Facebook offers for a search tab, with their ready-made values. |  |
| Utility | Resolve Facebook URL (`utility-resolve-url`) | Turn any www.facebook.com URL into its type and ids. |  |
| Utility | Marketplace locations (`marketplace-locations`) | Find a city / area and its coordinates for Marketplace search. |  |

#### Endpoint reference

##### Search

###### Search people · `search-people`

Searches the **People** tab of Facebook search. Each result has the profile id, name, URL, picture, verified flag and the short context lines Facebook shows (city, work, mutual friends). Filters take numeric ids from `the "Search filter ids" endpoint` (`type=location`, `school`, `employer`). Results depend on the session account (friends of friends rank higher).

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search text, as typed in the Facebook search box. |
| `locationId` |  | Only results in this city / area. Numeric Facebook location id, e.g. `102173726491792` (Jakarta). Find ids with `the "Search filter ids" endpoint?type=location`. |
| `schoolId` |  | Only people who studied at this school. Numeric id from `the "Search filter ids" endpoint?type=school`. |
| `employerId` |  | Only people who work at this employer. Numeric id from `the "Search filter ids" endpoint?type=employer`. |
| `cursor` |  | Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token. |

###### Search pages · `search-pages`

Searches the **Pages** tab. Results include id, name, URL, picture, verified flag and the category / location / follower line Facebook shows. `category` values: `local_business`, `company` (company, organization or institution), `brand` (brand or product), `artist` (artist, band or public figure), `entertainment`, `community` (cause or community).

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search text, as typed in the Facebook search box. |
| `locationId` |  | Only results in this city / area. Numeric Facebook location id, e.g. `102173726491792` (Jakarta). Find ids with `the "Search filter ids" endpoint?type=location`. |
| `category` |  | Page category. Allowed: `local_business`, `company`, `brand`, `artist`, `entertainment`, `community`. Omit = all categories. |
| `cursor` |  | Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token. |

###### Search groups · `search-groups`

Searches the **Groups** tab. Results include group id, name, URL, picture and the privacy / member count / posts-per-day line Facebook shows.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search text, as typed in the Facebook search box. |
| `locationId` |  | Only results in this city / area. Numeric Facebook location id, e.g. `102173726491792` (Jakarta). Find ids with `the "Search filter ids" endpoint?type=location`. |
| `publicOnly` |  | Only public groups. Omit = public and private groups. |
| `cursor` |  | Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token. |

###### Search events · `search-events`

Searches the **Events** tab. Results include event id, name, URL, cover picture and the date / place / interested line Facebook shows. `date` is one day (`2026-12-31`) or a range (`2026-12-01~2026-12-31`).

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search text, as typed in the Facebook search box. |
| `locationId` |  | Only results in this city / area. Numeric Facebook location id, e.g. `102173726491792` (Jakarta). Find ids with `the "Search filter ids" endpoint?type=location`. |
| `date` |  | Event date `YYYY-MM-DD` or range `YYYY-MM-DD~YYYY-MM-DD`. Omit = any date. |
| `category` |  | Event category. Allowed: `art`, `causes`, `comedy`, `crafts`, `dance`, `drinks`, `film`, `fitness`, `food`, `games`, `gardening`, `health`, `home`, `literature`, `music`, `networking`, `other`, `party`, `religion`, `shopping`, `sports`, `theater`, `wellness`.… |
| `cursor` |  | Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token. |

###### Search places · `search-places`

Searches the **Places** tab (restaurants, shops, venues). Results include the place Page id, name, URL, picture and the category / rating / address line Facebook shows.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search text, as typed in the Facebook search box. |
| `locationId` |  | Only results in this city / area. Numeric Facebook location id, e.g. `102173726491792` (Jakarta). Find ids with `the "Search filter ids" endpoint?type=location`. |
| `openNow` |  | Only places open right now. |
| `delivery` |  | Only places that offer delivery. |
| `takeout` |  | Only places that offer takeout. |
| `price` |  | Price level `1` ($) to `4` ($$$$). Omit = any price.Allowed: `1`, `2`, `3`, `4`. |
| `cursor` |  | Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token. |

###### Search posts · `search-posts`

Searches the **Posts** tab. Each post has its id, URL, text, time, author, reaction / comment / share counts, photos and the `feedbackId` used by `the "Post comments" endpoint`.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search text, as typed in the Facebook search box. |
| `sort` |  | Order. Allowed: `relevance` (Facebook ranking), `recent` (recent posts first). Omit = `relevance`. |
| `locationId` |  | Only posts tagged in this city / area. Numeric location id from `the "Search filter ids" endpoint?type=location`. |
| `cursor` |  | Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token. |

###### Search videos · `search-videos`

Searches the **Videos** tab. Each result is the video post: `videoId`, duration, thumbnail, URL, caption, time, author, reaction / comment / share counts and `feedbackId` (for comments). Use `videoId` with `the "Video / reel detail" endpoint`.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search text, as typed in the Facebook search box. |
| `cursor` |  | Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token. |

###### Hashtag posts · `search-hashtag`

Returns the posts Facebook shows on a hashtag page. Pass the tag with or without `#`.

| Field | Required | Description |
|---|---|---|
| `hashtag` | yes | Hashtag with or without `#`, e.g. `travel` or `#travel`. |
| `cursor` |  | Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token. |

##### User

###### Profile / Page info · `user-info`

Header of a Facebook profile or Page: id, name, URL, profile picture, cover photo, verified badge, gender, the follower / friend line (as Facebook displays it, e.g. "121M followers"), the intro items (category, work, city, links) and the bio.

| Field | Required | Description |
|---|---|---|
| `userId` |  | Numeric Facebook profile or Page id, e.g. `4` (Mark Zuckerberg) or `100044561550831` (NASA). Send this **or** `username`. |
| `username` |  | Profile / Page username (the part after facebook.com/), e.g. `zuck` or `NASA`. Resolved to `userId` automatically. Send this **or** `userId`. |

###### Profile about · `user-about`

One About sub-tab as sections of fields (`type`, `text`, optional `subtitle` and `url`). Only fields the profile shares publicly (or with the session account) are returned; a section with nothing shared answers 404. `section` values: `intro`, `personal` (birthday, languages, relationship), `work`, `education`, `contact` (phone, email, website, address, social links), `places`.

| Field | Required | Description |
|---|---|---|
| `userId` |  | Numeric Facebook profile or Page id, e.g. `4` (Mark Zuckerberg) or `100044561550831` (NASA). Send this **or** `username`. |
| `username` |  | Profile / Page username (the part after facebook.com/), e.g. `zuck` or `NASA`. Resolved to `userId` automatically. Send this **or** `userId`. |
| `section` |  | About sub-tab. Allowed: `intro`, `personal`, `work`, `education`, `contact`, `places`. Omit = `intro`. |
| `collectionToken` |  | Advanced: About collection token — normally resolved from the user and `section`. |
| `sectionToken` |  | Advanced: About section token — normally resolved together with `collectionToken`. |
| `rawSectionToken` |  | Advanced: raw About section token — normally resolved together with `collectionToken`. |

###### Profile posts · `user-posts`

Timeline posts with text, time, author, reaction / comment / share counts, photos and `feedbackId` (for `the "Post comments" endpoint`). Pinned posts are skipped.

| Field | Required | Description |
|---|---|---|
| `userId` |  | Numeric Facebook profile or Page id, e.g. `4` (Mark Zuckerberg) or `100044561550831` (NASA). Send this **or** `username`. |
| `username` |  | Profile / Page username (the part after facebook.com/), e.g. `zuck` or `NASA`. Resolved to `userId` automatically. Send this **or** `userId`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Followers / following / friends · `user-connections`

Lists one connection tab of a profile or Page. `type` values: `followers`, `following`, `friends` (only when the friend list is visible to the session account).

| Field | Required | Description |
|---|---|---|
| `userId` |  | Numeric Facebook profile or Page id, e.g. `4` (Mark Zuckerberg) or `100044561550831` (NASA). Send this **or** `username`. |
| `username` |  | Profile / Page username (the part after facebook.com/), e.g. `zuck` or `NASA`. Resolved to `userId` automatically. Send this **or** `userId`. |
| `type` |  | Which list. Allowed: `followers`, `following`, `friends`. Omit = `followers`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |
| `collectionToken` |  | Advanced: collection token — normally resolved from the user and `type`. |

###### Profile photos · `user-photos`

Photo grid of a profile or Page with photo id, page URL and image URL. `type` values: `uploaded` (photos by), `tagged` (photos of).

| Field | Required | Description |
|---|---|---|
| `userId` |  | Numeric Facebook profile or Page id, e.g. `4` (Mark Zuckerberg) or `100044561550831` (NASA). Send this **or** `username`. |
| `username` |  | Profile / Page username (the part after facebook.com/), e.g. `zuck` or `NASA`. Resolved to `userId` automatically. Send this **or** `userId`. |
| `type` |  | Which photos. Allowed: `uploaded`, `tagged`. Omit = `uploaded`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |
| `collectionToken` |  | Advanced: collection token — normally resolved from the user and `type`. |

###### Search a profile’s posts · `user-search-posts`

Runs the in-profile search box ("Search" on a profile). Returns matching posts of that profile with the same fields as `the "Profile posts" endpoint`.

| Field | Required | Description |
|---|---|---|
| `userId` |  | Numeric Facebook profile or Page id, e.g. `4` (Mark Zuckerberg) or `100044561550831` (NASA). Send this **or** `username`. |
| `username` |  | Profile / Page username (the part after facebook.com/), e.g. `zuck` or `NASA`. Resolved to `userId` automatically. Send this **or** `userId`. |
| `keyword` | yes | Search text, as typed in the Facebook search box. |
| `cursor` |  | Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token. |

##### Group

###### Group info · `group-info`

Header of a Facebook group: id, name, URL, cover photo, privacy ("Public group" / "Private group" in the account language) and the member count line.

| Field | Required | Description |
|---|---|---|
| `groupId` |  | Numeric Facebook group id, e.g. `2255223818160754`. Send this **or** `groupName`. |
| `groupName` |  | Group vanity name (the part after facebook.com/groups/), e.g. `nycfoodlovers`. Resolved to `groupId` automatically. Send this **or** `groupId`. |

###### Group about · `group-about`

About tab of a group: description, privacy and visibility (label + explanation), admin names and the member count.

| Field | Required | Description |
|---|---|---|
| `groupId` |  | Numeric Facebook group id, e.g. `2255223818160754`. Send this **or** `groupName`. |
| `groupName` |  | Group vanity name (the part after facebook.com/groups/), e.g. `nycfoodlovers`. Resolved to `groupId` automatically. Send this **or** `groupId`. |

###### Group posts · `group-posts`

Group discussion feed with text, time, author, reaction / comment / share counts, photos and `feedbackId`. `sort` values: `top` (Facebook default), `new` (new posts), `activity` (recent activity).

| Field | Required | Description |
|---|---|---|
| `groupId` |  | Numeric Facebook group id, e.g. `2255223818160754`. Send this **or** `groupName`. |
| `groupName` |  | Group vanity name (the part after facebook.com/groups/), e.g. `nycfoodlovers`. Resolved to `groupId` automatically. Send this **or** `groupId`. |
| `sort` |  | Order. Allowed: `top`, `new`, `activity`. Omit = `top`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Group members · `group-members`

Members list (newest first) with profile id, name, URL, picture and the "Joined …" line. Visible for public groups and groups the session account belongs to.

| Field | Required | Description |
|---|---|---|
| `groupId` |  | Numeric Facebook group id, e.g. `2255223818160754`. Send this **or** `groupName`. |
| `groupName` |  | Group vanity name (the part after facebook.com/groups/), e.g. `nycfoodlovers`. Resolved to `groupId` automatically. Send this **or** `groupId`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Group photos · `group-photos`

Media tab photos with photo id, image URL and uploader id.

| Field | Required | Description |
|---|---|---|
| `groupId` |  | Numeric Facebook group id, e.g. `2255223818160754`. Send this **or** `groupName`. |
| `groupName` |  | Group vanity name (the part after facebook.com/groups/), e.g. `nycfoodlovers`. Resolved to `groupId` automatically. Send this **or** `groupId`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Group videos · `group-videos`

Media tab videos with video id, URL, thumbnail and uploader. Groups without a Videos tab answer 404.

| Field | Required | Description |
|---|---|---|
| `groupId` |  | Numeric Facebook group id, e.g. `2255223818160754`. Send this **or** `groupName`. |
| `groupName` |  | Group vanity name (the part after facebook.com/groups/), e.g. `nycfoodlovers`. Resolved to `groupId` automatically. Send this **or** `groupId`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Group events · `group-events`

Events created in the group, split into `upcoming` and `past`.

| Field | Required | Description |
|---|---|---|
| `groupId` |  | Numeric Facebook group id, e.g. `2255223818160754`. Send this **or** `groupName`. |
| `groupName` |  | Group vanity name (the part after facebook.com/groups/), e.g. `nycfoodlovers`. Resolved to `groupId` automatically. Send this **or** `groupId`. |

###### Search a group’s posts · `group-search-posts`

Runs the group search box. Returns matching posts of that group with the same fields as `the "Group posts" endpoint`.

| Field | Required | Description |
|---|---|---|
| `groupId` |  | Numeric Facebook group id, e.g. `2255223818160754`. Send this **or** `groupName`. |
| `groupName` |  | Group vanity name (the part after facebook.com/groups/), e.g. `nycfoodlovers`. Resolved to `groupId` automatically. Send this **or** `groupId`. |
| `keyword` | yes | Search text, as typed in the Facebook search box. |
| `cursor` |  | Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token. |

##### Post

###### Post detail · `post-detail`

Full post from its URL: id, URL, text, time, author, reaction / comment / share counts, photos / video and the `feedbackId` for comments.

| Field | Required | Description |
|---|---|---|
| `postUrl` |  | Full post URL on www.facebook.com, e.g. `https://www.facebook.com/zuck/posts/pfbid0…` or `https://www.facebook.com/groups/{group}/posts/{id}/`. Send this **or** `storyId`. |
| `storyId` |  | Advanced: Facebook story id (base64, `storyId` of a post) — normally resolved from `postUrl`. |

###### Post comments · `post-comments`

Comments with id, text, time, author, reaction count text, reply count and the `feedbackId` + `repliesToken` used by `the "Comment replies" endpoint`. Also works for videos and reels (use their `feedbackId`). `sort` values: `relevant` (Facebook default), `newest`, `all` (all comments, unfiltered).

| Field | Required | Description |
|---|---|---|
| `feedbackId` |  | Feedback id of a post (`feedbackId` from posts in search / timeline / group / post detail). Send this **or** `postUrl`. |
| `postUrl` |  | Full post URL on www.facebook.com, e.g. `https://www.facebook.com/zuck/posts/pfbid0…` or `https://www.facebook.com/groups/{group}/posts/{id}/`. Send this **or** `storyId`. |
| `sort` |  | Order. Allowed: `relevant`, `newest`, `all`. Omit = `relevant`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |
| `storyId` |  | Advanced: Facebook story id (base64, `storyId` of a post) — normally resolved from `postUrl`. |

###### Comment replies · `post-comment-replies`

Replies with the same fields as comments. Take `feedbackId` and `repliesToken` from an item of `the "Post comments" endpoint`.

| Field | Required | Description |
|---|---|---|
| `feedbackId` | yes | Comment `feedbackId` from `the "Post comments" endpoint`. |
| `repliesToken` | yes | Comment `repliesToken` from `the "Post comments" endpoint` (short-lived; take a fresh one). |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

##### Video

###### Video / reel detail · `video-detail`

Video or reel by numeric id (the number in `/reel/{id}`, `/watch/?v={id}` or `/videos/{id}`): caption, owner, duration, post time, `feedbackId` (for comments) and the DASH representations (separate video and audio tracks with bitrate and resolution).

| Field | Required | Description |
|---|---|---|
| `videoId` | yes | Numeric video / reel id, e.g. `1685483219914124`. |

##### Marketplace

###### Marketplace search · `marketplace-search`

Marketplace listings for a keyword around a point (latitude / longitude, e.g. from `the "Marketplace locations" endpoint`). Each listing has id, title, price (number and display text), main photo, city, time, seller and URL. Prices are in the local currency of the area (whole units, e.g. `5000000` = Rp5.000.000). Marketplace pages are uneven: a page can hold few or even no listings (ads are removed) while `hasMore` is still `true` — keep following `cursor`.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search text, as typed in the Facebook search box. |
| `latitude` | yes | Search center latitude, e.g. `-6.2088` (Jakarta). Get it from `the "Marketplace locations" endpoint`. |
| `longitude` | yes | Search center longitude, e.g. `106.8456` (Jakarta). |
| `radiusKm` |  | Search radius in km (1–500). Omit = 65. |
| `minPrice` |  | Minimum price in whole currency units, e.g. `100000`. |
| `maxPrice` |  | Maximum price in whole currency units, e.g. `5000000`. |
| `condition` |  | Item condition. Allowed: `new`, `used_like_new`, `used_good`, `used_fair`. Omit = any. |
| `sort` |  | Order. Allowed: `best_match`, `price_low`, `price_high`, `newest`, `nearest`. Omit = `best_match`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Marketplace listing · `marketplace-listing`

One Marketplace item by id. Photos are in `the "Marketplace listing photos" endpoint`.

| Field | Required | Description |
|---|---|---|
| `listingId` | yes | Marketplace listing id (the number in `facebook.com/marketplace/item/{id}`), e.g. `2048296092514804`. |

###### Marketplace listing photos · `marketplace-listing-photos`

Full-size photo URLs (with size) of one listing.

| Field | Required | Description |
|---|---|---|
| `listingId` | yes | Marketplace listing id (the number in `facebook.com/marketplace/item/{id}`), e.g. `2048296092514804`. |

###### Marketplace seller · `marketplace-seller`

Marketplace seller card: id, name, short name, number of active listings, the context lines Facebook shows (e.g. city, joined year) and whether ratings are public.

| Field | Required | Description |
|---|---|---|
| `sellerId` | yes | Seller user id (`seller.id` of a listing), e.g. `61561287476399`. |

###### Marketplace seller listings · `marketplace-seller-listings`

All listings of a seller, newest first, with the same fields as search results. `availability`: `in_stock` (default) or `out_of_stock` (sold).

| Field | Required | Description |
|---|---|---|
| `sellerId` | yes | Seller user id (`seller.id` of a listing), e.g. `61561287476399`. |
| `availability` |  | Allowed: `in_stock`, `out_of_stock`. Omit = `in_stock`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

##### Event

###### Event detail · `event-detail`

One event by id (the number in `facebook.com/events/{id}`): name, description, start / end timestamps, time zone, place, online flag and URL, hosts, parent group and suggested related events.

| Field | Required | Description |
|---|---|---|
| `eventId` | yes | Numeric event id, e.g. `520470144434103`. |

##### Utility

###### Search suggestions · `search-suggestions`

What Facebook suggests while typing in the search box (keywords and entities), with the suggestion type.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Partial search text, e.g. `jaka`. |

###### Search filter ids · `search-filter-values`

Typeahead behind the search filter pills. `type=location` returns city / area ids for `locationId` (all search endpoints), `school` → `schoolId`, `employer` → `employerId` (people search).

| Field | Required | Description |
|---|---|---|
| `type` | yes | Allowed: `location`, `school`, `employer`. |
| `keyword` | yes | Name to look up, e.g. `Jakarta`, `Harvard`, `Google`. |

###### Search filters · `search-filters`

Lists the filter pills of one search tab for a keyword (e.g. city, school, category, date, price) with the suggested values and the raw filter JSON. Use the ids in the matching search endpoint params.

| Field | Required | Description |
|---|---|---|
| `tab` | yes | Search tab. Allowed: `people`, `pages`, `groups`, `events`, `places`, `posts`, `videos`. |
| `keyword` | yes | Search text, as typed in the Facebook search box. |

###### Resolve Facebook URL · `utility-resolve-url`

Uses the Facebook web router to identify a URL: profile / Page (→ `userId`), group (→ `groupId`), post (→ `storyId`, `actorId`), event (→ `eventId`), video, Marketplace item and more. `route` is Facebook’s route name; `entityType` its entity kind.

| Field | Required | Description |
|---|---|---|
| `url` | yes | Full URL on www.facebook.com (or a path such as `/zuck`), e.g. `https://www.facebook.com/NASA`. |

###### Marketplace locations · `marketplace-locations`

Location typeahead used by Marketplace. Returns name, address, Facebook place id and latitude / longitude to pass to `the "Marketplace search" endpoint`.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | City / area name, e.g. `Surabaya`, `London`. |

### Pagination, limits and batch

- **Max results per query** (`maxItems`) and **Max pages per query** (`maxPages`) bound each query; the actor stops at whichever comes first or when the source has no more pages.
- **Batch** (`batch`) runs the selected endpoint once per object, e.g. `[{"username":"a"},{"username":"b"}]`. Form fields act as defaults for every batch entry.
- **Parallel queries** (`concurrency`) controls how many batch entries run at once.
- To continue a previous run manually, pass the last `cursor` from the response (with *One row per result* off) as the `cursor` field.

### Pricing

This actor uses **pay per event** pricing: you pay for the results you get, not for compute time.

Higher Apify plans get an automatic Store discount:

| Apify plan | Per 1,000 results | Actor start |
|---|---|---|
| Free | $3.50 | $0.005 |
| Bronze | $3.00 | $0.004 |
| Silver | $2.20 | $0.003 |
| Gold | $1.80 | $0.0025 |
| Platinum | $1.80 | $0.0025 |
| Diamond | $1.80 | $0.0025 |

Example on the Free plan: 1,000 results in one run cost $3.505. Platform usage (compute, proxy, storage) is included; you pay only the events above. The start event is charged once per run at the default 512 MB memory.

Not-found lookups and failed calls are free. With *One row per result* off, a row holding a page of N items counts as N results.

Set **Maximum cost per run** in the run options to cap spending; the actor stops cleanly at that limit and keeps everything it already saved.

### Integrations and API

Run it from code with the Apify API or clients and get results as JSON:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('<username>/facebook-scraper').call({"endpoint":"search-posts","keyword":"coffee","maxItems":100});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

It also works with schedules, webhooks, Make, Zapier, n8n, Google Sheets and every other Apify integration.

### FAQ

**Do I need a Facebook account, cookies or an API key?** No. Just pick an endpoint and run.

**Is scraping Facebook legal?** This actor only returns publicly available data. You are responsible for how you use it: respect privacy laws (GDPR, CCPA), the platform's terms, and do not collect personal data without a legitimate reason.

**Why did a query return nothing?** The account, post or keyword may not exist, may be private, or may have no public results. Those queries are reported in the `OUTPUT` summary as *not found* and are not charged.

**Can I get more than the maximum?** Raise *Max results per query* and *Max pages per query*. Very large pulls are best split with *Batch*.

**How fresh is the data?** Real time: each run reads the platform at that moment.

### Changelog and support

See the **Changelog** tab. Found a bug or need a field or endpoint? Open an issue in the **Issues** tab; we usually reply within a day.

# Changelog

This Actor's version history is a separate document: https://apify.com/scrapysocial/facebook-scraper/changelog.md

# Actor input Schema

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

Pick the Facebook data you want. Then fill only the fields that endpoint uses (each field says which endpoints use it). Full list with descriptions: see the README tab.

## `keyword` (type: `string`):

Name to look up, e.g. `Jakarta`, `Harvard`, `Google`.<br><br><b>Used by:</b> Search people, Search pages, Search groups, Search events, Search places, Search posts +8 more. <b>Required by:</b> Search people, Search pages, Search groups, Search events, Search places, Search posts …. <b>Example:</b> <code>coffee</code>

## `locationId` (type: `string`):

Only results in this city / area. Numeric Facebook location id, e.g. `102173726491792` (Jakarta). Find ids with `the "Search filter ids" endpoint?type=location`.<br><br><b>Used by:</b> Search people, Search pages, Search groups, Search events, Search places, Search posts.

## `schoolId` (type: `string`):

Only people who studied at this school. Numeric id from `the "Search filter ids" endpoint?type=school`.<br><br><b>Used by:</b> Search people.

## `employerId` (type: `string`):

Only people who work at this employer. Numeric id from `the "Search filter ids" endpoint?type=employer`.<br><br><b>Used by:</b> Search people.

## `cursor` (type: `string`):

Opaque pagination token (base64url). Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). Do not edit the token.<br><br><b>Used by:</b> Search people, Search pages, Search groups, Search events, Search places, Search posts +15 more.

## `category` (type: `string`):

Event category. Allowed: `art`, `causes`, `comedy`, `crafts`, `dance`, `drinks`, `film`, `fitness`, `food`, `games`, `gardening`, `health`, `home`, `literature`, `music`, `networking`, `other`, `party`, `religion`, `shopping`, `sports`, `theater`, `wellness`. Omit = all.<br><br><b>Used by:</b> Search pages, Search events.

## `publicOnly` (type: `boolean`):

Only public groups. Omit = public and private groups.<br><br><b>Used by:</b> Search groups.

## `date` (type: `string`):

Event date `YYYY-MM-DD` or range `YYYY-MM-DD~YYYY-MM-DD`. Omit = any date.<br><br><b>Used by:</b> Search events.

## `openNow` (type: `boolean`):

Only places open right now.<br><br><b>Used by:</b> Search places.

## `delivery` (type: `boolean`):

Only places that offer delivery.<br><br><b>Used by:</b> Search places.

## `takeout` (type: `boolean`):

Only places that offer takeout.<br><br><b>Used by:</b> Search places.

## `price` (type: `string`):

Price level `1` ($) to `4` ($$$$). Omit = any price.<br><br><b>Used by:</b> Search places.

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

Order. Allowed: `relevance` (Facebook ranking), `recent` (recent posts first). Omit = `relevance`.<br><br><b>Used by:</b> Search posts, Group posts, Post comments, Marketplace search.

## `hashtag` (type: `string`):

Hashtag with or without `#`, e.g. `travel` or `#travel`.<br><br><b>Used by:</b> Hashtag posts. <b>Required by:</b> Hashtag posts. <b>Example:</b> <code>travel</code>

## `userId` (type: `string`):

Numeric Facebook profile or Page id, e.g. `4` (Mark Zuckerberg) or `100044561550831` (NASA). Send this **or** `username`.<br><br><b>Used by:</b> Profile / Page info, Profile about, Profile posts, Followers / following / friends, Profile photos, Search a profile’s posts.

## `username` (type: `string`):

Profile / Page username (the part after facebook.com/), e.g. `zuck` or `NASA`. Resolved to `userId` automatically. Send this **or** `userId`.<br><br><b>Used by:</b> Profile / Page info, Profile about, Profile posts, Followers / following / friends, Profile photos, Search a profile’s posts. <b>Example:</b> <code>NASA</code>

## `section` (type: `string`):

About sub-tab. Allowed: `intro`, `personal`, `work`, `education`, `contact`, `places`. Omit = `intro`.<br><br><b>Used by:</b> Profile about.

## `collectionToken` (type: `string`):

Advanced: About collection token — normally resolved from the user and `section`.<br><br><b>Used by:</b> Profile about, Followers / following / friends, Profile photos.

## `sectionToken` (type: `string`):

Advanced: About section token — normally resolved together with `collectionToken`.<br><br><b>Used by:</b> Profile about.

## `rawSectionToken` (type: `string`):

Advanced: raw About section token — normally resolved together with `collectionToken`.<br><br><b>Used by:</b> Profile about.

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

Which list. Allowed: `followers`, `following`, `friends`. Omit = `followers`.<br><br><b>Used by:</b> Followers / following / friends, Profile photos, Search filter ids. <b>Required by:</b> Search filter ids.

## `groupId` (type: `string`):

Numeric Facebook group id, e.g. `2255223818160754`. Send this **or** `groupName`.<br><br><b>Used by:</b> Group info, Group about, Group posts, Group members, Group photos, Group videos +2 more. <b>Example:</b> <code>2255223818160754</code>

## `groupName` (type: `string`):

Group vanity name (the part after facebook.com/groups/), e.g. `nycfoodlovers`. Resolved to `groupId` automatically. Send this **or** `groupId`.<br><br><b>Used by:</b> Group info, Group about, Group posts, Group members, Group photos, Group videos +2 more.

## `postUrl` (type: `string`):

Full post URL on www.facebook.com, e.g. `https://www.facebook.com/zuck/posts/pfbid0…` or `https://www.facebook.com/groups/{group}/posts/{id}/`. Send this **or** `storyId`.<br><br><b>Used by:</b> Post detail, Post comments. <b>Example:</b> <code>https://www.facebook.com/NASA/posts/pfbid05YJTkWebVNj83FA2ifGfHBxTdYFWuNrAMo4yAKnbRuY9XXK8nXohgsLxADToV4vfl</code>

## `storyId` (type: `string`):

Advanced: Facebook story id (base64, `storyId` of a post) — normally resolved from `postUrl`.<br><br><b>Used by:</b> Post detail, Post comments.

## `feedbackId` (type: `string`):

Feedback id of a post (`feedbackId` from posts in search / timeline / group / post detail). Send this **or** `postUrl`.<br><br><b>Used by:</b> Post comments, Comment replies. <b>Required by:</b> Comment replies. <b>Example:</b> <code>ZmVlZGJhY2s6cGZiaWQwMktmSzJBUVFiTGRvcHhFRWVKSkZQN25rdHVIdHE0SnNFbnBtNXdxbnFyRXVlWFU0ZHAzRXI3dXpIelpqOFlmb29jNGFNNnI5NkVvaTZhV1VEdjczeGF6elRtNFo3d3U5NEVqbA==</code>

## `repliesToken` (type: `string`):

Comment `repliesToken` from `the "Post comments" endpoint` (short-lived; take a fresh one).<br><br><b>Used by:</b> Comment replies. <b>Required by:</b> Comment replies. <b>Example:</b> <code>MjoxNzk0NDkxOTg0OgF_GEXdotzAnd8xbMEBRHBJUnIIcUL3tBhgRn9X18HPHfHuY43bWXhxTt0iZN_pLaZFkrTLM4qa8r3Xm12iOVUfeDgyNI5O_jiXJ7D4UXrLQCCcx9cdKL_RuT00k491HN1pYWrrgaOFXUtF4DpaCeXMZoL40k_03JxDfVyuzmTpmfyVc0HoLT421z7wrffKqxGoIiXDL7NCW15u4M3evaznp62zDL0z9BDqGa1Vqpt8Xxc5iRHMIN4rYf2rwcScDAChPimKXmV3aNl1hMUHaaqkNBuNmEClGG8j0ImlyXlyOf1kfOj4iNUsGsH1kzsSttJtEIVJWpIKa3q3Lb5X3kI2EUKdl0arLJ-GMd2GCeBILFT20NCSjU7AseiKodMn3XB-BgYD3sX8gZZvub1lHmi9c2D3bwLM0k-9ds5RajOzN6tYorsJbCODUoypCmYnKEU645lOZMUj74u9mKXBBIn3Wae7T0gDWHIUTjjaDygRgklznIUw5FEcToGYcDw-\_e8qOxLSrccDX5hTFZx_yTUHDEp0ns9j0AqPCkrC4rYM6iPwaGFL0B0HtqFlOFWfjpHJ5Wk_uao6WJBOadsps9CrVnS9f0t3JRsjpPVN2faTqlxRyXq3pzSDaBw</code>

## `videoId` (type: `string`):

Numeric video / reel id, e.g. `1685483219914124`.<br><br><b>Used by:</b> Video / reel detail. <b>Required by:</b> Video / reel detail. <b>Example:</b> <code>1685483219914124</code>

## `latitude` (type: `string`):

Search center latitude, e.g. `-6.2088` (Jakarta). Get it from `the "Marketplace locations" endpoint`.<br><br><b>Used by:</b> Marketplace search. <b>Required by:</b> Marketplace search. <b>Example:</b> <code>-6.2088</code>

## `longitude` (type: `string`):

Search center longitude, e.g. `106.8456` (Jakarta).<br><br><b>Used by:</b> Marketplace search. <b>Required by:</b> Marketplace search. <b>Example:</b> <code>106.8456</code>

## `radiusKm` (type: `integer`):

Search radius in km (1–500). Omit = 65.<br><br><b>Used by:</b> Marketplace search.

## `minPrice` (type: `integer`):

Minimum price in whole currency units, e.g. `100000`.<br><br><b>Used by:</b> Marketplace search.

## `maxPrice` (type: `integer`):

Maximum price in whole currency units, e.g. `5000000`.<br><br><b>Used by:</b> Marketplace search.

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

Item condition. Allowed: `new`, `used_like_new`, `used_good`, `used_fair`. Omit = any.<br><br><b>Used by:</b> Marketplace search.

## `listingId` (type: `string`):

Marketplace listing id (the number in `facebook.com/marketplace/item/{id}`), e.g. `2048296092514804`.<br><br><b>Used by:</b> Marketplace listing, Marketplace listing photos. <b>Required by:</b> Marketplace listing, Marketplace listing photos. <b>Example:</b> <code>2048296092514804</code>

## `sellerId` (type: `string`):

Seller user id (`seller.id` of a listing), e.g. `61561287476399`.<br><br><b>Used by:</b> Marketplace seller, Marketplace seller listings. <b>Required by:</b> Marketplace seller, Marketplace seller listings. <b>Example:</b> <code>61561287476399</code>

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

Allowed: `in_stock`, `out_of_stock`. Omit = `in_stock`.<br><br><b>Used by:</b> Marketplace seller listings.

## `eventId` (type: `string`):

Numeric event id, e.g. `520470144434103`.<br><br><b>Used by:</b> Event detail. <b>Required by:</b> Event detail. <b>Example:</b> <code>520470144434103</code>

## `tab` (type: `string`):

Search tab. Allowed: `people`, `pages`, `groups`, `events`, `places`, `posts`, `videos`.<br><br><b>Used by:</b> Search filters. <b>Required by:</b> Search filters.

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

Full URL on www.facebook.com (or a path such as `/zuck`), e.g. `https://www.facebook.com/NASA`.<br><br><b>Used by:</b> Resolve Facebook URL. <b>Required by:</b> Resolve Facebook URL. <b>Example:</b> <code>https://www.facebook.com/NASA</code>

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

Stop paginating a query after this many results. Each saved result is one billable "result-item" event.

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

Upper bound on API pages fetched per query (a page is usually 10–50 results).

## `batch` (type: `array`):

Optional JSON array. Each object is one query for the selected endpoint; its keys override the form fields above. Example: <code>\[{"username":"NASA"},{"username":"zuck"}]</code>

## `splitItems` (type: `boolean`):

On (recommended): every post/user/comment is its own dataset row. Off: one row per API page (the list stays nested). Billing is per result either way.

## `concurrency` (type: `integer`):

How many batch queries run at the same time.

## Actor input object example

```json
{
  "endpoint": "search-posts",
  "keyword": "coffee",
  "hashtag": "travel",
  "type": "location",
  "feedbackId": "ZmVlZGJhY2s6cGZiaWQwMktmSzJBUVFiTGRvcHhFRWVKSkZQN25rdHVIdHE0SnNFbnBtNXdxbnFyRXVlWFU0ZHAzRXI3dXpIelpqOFlmb29jNGFNNnI5NkVvaTZhV1VEdjczeGF6elRtNFo3d3U5NEVqbA==",
  "repliesToken": "MjoxNzk0NDkxOTg0OgF_GEXdotzAnd8xbMEBRHBJUnIIcUL3tBhgRn9X18HPHfHuY43bWXhxTt0iZN_pLaZFkrTLM4qa8r3Xm12iOVUfeDgyNI5O_jiXJ7D4UXrLQCCcx9cdKL_RuT00k491HN1pYWrrgaOFXUtF4DpaCeXMZoL40k_03JxDfVyuzmTpmfyVc0HoLT421z7wrffKqxGoIiXDL7NCW15u4M3evaznp62zDL0z9BDqGa1Vqpt8Xxc5iRHMIN4rYf2rwcScDAChPimKXmV3aNl1hMUHaaqkNBuNmEClGG8j0ImlyXlyOf1kfOj4iNUsGsH1kzsSttJtEIVJWpIKa3q3Lb5X3kI2EUKdl0arLJ-GMd2GCeBILFT20NCSjU7AseiKodMn3XB-BgYD3sX8gZZvub1lHmi9c2D3bwLM0k-9ds5RajOzN6tYorsJbCODUoypCmYnKEU645lOZMUj74u9mKXBBIn3Wae7T0gDWHIUTjjaDygRgklznIUw5FEcToGYcDw-_e8qOxLSrccDX5hTFZx_yTUHDEp0ns9j0AqPCkrC4rYM6iPwaGFL0B0HtqFlOFWfjpHJ5Wk_uao6WJBOadsps9CrVnS9f0t3JRsjpPVN2faTqlxRyXq3pzSDaBw",
  "videoId": "1685483219914124",
  "latitude": "-6.2088",
  "longitude": "106.8456",
  "listingId": "2048296092514804",
  "sellerId": "61561287476399",
  "eventId": "520470144434103",
  "tab": "people",
  "url": "https://www.facebook.com/NASA",
  "maxItems": 100,
  "maxPages": 10,
  "splitItems": true,
  "concurrency": 3
}
```

# Actor output Schema

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

Scraped Facebook items. One dataset row per result (post, user, comment, hotel …) with a `_meta` object.

## `overview` (type: `string`):

Summary of the run: results, pages, not found, failed queries and stop reason.

# 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 = {
    "keyword": "coffee",
    "hashtag": "travel",
    "type": "location",
    "feedbackId": "ZmVlZGJhY2s6cGZiaWQwMktmSzJBUVFiTGRvcHhFRWVKSkZQN25rdHVIdHE0SnNFbnBtNXdxbnFyRXVlWFU0ZHAzRXI3dXpIelpqOFlmb29jNGFNNnI5NkVvaTZhV1VEdjczeGF6elRtNFo3d3U5NEVqbA==",
    "repliesToken": "MjoxNzk0NDkxOTg0OgF_GEXdotzAnd8xbMEBRHBJUnIIcUL3tBhgRn9X18HPHfHuY43bWXhxTt0iZN_pLaZFkrTLM4qa8r3Xm12iOVUfeDgyNI5O_jiXJ7D4UXrLQCCcx9cdKL_RuT00k491HN1pYWrrgaOFXUtF4DpaCeXMZoL40k_03JxDfVyuzmTpmfyVc0HoLT421z7wrffKqxGoIiXDL7NCW15u4M3evaznp62zDL0z9BDqGa1Vqpt8Xxc5iRHMIN4rYf2rwcScDAChPimKXmV3aNl1hMUHaaqkNBuNmEClGG8j0ImlyXlyOf1kfOj4iNUsGsH1kzsSttJtEIVJWpIKa3q3Lb5X3kI2EUKdl0arLJ-GMd2GCeBILFT20NCSjU7AseiKodMn3XB-BgYD3sX8gZZvub1lHmi9c2D3bwLM0k-9ds5RajOzN6tYorsJbCODUoypCmYnKEU645lOZMUj74u9mKXBBIn3Wae7T0gDWHIUTjjaDygRgklznIUw5FEcToGYcDw-_e8qOxLSrccDX5hTFZx_yTUHDEp0ns9j0AqPCkrC4rYM6iPwaGFL0B0HtqFlOFWfjpHJ5Wk_uao6WJBOadsps9CrVnS9f0t3JRsjpPVN2faTqlxRyXq3pzSDaBw",
    "videoId": "1685483219914124",
    "latitude": "-6.2088",
    "longitude": "106.8456",
    "listingId": "2048296092514804",
    "sellerId": "61561287476399",
    "eventId": "520470144434103",
    "tab": "people",
    "url": "https://www.facebook.com/NASA"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapysocial/facebook-scraper").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 = {
    "keyword": "coffee",
    "hashtag": "travel",
    "type": "location",
    "feedbackId": "ZmVlZGJhY2s6cGZiaWQwMktmSzJBUVFiTGRvcHhFRWVKSkZQN25rdHVIdHE0SnNFbnBtNXdxbnFyRXVlWFU0ZHAzRXI3dXpIelpqOFlmb29jNGFNNnI5NkVvaTZhV1VEdjczeGF6elRtNFo3d3U5NEVqbA==",
    "repliesToken": "MjoxNzk0NDkxOTg0OgF_GEXdotzAnd8xbMEBRHBJUnIIcUL3tBhgRn9X18HPHfHuY43bWXhxTt0iZN_pLaZFkrTLM4qa8r3Xm12iOVUfeDgyNI5O_jiXJ7D4UXrLQCCcx9cdKL_RuT00k491HN1pYWrrgaOFXUtF4DpaCeXMZoL40k_03JxDfVyuzmTpmfyVc0HoLT421z7wrffKqxGoIiXDL7NCW15u4M3evaznp62zDL0z9BDqGa1Vqpt8Xxc5iRHMIN4rYf2rwcScDAChPimKXmV3aNl1hMUHaaqkNBuNmEClGG8j0ImlyXlyOf1kfOj4iNUsGsH1kzsSttJtEIVJWpIKa3q3Lb5X3kI2EUKdl0arLJ-GMd2GCeBILFT20NCSjU7AseiKodMn3XB-BgYD3sX8gZZvub1lHmi9c2D3bwLM0k-9ds5RajOzN6tYorsJbCODUoypCmYnKEU645lOZMUj74u9mKXBBIn3Wae7T0gDWHIUTjjaDygRgklznIUw5FEcToGYcDw-_e8qOxLSrccDX5hTFZx_yTUHDEp0ns9j0AqPCkrC4rYM6iPwaGFL0B0HtqFlOFWfjpHJ5Wk_uao6WJBOadsps9CrVnS9f0t3JRsjpPVN2faTqlxRyXq3pzSDaBw",
    "videoId": "1685483219914124",
    "latitude": "-6.2088",
    "longitude": "106.8456",
    "listingId": "2048296092514804",
    "sellerId": "61561287476399",
    "eventId": "520470144434103",
    "tab": "people",
    "url": "https://www.facebook.com/NASA",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapysocial/facebook-scraper").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 '{
  "keyword": "coffee",
  "hashtag": "travel",
  "type": "location",
  "feedbackId": "ZmVlZGJhY2s6cGZiaWQwMktmSzJBUVFiTGRvcHhFRWVKSkZQN25rdHVIdHE0SnNFbnBtNXdxbnFyRXVlWFU0ZHAzRXI3dXpIelpqOFlmb29jNGFNNnI5NkVvaTZhV1VEdjczeGF6elRtNFo3d3U5NEVqbA==",
  "repliesToken": "MjoxNzk0NDkxOTg0OgF_GEXdotzAnd8xbMEBRHBJUnIIcUL3tBhgRn9X18HPHfHuY43bWXhxTt0iZN_pLaZFkrTLM4qa8r3Xm12iOVUfeDgyNI5O_jiXJ7D4UXrLQCCcx9cdKL_RuT00k491HN1pYWrrgaOFXUtF4DpaCeXMZoL40k_03JxDfVyuzmTpmfyVc0HoLT421z7wrffKqxGoIiXDL7NCW15u4M3evaznp62zDL0z9BDqGa1Vqpt8Xxc5iRHMIN4rYf2rwcScDAChPimKXmV3aNl1hMUHaaqkNBuNmEClGG8j0ImlyXlyOf1kfOj4iNUsGsH1kzsSttJtEIVJWpIKa3q3Lb5X3kI2EUKdl0arLJ-GMd2GCeBILFT20NCSjU7AseiKodMn3XB-BgYD3sX8gZZvub1lHmi9c2D3bwLM0k-9ds5RajOzN6tYorsJbCODUoypCmYnKEU645lOZMUj74u9mKXBBIn3Wae7T0gDWHIUTjjaDygRgklznIUw5FEcToGYcDw-_e8qOxLSrccDX5hTFZx_yTUHDEp0ns9j0AqPCkrC4rYM6iPwaGFL0B0HtqFlOFWfjpHJ5Wk_uao6WJBOadsps9CrVnS9f0t3JRsjpPVN2faTqlxRyXq3pzSDaBw",
  "videoId": "1685483219914124",
  "latitude": "-6.2088",
  "longitude": "106.8456",
  "listingId": "2048296092514804",
  "sellerId": "61561287476399",
  "eventId": "520470144434103",
  "tab": "people",
  "url": "https://www.facebook.com/NASA"
}' |
apify call scrapysocial/facebook-scraper --silent --output-dataset

```

## MCP server setup

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

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/zBEeUBlt0ynDceTV8/builds/x5npb6JhWqVNqHB2V/openapi.json
