# Facebook User Posts Scraper (`powerai/facebook-user-posts-scraper`) Actor

Export posts from a Facebook profile timeline with text, media hints, engagement, and optional date filters.

- **URL**: https://apify.com/powerai/facebook-user-posts-scraper.md
- **Developed by:** [PowerAI](https://apify.com/powerai) (community)
- **Categories:** Social media, Integrations, Other
- **Stats:** 31 total users, 1 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $4.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Facebook User Posts Scraper

Collect **posts from a Facebook profile timeline** (user or Page-style profile) using its **numeric profile id**. Each dataset row is one post with text, links, engagement counts, author info, and media-related fields when returned.

### Who it’s for

- **Researchers** sampling what a profile published over time.
- **Social teams** tracking posts in a spreadsheet-friendly format.
- **Automation** that already stores profile ids from search or directory data.

### What you can do with it

- **Target one profile** with its **numeric id**.
- **Optionally bound the time range** with start and end dates.
- **Collect up to your chosen cap**; the run loads successive batches until the limit is reached or there are no more rows.

### How it works (in plain terms)

You enter the **profile id**, any **date range**, and a **maximum row count**. The tool retrieves posts in batches and continues automatically while more rows exist and your cap allows—you do not manage paging yourself.

### Input

| Field | Required | What it means |
|-------|----------|----------------|
| **Profile ID** (`profileId`) | Yes | Numeric id of the profile whose posts you want. |
| **Start date** (`startDate`) | No | Earliest post date to include (`yyyy-mm-dd`). |
| **End date** (`endDate`) | No | Latest post date to include (`yyyy-mm-dd`). |
| **Maximum results** (`maxResults`) | No | Upper limit on how many post rows to save (default **50**). |

### Output

- **One row per post** (until your cap). Duplicate **`post_id`** values in the same run are skipped when the same id appears again.
- **Post**: **`post_id`**, **`type`**, **`url`** (often a `/posts/pfbid…` style link), **`message`**, **`message_rich`** (often matches **`message`**), **`timestamp`** (Unix-style seconds), **`comments_count`**, **`reactions_count`**, **`reshare_count`**.
- **Reactions breakdown**: **`reactions`** with **`like`**, **`love`**, **`care`**, **`haha`**, **`wow`**, **`sad`**, **`angry`** when returned.
- **Author**: **`author`** with **`id`**, **`name`**, **`url`**, **`profile_picture_url`**. **`author_title`** may be **`null`** or a string when shown.
- **Media / attachments**: **`image`**, **`video`**, **`video_files`**, **`video_thumbnail`**, **`album_preview`** (often **`null`** or an **array** of photo objects with **`type`**, **`image_file_uri`**, **`url`**, **`id`**), **`external_url`**, **`attached_event`**, **`attached_post`**, **`attached_post_url`**, **`text_format_metadata`**.
- **Thread ids**: **`comments_id`**, **`shares_id`** (often aligned with **`post_id`** for text posts).
- **Extra fields**: rows may include **additional properties** beyond those listed.
- **Export metadata**: **`requestedProfileId`** repeats the profile id used for that run; **`startDate`** / **`endDate`** appear only when you set those inputs; **`scrapedAt`** is when that row was saved.

Field availability depends on each post. Details may change as the product evolves.

#### Sample output (one dataset row, from a real run)

```json
{
  "post_id": "10117392482806831",
  "type": "post",
  "url": "https://www.facebook.com/zuck/posts/pfbid02jmTqf1BDUZ8mokazNfpdrNeqZZSzMjVxHSVbAQAtt9tBmPgbs2GRd834yvAtS1qml",
  "message": "Always a great time seeing these legends fight. Congrats Charles Oliveira, Caio Borralho, and Drew Dober. Max Holloway is always impressive. Best sport in the world.",
  "message_rich": "Always a great time seeing these legends fight. Congrats Charles Oliveira, Caio Borralho, and Drew Dober. Max Holloway is always impressive. Best sport in the world.",
  "timestamp": 1772990946,
  "comments_count": 32815,
  "reactions_count": 110628,
  "reshare_count": 3583,
  "reactions": {
    "angry": 117,
    "care": 2244,
    "haha": 413,
    "like": 91463,
    "love": 15924,
    "sad": 46,
    "wow": 421
  },
  "author": {
    "id": "4",
    "name": "Mark Zuckerberg",
    "url": "https://www.facebook.com/zuck",
    "profile_picture_url": "https://scontent.fmii9-1.fna.fbcdn.net/v/t39.30808-1/632598281_10117314650513371_3238643608998008744_n.jpg?stp=cp0_dst-jpg_s40x40_tt6&_nc_cat=1&ccb=1-7&_nc_sid=1d2534&_nc_ohc=4sY_KvrH0F8Q7kNvwFax3qt&_nc_oc=AdrrLTdpioxPVCCjEM-DnszjUNxz52cCJ513zMP_Yh1vGXQA7Is44tgOxryuc2jX-ko&_nc_zt=24&_nc_ht=scontent.fmii9-1.fna&_nc_gid=Q8TKo8ulbIea3H-6yk-VOA&_nc_ss=7a30f&oh=00_Afw3sOWUpAn-iYinbKzvSc0mIB70y9LzuEv3XLBsvN5t7A&oe=69CAA1CB"
  },
  "author_title": null,
  "image": null,
  "video": null,
  "album_preview": [
    {
      "type": "photo",
      "image_file_uri": "https://scontent.fmii9-1.fna.fbcdn.net/v/t39.30808-6/649197944_10117392482532381_455117239230536738_n.jpg?_nc_cat=107&ccb=1-7&_nc_sid=7b2446&_nc_ohc=DH8qz1faM4AQ7kNvwG1y1Lx&_nc_oc=AdqR4tv0Op7HIUxeyGwfqh3Whpc-CSy9a8OB66YooQRefVpthf25oIoAkkYsxzHBRxs&_nc_zt=23&_nc_ht=scontent.fmii9-1.fna&_nc_gid=Q8TKo8ulbIea3H-6yk-VOA&_nc_ss=7a30f&oh=00_AfymgvaqsP0Li6vhp2xOWei8HjufCQ-QadmAlAXKiM3iIg&oe=69CAA3E7",
      "url": "https://www.facebook.com/photo.php?fbid=10117392482522401&set=a.529237706231&type=3",
      "id": "10117392482522401"
    },
    {
      "type": "photo",
      "image_file_uri": "https://scontent.fmii9-1.fna.fbcdn.net/v/t39.30808-6/649137739_10117392482736971_8799999883045095676_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=7b2446&_nc_ohc=dJ-9e44tFgkQ7kNvwEzPzv8&_nc_oc=AdrZesyDCpcoVbl8JMgNHmKaSMde_hcM518QGW9x0Rok9H-H84ItZKIg3NbyI4bLP20&_nc_zt=23&_nc_ht=scontent.fmii9-1.fna&_nc_gid=Q8TKo8ulbIea3H-6yk-VOA&_nc_ss=7a30f&oh=00_AfxgRUf3m9qsXhHVoqDU-KO99FHdPU-Y2SfBcWUXiFryCw&oe=69CAA526",
      "url": "https://www.facebook.com/photo.php?fbid=10117392482731981&set=a.529237706231&type=3",
      "id": "10117392482731981"
    }
  ],
  "video_files": null,
  "video_thumbnail": null,
  "external_url": null,
  "attached_event": null,
  "attached_post": null,
  "attached_post_url": null,
  "text_format_metadata": null,
  "comments_id": "10117392482806831",
  "shares_id": "10117392482806831",
  "requestedProfileId": "4",
  "scrapedAt": "2026-03-26T06:16:46.601Z"
}
```

# Actor input Schema

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

Numeric id of the user or Page profile whose timeline posts you want.

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

Optional. Earliest post date to include (yyyy-mm-dd).

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

Optional. Latest post date to include (yyyy-mm-dd).

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

How many post rows to save in total (across pages).

## Actor input object example

```json
{
  "profileId": "4",
  "maxResults": 3
}
```

# 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 = {
    "profileId": "4",
    "maxResults": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("powerai/facebook-user-posts-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 = {
    "profileId": "4",
    "maxResults": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("powerai/facebook-user-posts-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 '{
  "profileId": "4",
  "maxResults": 3
}' |
apify call powerai/facebook-user-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/fE1SzY8mrW9AmJ17f/builds/OpNgu3qQ11y0Fh193/openapi.json
