# All-in-One Facebook Scraper (`thenetaji/facebook-scraper`) Actor

Collects public Facebook Pages, posts, followers and following, videos, photo albums and Marketplace listings through a single Actor. The mode is selected per run; each mode takes its own input and returns that dataset's fields, with optional enrichment attached to each row.

- **URL**: https://apify.com/thenetaji/facebook-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** Social media, E-commerce, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## All-in-One Facebook Scraper

The Actor collects seven Facebook datasets — a Page's profile, its timeline posts, its followers or following list, its videos, its photo albums, Marketplace browse listings, and individual Marketplace listing lookups — through a single run configuration. The dataset is chosen with `scraperType`; each mode reads its own input and returns that dataset's fields.

Callers who only ever need one of these are better served by the focused Actor for it, listed at the end. This Actor exists for workflows that need several, or that would rather integrate once.

Everything it returns comes from what Facebook serves to a logged-out, anonymous visitor. No Facebook account, login, or session cookie is used at any point.

### Modes

| Mode | scraperType value | Key input | Returns |
| --- | --- | --- | --- |
| Page profile | `pageProfile` | `page` | One record per Page: its numeric ID, permalink, and — where requested — its About section and Page Transparency details |
| Page posts | `pagePosts` | `page` | One record per timeline post: its text, creation time, and permalink |
| Followers/following | `pageCollection` | `page`, `collection` | The accounts following the Page, or the accounts it follows, with the Page's reported total on every row |
| Videos | `pageVideos` | `page` | One record per video: its ID and a composed watch link — Facebook's logged-out video list exposes nothing further |
| Photo albums | `pageAlbums` | `page` | One record per album: title, cover image, and link |
| Marketplace browse | `marketplaceListings` | `category` (optional) | The listings on Marketplace's home feed, or a category feed, as Facebook serves them for the request |
| Marketplace listing | `marketplaceItem` | `itemId` | One record per listing ID or URL supplied, with its full detail record |

`scraperType` is the only required input. Each mode raises a clear error when the identifier it needs is absent, so an otherwise empty run fails immediately rather than returning an unexpected dataset.

```json
{
  "scraperType": "pageProfile",
  "page": ["NASA", "https://www.facebook.com/unicef/"],
  "includeAbout": true,
  "includeTransparency": false
}
```

### Enrichment

Two optional add-ons attach related records to rows that would otherwise carry only a thin one. Each is opt-in, off by default, and costs one extra request per enriched row.

| Add-on | Mode | Attaches | Cost |
| --- | --- | --- | --- |
| `addonAccountProfile` | Followers/following | The listed account's own Page record and About details, under `accountProfile` | $0.006 per enriched row |
| `addonListingDetails` | Marketplace browse | The browsed listing's full detail record, under `listingDetails` | $0.0008 per enriched row |

Both are charged only for a row that is actually enriched; a lookup that fails leaves the row without the attached field and is not billed. Marketplace listing lookups (`marketplaceItem`) always return a full detail record and need no add-on to get one.

### Limits

`maxItems` bounds the number of records saved by the paginating modes — posts, followers/following, videos, albums, and Marketplace browse and listing lookups. Page profile lookups return one row per Page and ignore it. `maxItems` applies per Page where the mode reads several Pages, so with several Pages supplied a low value is spent on the first Page in the list before any later one is reached. Setting it to `0` continues until Facebook stops returning a next page, where a next page exists.

Marketplace browse has no logged-out pagination beyond its first batch of roughly 20 listings, so `maxItems` above that count does not produce more rows in that mode — it can only trim the batch down.

### Behaviour worth knowing

**Videos are sparse by design, not by omission.** Facebook's logged-out video list returns only a video's ID and owner; titles, dates, durations, and thumbnails are not present in that response at any depth, so `pageVideos` does not claim them.

**Marketplace browse is regional and unpaginated.** Results reflect where the request is understood to be browsing from, so the same category can return a different set of listings between runs, and there is no next page beyond the first roughly-20-listing batch.

**About and Transparency are flat maps, not fixed columns.** `about` and `transparency` on the Page profile mode are keyed by Facebook's own field names — category, contact details, website links, and similar — and are `null` when their toggle is off or Facebook's own document did not carry that section for the Page.

**Post comments are not offered.** Facebook exposes no logged-out paginator for post comments, so no mode returns a comment thread.

**A Page that cannot be resolved is skipped, not fatal.** Whether the username or ID does not exist, or the Page is not public, that Page is logged as a warning and the run continues with the rest of the input list.

### Focused alternatives

| Actor | Use instead when |
| --- | --- |
| [Facebook Page Scraper](https://apify.com/thenetaji/facebook-page-scraper) | Only Page profile, About, or Transparency details are needed |
| [Facebook Posts Scraper](https://apify.com/thenetaji/facebook-posts-scraper) | Only timeline posts are needed |
| [Facebook Followers/Following Scraper](https://apify.com/thenetaji/facebook-followers-following-scraper) | Only followers or following lists are needed |
| [Facebook Videos Scraper](https://apify.com/thenetaji/facebook-videos-scraper) | Only a Page's videos are needed |
| [Facebook Photo Albums Scraper](https://apify.com/thenetaji/facebook-albums-scraper) | Only a Page's photo albums are needed |
| [Facebook Marketplace Scraper](https://apify.com/thenetaji/facebook-marketplace-scraper) | Only Marketplace browsing is needed |
| [Facebook Marketplace Item Scraper](https://apify.com/thenetaji/facebook-marketplace-item-scraper) | Only specific Marketplace listings are needed |

# Actor input Schema

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

Choose the dataset for this run, then fill in the section for that mode below.

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

A Facebook Page's username (the part after facebook.com/) or its numeric ID.

## `includeAbout` (type: `boolean`):

Adds the Page's About section — category, contact details, website and social links, and business information where the Page is a business.

## `includeTransparency` (type: `boolean`):

Adds Page Transparency details — creation date, admin country information, ad status and confirmed owner.

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

Collect the accounts following the Page, or the accounts the Page itself follows.

## `addonAccountProfile` (type: `boolean`):

Swap each follower/following row's thin record for that account's full public profile and About details. Adds one request and a billable event per row.

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

Optional Marketplace category slug, for example `vehicles` or `electronics`. Leave empty to browse everything.

## `addonListingDetails` (type: `boolean`):

Attach each browsed Marketplace listing's full detail record. Adds one request and a billable event per listing.

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

The numeric ID of a Marketplace listing, taken from its facebook.com/marketplace/item/<id>/ URL.

## `includeRelated` (type: `boolean`):

Adds the related listings Facebook shows alongside the requested Marketplace listing.

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

Maximum records to save. Set `0` to continue until no further records are available.

## Actor input object example

```json
{
  "scraperType": "pageProfile",
  "page": "NASA",
  "includeAbout": true,
  "includeTransparency": false,
  "collection": "followers",
  "addonAccountProfile": false,
  "addonListingDetails": false,
  "includeRelated": false,
  "maxItems": 20
}
```

# Actor output Schema

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

All records scraped by this run

# 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 = {
    "page": "NASA",
    "category": "",
    "itemId": "",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/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 = {
    "page": "NASA",
    "category": "",
    "itemId": "",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/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 '{
  "page": "NASA",
  "category": "",
  "itemId": "",
  "maxItems": 20
}' |
apify call thenetaji/facebook-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thenetaji/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/rI8TjbITCRpu7lz2M/builds/BBvNAL4a4IH7FfeFe/openapi.json
