# Facebook Profile Scraper (`api-ninja/facebook-profile-scraper`) Actor

Collect public Facebook posts, profile photos, and reels.

- **URL**: https://apify.com/api-ninja/facebook-profile-scraper.md
- **Developed by:** [API ninja](https://apify.com/api-ninja) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

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

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

## How to integrate an Actor?

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

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

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

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

# README

### What is Facebook Profile Scraper?

**Facebook Profile Scraper** collects **Facebook posts, profile photos, and reels** into a structured dataset. Choose a scraping mode, paste Facebook URLs or numeric IDs, and set how many results you want—then review, export, or use the data through the Apify API.

Use it to research public content, compare reel performance, monitor page engagement, or collect photo references. Start with one source and 20 results; you can schedule recurring runs and connect the output to your existing workflow when you're ready.

#### What can you do with this Facebook scraper?

- 📝 **Collect page posts and individual posts**, including captions, timestamps, author details, media references, and engagement counts when available.
- 📸 **Scrape profile photos** with photo IDs and image URLs, displayed as previews in the dataset.
- 🎬 **Extract profile reels** with descriptions, thumbnails, video links, duration, plays, and engagement metrics when available.
- 🔗 **Use URLs or numeric IDs**, with automatic profile resolution for photos and reels.
- 📚 **Paginate automatically**, collecting a limited sample or all results available through the service.
- 📅 **Filter page posts by date** to focus on a specific publication period.
- 📊 **Export structured data** as JSON, CSV, or Excel for spreadsheets, reporting, and analysis.

On [Apify](https://apify.com/), you also get run history, logs, scheduling, API access, and [integrations](https://docs.apify.com/integrations) with tools such as Make and Zapier.

**Choose the mode that matches your source:** posts mode supports public page feeds and individual post links. Photos and reels modes accept profile URLs or profile IDs. Personal profile post feeds are not supported.

### How to scrape Facebook posts, photos, and reels

1. Open the Actor in Apify Console and select the **Input** tab.
2. Choose **📝 Posts**, **📸 Photos**, or **🎬 Reels** under **Scraper mode**.
3. Add your Facebook URLs or numeric IDs to **Facebook URLs or IDs**. You can add multiple sources in one run.
4. Set **Maximum results per source**. Start with 20 to preview the output, or enable **Parse all results** to collect everything available through pagination.
5. For page posts, optionally choose a **Start date** and **End date**. Leave them empty if you don't want a date filter.
6. Click **Start** and follow progress in the run logs.
7. Open the dataset to review your results. Choose the **Photos** view for image previews or **Reels** for thumbnails, video links, and engagement.
8. Export the dataset or retrieve it through the API.

Each run uses one scraping mode. Run the Actor separately for posts, photos, and reels if you need all three.

### Input settings

| Setting                       | JSON field        | What it does                                                                                             |
| ----------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------- |
| 🎯 Scraper mode               | `scraperMode`     | Choose `posts`, `photos`, or `reels`. Defaults to `posts`.                                               |
| 🔗 Facebook URLs or IDs       | `urls`            | Required list of source URLs or numeric IDs. Use strings for IDs.                                        |
| 📌 Maximum results per source | `maxResults`      | Positive integer limiting saved items for each source. The input schema default is 20.                   |
| ♾️ Parse all results          | `parseAllResults` | Continue until no more results are available. Defaults to `false`; when enabled, overrides `maxResults`. |
| 📅 Start date                 | `startDate`       | Optional inclusive start date in `YYYY-MM-DD` format. Applies to page posts only.                        |
| 🗓️ End date                   | `endDate`         | Optional inclusive end date in `YYYY-MM-DD` format. Applies to page posts only.                          |

The result limit applies **per source**, not to the entire run. Three sources with `maxResults: 20` can produce up to 60 items. Sources with fewer available items return fewer results.

Direct post links return one post each, regardless of the result limit or date filters. Photos and reels ignore date filters. When both dates are supplied for posts, the start date must not be later than the end date.

For predictable API runs, set `maxResults` explicitly. The schema default is 20; if input reaches the scraper without that field or schema defaults, its runtime fallback is 100.

#### Which Facebook links are supported?

| Mode                      | Input examples                                                                      |
| ------------------------- | ----------------------------------------------------------------------------------- |
| Posts: page feed          | `https://www.facebook.com/facebook/` or a numeric page ID such as `100064860875397` |
| Posts: individual content | A full post permalink, photo link, video link, or reel link                         |
| Photos                    | A profile URL or numeric profile ID                                                 |
| Reels                     | A profile URL such as `https://www.facebook.com/zuck` or a numeric profile ID       |

Posts mode recognizes `/posts/` links, group post permalinks, `permalink.php` and `story.php` URLs with `story_fbid`, photo links, video/watch/reel links, `/share/p/`, `/share/v/`, `/share/r/`, and `fb.watch` links. Facebook mobile subdomains are supported. Link recognition does not guarantee that the service can retrieve the content.

A page tab such as `/facebook/posts/` remains a page input. Numeric IDs in posts mode identify pages, not individual posts. In photos and reels modes, provide the profile itself rather than a link to one photo or reel.

### Input and output examples

The following examples illustrate the output structure. Media URLs are placeholders, and fields and values vary with the content returned by the service.

#### 📸 Scrape Facebook photos

Use a numeric profile ID to collect photos without an initial profile URL lookup:

```json
{
    "scraperMode": "photos",
    "urls": ["100008483409625"],
    "maxResults": 20,
    "parseAllResults": false
}
```

Example dataset item:

```json
{
    "type": "page_photo",
    "id": "4303979329894805",
    "uri": "https://example.com/photo.jpg",
    "scraperMode": "photos",
    "sourceInput": "100008483409625",
    "profile_id": "100008483409625",
    "collection_id": "collection-returned-by-service"
}
```

The **Photos** dataset view displays `uri` as an image preview, alongside the photo ID, profile ID, and source. Pagination automatically passes the cursor and collection ID from the previous response.

#### 🎬 Scrape Facebook reels

Provide a profile URL. The Actor resolves the profile's reels collection before fetching the videos:

```json
{
    "scraperMode": "reels",
    "urls": ["https://www.facebook.com/zuck"],
    "maxResults": 20,
    "parseAllResults": false
}
```

Example dataset item:

```json
{
    "type": "reel",
    "video_id": "1065929982895611",
    "post_id": "10117982926388161",
    "url": "https://www.facebook.com/reel/1065929982895611/",
    "description": "A creator update.",
    "timestamp": 1790208566,
    "length_in_seconds": 122.176,
    "browser_native_hd_url": "https://example.com/reel.mp4",
    "thumbnail_uri": "https://example.com/thumbnail.jpg",
    "play_count": 4400000,
    "comments_count": 31136,
    "reactions_count": 197024,
    "reshare_count": 12000,
    "author": {
        "id": "4",
        "name": "Mark Zuckerberg",
        "url": "https://www.facebook.com/zuck",
        "profile_picture_url": "https://example.com/author.jpg"
    },
    "scraperMode": "reels",
    "sourceInput": "https://www.facebook.com/zuck",
    "profile_id": "4"
}
```

The **Reels** view puts thumbnails, captions, reel links, HD video links, duration, plays, and engagement metrics together in one table.

#### 📝 Scrape Facebook page posts

Collect page posts within a date range:

```json
{
    "scraperMode": "posts",
    "urls": ["https://www.facebook.com/facebook/"],
    "maxResults": 20,
    "parseAllResults": false,
    "startDate": "2026-01-01",
    "endDate": "2026-01-31"
}
```

Example dataset item:

```json
{
    "post_id": "123456789012345",
    "type": "post",
    "url": "https://www.facebook.com/facebook/posts/123456789012345",
    "message": "An update from our community.",
    "timestamp": 1768478400,
    "comments_count": 25,
    "reactions_count": 300,
    "reshare_count": 12,
    "author": {
        "id": "100064860875397",
        "name": "Facebook",
        "url": "https://www.facebook.com/facebook",
        "profile_picture_url": "https://example.com/facebook.jpg"
    }
}
```

Posts can also include reaction breakdowns, rich text, image and video objects, album previews, external links, attached posts or events, and comment/share identifiers. Direct-post responses can contain additional fields, such as `authors` and `top_comments`, when supplied by the service.

Each content item becomes one dataset row. Photos and reels include the source input and resolved profile ID; post objects retain their upstream structure. Profile lookup details such as biographies are not saved as separate results.

### How much does scraping Facebook cost?

Check this Actor's **Pricing** tab for its current billing model, rates, and any trial offer. The number of results you can collect within your budget depends on those rates and your Apify plan. Any free usage depends on current trial offers and the credits available in your account.

Start with one source and `maxResults: 20`, review the output and run charges, then scale up. For example, collecting up to 20 items from each of 10 sources gives you a target of up to 200 saved items. This describes the collection size, not a guaranteed price: consult the Pricing tab for which results, events, or resources are billed.

To keep usage predictable:

- Set a result limit before running a large source list.
- Enable **Parse all results** only when you need the full available history.
- Use date filters for page posts when you're researching a specific period.
- Review a small run before creating a recurring schedule.

### Facebook scraper API and integrations

Use the Actor's **API** tab to copy a request for this Actor or find examples for your preferred language. API runs accept the same JSON input shown above.

A typical automated workflow starts a run, waits for completion, and retrieves items from the run's default dataset. You can use those results in Python, JavaScript, spreadsheets, or a reporting pipeline.

With Apify, you can also:

- **Schedule recurring runs** to collect content at regular intervals.
- **Connect Make or Zapier** to move results into other tools.
- **Use webhooks** to trigger the next step when a run finishes.
- **Export datasets** for content analysis and engagement reporting.

For setup options, see [Apify integrations](https://docs.apify.com/integrations).

### Frequently asked questions

#### Can I scrape personal Facebook profile posts?

Personal profile post feeds are not supported. Posts mode collects public page feeds or retrieves individual content links when available. Photos and reels modes collect the media available through the profile endpoints.

#### Can I collect all photos or reels from a profile?

Enable `parseAllResults` to keep following pagination until the service returns no more results. This collects everything the service makes available, which may be less than the full content visible to a logged-in Facebook user. The Actor also stops photo or reel pagination if a cursor repeats.

#### Can I filter photos or reels by date?

Date filters apply only to page posts. For photos and reels, filter the exported data afterward where the output contains a suitable date. Photo results do not include a publication timestamp in the documented response.

#### Does the Actor download photos and videos?

It saves media URLs and metadata. It does not download image or video files. Facebook media URLs may expire, so retrieve the files separately if you need a lasting copy and have permission to keep it.

#### Does it scrape comments or profile biographies?

It can return comment counts and any comment previews included in a post response. It does not paginate full comment threads. Profile details are used to resolve media collections; biographies and other profile details are not saved as profile records.

For dedicated comment collection or page details, use the related Actors below.

#### Why did my run return fewer results than requested?

`maxResults` is an upper limit. A source may have fewer accessible items, the date range may exclude posts, or the service may stop providing pagination. Private, deleted, and restricted content may be unavailable. An empty first page without a cursor is checked once more after three seconds before the Actor finishes with no items.

#### What happens if a request fails?

The Actor makes up to four attempts per request, with a 30-second timeout for each attempt. Rate-limit responses use short cooldowns or the provider's `Retry-After` value. Explicit quota exhaustion or a requested cooldown longer than 60 seconds stops retries with an error.

Check the run logs for the affected source and request. A failed source stops further processing; items already saved remain in the dataset. To retry, start another run with the affected sources. Restarting does not resume pagination from the previous run and may collect the same items again.

#### What does “Missing RapidAPI key” mean?

The Actor requires `RAPID_API_KEY` or `RAPIDAPI_KEY` in its environment. If you run your own copy, configure the key there rather than in the input JSON. If you encounter this error on the hosted Store Actor, report it through the Actor's **Issues** tab so the maintainer can check its configuration.

#### What should I check when a Facebook URL fails?

Confirm that the selected mode matches the input: page or post links for posts, profile URLs or IDs for photos and reels. For an individual post, try the full permalink instead of a shared or shortened link. Check date order and the logs for quota, rate-limit, or access errors.

#### How should I use the collected data?

Collect and use content you are permitted to access, in accordance with applicable laws, privacy obligations, and Facebook's terms. Public availability does not by itself grant permission to republish media or use personal data for every purpose.

### More Facebook Actors

Extend your workflow with these related tools:

| Actor                                                                              | Use it for                                                          |
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| [Facebook Posts Scraper](https://apify.com/api-ninja/facebook-posts-scraper)       | A dedicated workflow for page posts and individual post links.      |
| [Facebook Comments Scraper](https://apify.com/api-ninja/facebook-comments-scraper) | Collecting comments and optional reply threads from Facebook posts. |
| [Facebook Pages Scraper](https://apify.com/api-ninja/facebook-pages-scraper)       | Collecting Facebook page details for research and enrichment.       |

### Support and feedback

For a bug report or feature request, open the Actor's **Issues** tab. Include the run ID, selected mode, source URL or ID, and a short description of what you expected. Remove credentials and unnecessary personal information before sharing input or logs.

For a custom workflow, describe the sources, fields, and output you need so the maintainer can assess the request.

# Actor input Schema

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

Posts retains the page feed and direct-post behavior. Photos collects profile photos. Reels collects profile reels.

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

In posts mode: public page URLs, numeric page IDs, or direct post links. In photos/reels mode: profile URLs or numeric profile IDs.

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

Maximum posts, photos, or reels to save for each source. Ignored when Parse all results is enabled. Direct post links return one post.

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

Continue pagination until the source has no more available posts, photos, or reels. Does not apply to direct post links.

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

Optional. Only collect page posts published on or after this date in YYYY-MM-DD format. Does not apply to direct post URLs. Posts mode only; ignored for photos and reels.

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

Optional. Only collect page posts published on or before this date in YYYY-MM-DD format. Does not apply to direct post URLs. Posts mode only; ignored for photos and reels.

## Actor input object example

```json
{
  "scraperMode": "posts",
  "urls": [
    "https://www.facebook.com/facebook/"
  ],
  "maxResults": 20,
  "parseAllResults": false,
  "startDate": "2026-01-01",
  "endDate": "2026-01-31"
}
```

# 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/facebook/"
    ],
    "startDate": "2026-01-01",
    "endDate": "2026-01-31"
};

// Run the Actor and wait for it to finish
const run = await client.actor("api-ninja/facebook-profile-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/facebook/"],
    "startDate": "2026-01-01",
    "endDate": "2026-01-31",
}

# Run the Actor and wait for it to finish
run = client.actor("api-ninja/facebook-profile-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 '{
  "urls": [
    "https://www.facebook.com/facebook/"
  ],
  "startDate": "2026-01-01",
  "endDate": "2026-01-31"
}' |
apify call api-ninja/facebook-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,api-ninja/facebook-profile-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/cwVenCaAYLf39poPR/builds/vMHk5LqJ5kkKdPH4O/openapi.json
