# 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:** 7 total users, 3 monthly users, 67.9% 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 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

## 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook User Posts Scraper",
        "description": "Export posts from a Facebook profile timeline with text, media hints, engagement, and optional date filters.",
        "version": "0.0",
        "x-build-id": "OpNgu3qQ11y0Fh193"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/powerai~facebook-user-posts-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-powerai-facebook-user-posts-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/powerai~facebook-user-posts-scraper/runs": {
            "post": {
                "operationId": "runs-sync-powerai-facebook-user-posts-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/powerai~facebook-user-posts-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-powerai-facebook-user-posts-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",
                "properties": {
                    "profileId": {
                        "title": "Profile ID",
                        "type": "string",
                        "description": "Numeric id of the user or Page profile whose timeline posts you want.",
                        "default": "4"
                    },
                    "startDate": {
                        "title": "Start date",
                        "type": "string",
                        "description": "Optional. Earliest post date to include (yyyy-mm-dd)."
                    },
                    "endDate": {
                        "title": "End date",
                        "type": "string",
                        "description": "Optional. Latest post date to include (yyyy-mm-dd)."
                    },
                    "maxResults": {
                        "title": "Maximum results",
                        "minimum": 3,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "How many post rows to save in total (across pages).",
                        "default": 3
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
