# Facebook Pages Scraper (`api-ninja/facebook-pages-scraper`) Actor

📘 Extract Facebook page posts, photos, reviews, reels, videos, events, and page details from one or more page URLs, handles, or IDs.

- **URL**: https://apify.com/api-ninja/facebook-pages-scraper.md
- **Developed by:** [API ninja](https://apify.com/api-ninja) (community)
- **Categories:** Social media, Automation, Developer tools
- **Stats:** 26 total users, 23 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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.
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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

### What does Facebook Pages Scraper do?

**Facebook Pages Scraper** helps you extract public data from [Facebook Pages](https://www.facebook.com/) using a page URL, handle, or numeric page ID. It can collect **posts, photos, reviews, reels, videos, future events, past events, and page details** from one or more Facebook pages in a single run.

You can run it directly on Apify, export results via API, schedule recurring runs, connect it to automation tools, and monitor runs from one place. It is designed for teams that need page data in a structured format without building and maintaining their own Facebook page scraping workflow.

### Why use Facebook Pages Scraper?

Facebook page data is useful for market research, local business monitoring, social media tracking, and lead enrichment. This Actor helps you collect public page activity and metadata in a format that is easier to analyze than browsing pages manually.

Common use cases:

- Track new posts published by restaurants, stores, venues, and brands.
- Collect public reviews and recommendation signals for reputation analysis.
- Monitor reels and videos published by competitor or partner pages.
- Export page details such as follower counts, contact details, categories, and website links.
- Keep an eye on upcoming or past events posted by public Facebook pages.

Because it runs on Apify, you also get scheduling, API access, integrations, run history, monitoring, and dataset export in multiple formats.

### How to use Facebook Pages Scraper

1. Open the Actor on Apify and go to the **Input** tab.
2. Add one or more Facebook page references into the `urls` field.
3. Use a full page URL like `https://www.facebook.com/copperkettleyqr/`, a handle like `copperkettleyqr`, or a numeric page ID.
4. Choose the data type you want to extract: posts, photos, videos, reels, reviews, future events, past events, or page details.
5. If you selected posts, optionally set `startDate` and `endDate` in `YYYY-MM-DD` format.
6. Set `maxResults` if you want to limit results per page, or enable `parseAllResults` to paginate until no more data is available.
7. Start the Actor and wait for the run to finish.
8. Open the **Storage** tab to inspect the dataset, or export it as JSON, CSV, Excel, XML, or HTML.

### Input

Configure the Actor in the **Input** tab. The current input supports these main fields:

- `urls`: One or more Facebook page URLs, handles, or numeric page IDs.
- `type`: The page resource to extract.
- `maxResults`: Maximum number of items to save per page when pagination is limited.
- `parseAllResults`: When enabled, the Actor keeps paginating until no more results are available.
- `startDate`: Optional lower date bound for post collection.
- `endDate`: Optional upper date bound for post collection.

Notes:

- `startDate` and `endDate` only apply when `type` is set to `posts`.
- If both dates are provided, `startDate` must be earlier than or equal to `endDate`.
- Some resource types require a page URL or handle rather than a numeric ID, because the Actor first resolves extra page-level metadata before collecting the final results.
- Personal profiles and Facebook groups are not supported by this Actor.

Example input:

```json
{
  "urls": [
    "https://www.facebook.com/copperkettleyqr/",
    "copperkettleyqr"
  ],
  "type": "posts",
  "maxResults": 100,
  "parseAllResults": false,
  "startDate": "2026-05-01",
  "endDate": "2026-05-15"
}
````

### Output

The Actor stores results in the default Apify dataset. The output structure depends on the selected `type`.

Example output for `posts`:

```json
{
  "post_id": "1371481031662792",
  "type": "post",
  "url": "https://www.facebook.com/copperkettleyqr/posts/...",
  "message": "Our classic turkey dinner is now available for a limited time.",
  "timestamp": 1775309548,
  "comments_count": 0,
  "reactions_count": 3,
  "reshare_count": 0,
  "author": {
    "id": "100064027242849",
    "name": "The Copper Kettle Restaurant",
    "url": "https://www.facebook.com/copperkettleyqr"
  }
}
```

You can download the dataset in various formats such as **JSON, HTML, CSV, or Excel**.

### Data table

Below are some of the main fields the Actor can return across supported page resource types:

| Field | Description |
| --- | --- |
| `page_id` | Facebook page ID |
| `name` | Page or event name |
| `url` | Public URL of the page, post, event, reel, or video |
| `post_id` | Post or review identifier |
| `video_id` | Reel or video identifier |
| `message` | Post or review text |
| `description` | Reel or video description |
| `timestamp` | Unix timestamp of the item |
| `comments_count` | Number of comments |
| `reactions_count` | Number of reactions |
| `reshare_count` | Number of reshares |
| `play_count` | Number of plays for reels or videos |
| `followers` | Page follower count |
| `verified` | Whether the page is verified |
| `categories` | Page categories |
| `services` | Services listed on the page |
| `event_place.location` | Event location text |

### Pricing / Cost estimation

How much does it cost to scrape Facebook page data?

The cost depends mainly on:

- How many page references you provide
- Which `type` you select
- Whether you enable `parseAllResults`
- How many pages of results are available for each Facebook page

Small runs that fetch page details or a limited number of posts are usually inexpensive. Larger runs that paginate deeply through posts, reels, videos, or events will consume more platform resources. If you want predictable costs, set `maxResults` and keep `parseAllResults` disabled.

### Tips and advanced options

- Use full page URLs when possible for the clearest input.
- Use `maxResults` during testing so you can validate the output shape quickly.
- Enable `parseAllResults` only when you truly need the complete archive available from the selected endpoint.
- When scraping posts within a time window, provide both `startDate` and `endDate` to reduce unnecessary pagination.
- If you need regular monitoring, schedule the Actor to run automatically and connect the dataset to your downstream workflow.

### FAQ, disclaimers, and support

#### Does this Actor scrape personal profiles?

No. It is intended for supported public Facebook Pages only.

#### Does it support multiple pages in one run?

Yes. The Actor processes page references one by one and stores all results in the same dataset.

#### Can I use a page handle instead of a full URL?

Yes. Handles such as `copperkettleyqr` are supported.

#### Is it legal to scrape Facebook page data?

You are responsible for using this Actor in compliance with applicable laws, website terms, and the rules of your use case. Only collect and use data you are allowed to process.

#### What if a page returns fewer items than expected?

That can happen when the page has limited public content, the selected resource type is sparse, or pagination reaches the end of available results.

If you need help or want a custom version, use the **Issues** tab on the Actor page or request a tailored solution for your workflow.

# Actor input Schema

## `urls` (type: `array`):

Add one or more Facebook page references. You can paste a full page URL, a page handle such as stolvik, or a numeric page ID. Personal profiles and Facebook groups are not supported.

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

Choose whether to extract group posts, upcoming events, or the group profile details.

## `maxResults` (type: `integer`):

Choose how many items to save for each group. Applies to posts and future events. Ignored when Parse All Results is enabled.

## `parseAllResults` (type: `boolean`):

When enabled, the Actor keeps paginating until there are no more posts or future events available. Group Details always returns a single result per group.

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

Optional. Only collect posts published on or after this date in YYYY-MM-DD format. Only applies to posts.

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

Optional. Only collect posts published on or before this date in YYYY-MM-DD format. Only applies to posts.

## Actor input object example

```json
{
  "urls": [
    "https://www.facebook.com/copperkettleyqr/"
  ],
  "type": "posts",
  "maxResults": 20,
  "parseAllResults": false
}
```

# Actor output Schema

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

No description

# 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 = {
    "urls": [
        "https://www.facebook.com/copperkettleyqr/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("api-ninja/facebook-pages-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 = { "urls": ["https://www.facebook.com/copperkettleyqr/"] }

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

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

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

```

## CLI example

```bash
echo '{
  "urls": [
    "https://www.facebook.com/copperkettleyqr/"
  ]
}' |
apify call api-ninja/facebook-pages-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=api-ninja/facebook-pages-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Pages Scraper",
        "description": "📘 Extract Facebook page posts, photos, reviews, reels, videos, events, and page details from one or more page URLs, handles, or IDs.",
        "version": "0.0",
        "x-build-id": "DN23UeY4AoGsPbvb3"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/api-ninja~facebook-pages-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-api-ninja-facebook-pages-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/api-ninja~facebook-pages-scraper/runs": {
            "post": {
                "operationId": "runs-sync-api-ninja-facebook-pages-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/api-ninja~facebook-pages-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-api-ninja-facebook-pages-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "🔗 Facebook Page URLs, Handles, or IDs",
                        "type": "array",
                        "description": "Add one or more Facebook page references. You can paste a full page URL, a page handle such as stolvik, or a numeric page ID. Personal profiles and Facebook groups are not supported.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "type": {
                        "title": "🧩 Data to Extract",
                        "enum": [
                            "posts",
                            "photos",
                            "videos",
                            "reels",
                            "reviews",
                            "future_events",
                            "past_events",
                            "page_details"
                        ],
                        "type": "string",
                        "description": "Choose whether to extract group posts, upcoming events, or the group profile details.",
                        "default": "posts"
                    },
                    "maxResults": {
                        "title": "Maximum Results per Group",
                        "minimum": 20,
                        "type": "integer",
                        "description": "Choose how many items to save for each group. Applies to posts and future events. Ignored when Parse All Results is enabled.",
                        "default": 20
                    },
                    "parseAllResults": {
                        "title": "Parse All Results",
                        "type": "boolean",
                        "description": "When enabled, the Actor keeps paginating until there are no more posts or future events available. Group Details always returns a single result per group.",
                        "default": false
                    },
                    "startDate": {
                        "title": "Start date",
                        "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
                        "type": "string",
                        "description": "Optional. Only collect posts published on or after this date in YYYY-MM-DD format. Only applies to posts."
                    },
                    "endDate": {
                        "title": "End date",
                        "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
                        "type": "string",
                        "description": "Optional. Only collect posts published on or before this date in YYYY-MM-DD format. Only applies to posts."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
