# Facebook Posts Scraper⚡ (`premiumscraper/facebook-posts-scraper`) Actor

📊Scrape public Facebook posts from Pages, Profiles, and direct post, video, photo, or share URLs. Get text, media, reactions, comment and share counts, HD/SD video URLs, captions, timestamps, optional comments, replies, share details, date filters, and multi-profile support⚡Facebook Posts Scraper⚡

- **URL**: https://apify.com/premiumscraper/facebook-posts-scraper.md
- **Developed by:** [Premium Scraper](https://apify.com/premiumscraper) (community)
- **Categories:** Social media, Automation, Developer tools
- **Stats:** 107 total users, 37 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 post scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## ✨ Facebook Posts Scraper | Public Posts, Comments & Shares ⚡

Facebook Posts Scraper collects public Facebook timeline posts and direct Facebook post, video, photo, and share URLs, then optionally expands public comments, replies, and share-detail rows from Facebook's public endpoints.

Facebook Posts Scraper is built for users who want a cleaner public-post dataset, predictable grouped sections, and simpler billing visibility without carrying the full weight of Facebook's raw internal payloads.

The actor is designed for high-signal output:

- Common post fields are surfaced at the top level.
- Engagement, comments, replies, and share details are grouped into predictable sections.
- Raw Facebook payload fields are still preserved when useful.

### Highlights

Facebook Posts Scraper highlights the parts of public Facebook content that most downstream users actually need.

- 🚀 Timeline scraping for public profiles and pages
- 🔗 Direct Facebook post, video, photo, and share-style URL support
- 💬 Optional top-level comment collection
- ↪️ Optional per-comment reply expansion
- 🔁 Optional People who shared this post detail collection
- 📅 Optional native date filters
- 💸 Pay-per-event ready billing with clear budget logs

### Supported Inputs

Facebook Posts Scraper accepts both timeline targets and direct Facebook post URLs in one actor input.

| Field | Type | Default | What it does |
|---|---|---:|---|
| `username` | `string[]` | — | Facebook usernames such as `Cristiano`, `nike` |
| `facebook_urls` | `object[]` | — | Profile/page URLs, direct post URLs, direct video URLs, direct photo URLs, or share-style post URLs |
| `posts_count` | `integer` | `10` | Requested number of timeline posts per profile/page |
| `include_individual_posts` | `boolean` | `false` | When on, direct post, video, photo, and share URLs in `facebook_urls` are scraped as standalone posts |
| `include_comments` | `boolean` | `false` | When on, top-level comments are collected into `comment_details` |
| `comments_limit` | `integer` | `20` | Requested top-level comments per post |
| `comment_filter` | `string` | `most_relevant` | Comment ordering: `most_relevant`, `newest`, `all_comments` |
| `include_comment_replies` | `boolean` | `false` | When on, replies are collected under each comment in `all_replies` |
| `comment_replies_limit` | `integer` | `10` | Requested replies per collected top-level comment |
| `include_post_share_person_details` | `boolean` | `false` | When on, public reshare stories are collected into `share_details` |
| `share_people_limit` | `integer` | `10` | Requested public reshare-story rows per post |
| `posts_newer_than` | `date` | — | Optional lower date bound |
| `posts_older_than` | `date` | — | Optional upper date bound |

At least one of `username` or `facebook_urls` is required.

#### Supported URL Formats

Facebook Posts Scraper supports the following public Facebook URL shapes.

| Input type | Example |
|---|---|
| Username | `Cristiano` |
| Profile URL | `https://www.facebook.com/Cristiano` |
| People URL | `https://www.facebook.com/people/Page-Name/123456789/` |
| Direct post URL | `https://www.facebook.com/Cristiano/posts/pfbid0Dp9Wrmv1NAkFX1nSkKwLEKftjMSHbDYNBZE7L43y8JnTs77USeJ7cpC5FoGgm3inl` |
| Direct video post URL | `https://www.facebook.com/netflix/videos/2445344335530649/` |
| Direct photo URL | `https://www.facebook.com/photo/?fbid=10123456789012345&set=a.2012345678901234` |
| Share-style post URL | `https://www.facebook.com/share/p/1aocP4P5eR/` |

Direct post URLs are processed only when `include_individual_posts = true`.

### Output Overview

Facebook Posts Scraper returns one normalized row per scraped Facebook post.

Each dataset item is one Facebook post row.

The actor returns four kinds of data in the same row:

1. Top-level convenience fields for the most commonly used values.
2. Grouped sections for engagement, comments, replies, and shares.
3. Additional endpoint-derived raw rows in `additional_endpoint_data` for data that is not promoted into the main normalized groups.
4. Preserved raw Facebook fields for the original payload.

### Top-Level Common Fields

Facebook Posts Scraper exposes these top-level fields first so the most useful post data is easy to read and export.

These are the fields most users work with first.

| Field | Type | Description |
|---|---|---|
| `number` | `integer` | Row number inside the current run |
| `profile_link` | `string` | Source profile URL or direct post source URL |
| `post_id` | `string` | Facebook numeric post id |
| `permalink_url` | `string` | Canonical Facebook post URL |
| `created_at` | `string` | ISO 8601 UTC timestamp |
| `message_text` | `string` | Plain-text post message when Facebook exposes it |
| `profile_name` | `string` | Main author/page name |
| `profile_id` | `string` | Main author/page id |
| `profile_url` | `string` | Main author/page URL |
| `profile_picture_url` | `string` | Main author/page profile image URL |
| `profile_is_verified` | `boolean` | Main author/page verification flag |
| `reaction_count_total` | `integer` | Total reactions for the post when available |
| `reaction_count_reduced` | `string` | Short reaction label such as `492K` |
| `comment_count_total` | `integer` | Total comments when available |
| `comment_count_reduced` | `string` | Short comment label when available |
| `share_count_total` | `integer` | Total shares when available |
| `share_count_reduced` | `string` | Short share label when available |
| `video_view_count_total` | `integer` | Video views when available |
| `top_reaction_types` | `array` | Reaction names such as `Like`, `Love`, `Haha` |
| `top_reaction_labels` | `array` | Human labels such as `Love ❤️` |
| `top_reactions_breakdown` | `array` | Reaction-by-reaction counts |
| `attachment_types` | `array` | Attachment/media types surfaced from the payload |
| `attachment_count` | `integer` | Total attachment count |
| `photo_attachment_count` | `integer` | Photo attachment count |
| `video_attachment_count` | `integer` | Video attachment count |
| `primary_attachment_type` | `string` | Main attachment type |
| `primary_attachment_target_url` | `string` | Main attachment target URL |
| `attachment_target_urls` | `array` | All extracted attachment target URLs |
| `primary_image_url` | `string` | Main image URL |
| `image_urls` | `array` | All image URLs |
| `video_urls_hd` | `array` | All HD video URLs |
| `video_urls_sd` | `array` | All SD video URLs |
| `captions_urls` | `array` | All captions URLs |
| `matched_fragment_count` | `integer` | Present when multiple direct-post fragments were merged |

Long download-style video and captions links are emitted in the array fields (`video_urls_hd`, `video_urls_sd`, `captions_urls`) rather than duplicated as separate single-string fields.

### Grouped Sections

Facebook Posts Scraper uses grouped sections to keep engagement, comments, replies, shares, and endpoint extras easy to understand.

#### `post_engagement`

Grouped engagement summary for the main post.

| Field | Description |
|---|---|
| `post_engagement.reactions` | Reaction totals |
| `post_engagement.comments` | Comment totals |
| `post_engagement.shares` | Share totals |
| `post_engagement.video` | Video view totals |

The detailed reaction breakdown stays only in the top-level fields `top_reaction_types`, `top_reaction_labels`, and `top_reactions_breakdown` to avoid duplication.

#### `comment_details`

In Facebook Posts Scraper, `comment_details` is the main grouped block for top-level public comment collection.

Returned when comment collection is enabled. When disabled, this field becomes a guidance object.

| Field | Description |
|---|---|
| `comment_details.enabled` | `true` or `false` |
| `comment_details.collection_status` | Status message and pagination policy |
| `comment_details.request` | Requested vs returned top-level comment feedback |
| `comment_details.counts` | Total, visible, hidden, and returned comment counts |
| `comment_details.selected_filter` | Ordering mode, token, available modes, and filtering note |
| `comment_details.all_comments` | Array of normalized top-level comments |

#### `comment_details.all_comments[]`

Each top-level comment row contains:

| Field | Description |
|---|---|
| `comment_id` | GraphQL comment node id |
| `comment_legacy_fbid` | Legacy Facebook comment id |
| `depth` | `0` for parent comments |
| `created_at` | ISO 8601 UTC timestamp |
| `message_text` | Comment text |
| `comment_links` | Direct comment URLs |
| `author` | Profile name, id, links, avatar links, verification flag |
| `engagement` | Reactions, top reaction breakdown, reply counts, visibility note |
| `reply_details` | Requested vs returned reply feedback for this comment |
| `attachments` | Attachment counts/details for the comment |
| `all_replies` | Full reply rows when reply collection is enabled |

Important:

- There is no top-level `comment_replies_details` field.
- Full reply rows live only inside each parent comment under `all_replies`.
- When reply collection is off, `reply_details` and `all_replies` return guidance instead of rows.

#### `comment_details.all_comments[].all_replies[]`

Each reply row contains:

| Field | Description |
|---|---|
| `comment_id` | Reply node id |
| `comment_legacy_fbid` | Reply legacy id |
| `parent_comment_id` | Parent comment id |
| `depth` | `1` for replies |
| `created_at` | ISO 8601 UTC timestamp |
| `message_text` | Reply text |
| `comment_links` | Direct reply URLs |
| `author` | Reply author details |
| `engagement` | Reply reaction totals and breakdown |
| `attachments` | Reply attachments/media details |

#### `share_details`

In Facebook Posts Scraper, `share_details` is the grouped block for public reshare-story collection.

Returned when share-detail collection is enabled. When disabled, this field becomes a guidance object.

| Field | Description |
|---|---|
| `share_details.enabled` | `true` or `false` |
| `share_details.collection_status` | Status message and pagination policy |
| `share_details.request` | Requested vs returned share-person feedback |
| `share_details.counts` | Total shares, preview count, visible rows, hidden rows, returned rows |
| `share_details.preview_people` | Small preview list from the tooltip |
| `share_details.all_share_people` | Full normalized reshare-story rows |

#### `share_details.all_share_people[]`

Each public reshare-story row contains:

| Field | Description |
|---|---|
| `post_id` | Reshare post id |
| `permalink_links` | Permalink URLs for the reshare story |
| `created_at` | ISO 8601 UTC timestamp |
| `message_text` | Reshare text |
| `profile` | Sharer profile details |
| `engagement` | Reactions, comments, shares, video views when available |
| `attachments` | Media details for the reshare story |

#### `additional_endpoint_data`

This section keeps only endpoint-derived extra data that is not already represented by the top-level fields, `comment_details`, `share_details`, or `post_engagement`.

Typical contents include:

- `share_endpoint_data.share_people`

Each `share_endpoint_data.share_people[]` row is intentionally compact and keeps only extra share-story context such as:

- `story_id`
- `story_type`
- `should_host_actor_link_in_watch`
- `future_of_feed_info`
- `attached_story`

The nested `attached_story` summary keeps links in array fields such as `permalink_links`, `image_urls`, `video_urls_hd`, `video_urls_sd`, and `captions_urls` when Facebook exposes them.

### Raw Facebook Fields

Facebook Posts Scraper still preserves the useful raw Facebook payload fields that commonly matter for downstream work, including fields such as:

- `actors`
- `attachments`
- `attached_story`
- `comet_sections`
- `feedback`
- `feedback_summary`
- `id`
- `message`
- `owner`
- `permalink_url`
- `title`
- `url`
- video-specific delivery fields for video posts

The exact raw field set varies by post type:

- Standard timeline story rows include story/feed metadata.
- Direct video rows include video-delivery fields, playback/caption URLs, dimensions, and video ids.
- Share-style rows can include different permalink and attached-story structures.

### Requested vs Returned Feedback

Facebook Posts Scraper does not silently hide shortfalls.

Facebook Posts Scraper also surfaces requested-versus-returned feedback so users can see when Facebook exposed fewer public rows than requested.

When you request more rows than Facebook publicly exposes, the actor tells you that directly in the grouped sections:

- `comment_details.request`
- `comment_details.all_comments[].reply_details.request`
- `share_details.request`

That feedback shows:

- requested count
- returned count
- available count signal when Facebook exposes one
- whether more public data may still exist
- a human-readable message explaining why fewer rows were returned

### Billing and Maximum Cost

Facebook Posts Scraper is designed for Apify pay-per-event billing.

Important behavior:

1. Timeline profile/page rows charge once per returned post, and direct URLs charge once per returned individual post.
2. Turning on comment, reply, or share-detail collection does not charge by itself. Billing applies only to returned comment rows, reply rows, and share-person rows.
3. Non-default comment ordering (`newest`, `all_comments`) still adds the separate per-post comment-filter surcharge.
4. Applying date filters still adds the separate per-post date-filter surcharge.
5. Maximum Cost Per Run only works when the actor is actually running under `PAY_PER_EVENT` pricing.

### Run Logs

Facebook Posts Scraper uses short operational logs so a run is easier to follow.

| Emoji | Meaning |
|---|---|
| `🧭` | Run configuration |
| `👥` / `👤` | Profile queue or current profile |
| `🔗` | Direct-post queue or current direct post |
| `💬` | Comment collection |
| `↪️` | Reply collection |
| `🔁` | Share-detail collection |
| `📚` | Pagination policy |
| `📅` | Date-filter state |
| `💸` | Billing mode or per-event count summary |
| `🛡️` | Secret handling |
| `✅` | Step completed |
| `⚠` / `🛑` | Warnings and stop conditions |
| `🏁` | Run completion |

### Facebook Posts Scraper FAQ

#### Why did I get fewer comments, replies, or share-person rows than I requested?

Because Facebook stopped exposing more public rows. The actor reports that clearly in the relevant `request` block instead of silently pretending the request was fulfilled.

### Custom Solutions?

Need a tailored Facebook Posts Scraper setup with custom fields, higher volume, scheduled runs, or integrations with your existing pipeline?

✉️ Contact [premiumscraper@gmail.com](mailto:premiumscraper@gmail.com)

### Privacy & Compliance

Facebook Posts Scraper collects only publicly available Facebook data and is designed to avoid storing request secrets in exported output.

Use Facebook Posts Scraper responsibly and make sure your collection workflow matches applicable laws, privacy obligations, and platform terms.

- The actor collects only publicly available Facebook data.
- No Facebook login, cookies, or private API token is required from the user.
- No private messages, friend lists, or non-public content are accessed.
- Facebook request tokens used during scraping stay in memory only and are never written to logs or dataset rows.
- Proxy credentials and authorization headers are never exposed in actor output.
- When PAY_PER_EVENT monetization is active, user spending limits are respected and the run stops on budget; when PPE is inactive, the actor logs that maximum cost cannot be enforced for that run.
- Always ensure your use of scraped data complies with applicable laws and platform terms of service.

# Actor input Schema

## `username` (type: `array`):

Enter one or more Facebook usernames such as Cristiano, IamSRK, or nike. Each username is automatically converted into a profile or page URL.
## `facebook_urls` (type: `array`):

Add one or more Facebook profile, page, or direct post URLs. Supported formats:
• Username: Cristiano
• Profile URL: https://www.facebook.com/Cristiano
• People URL: https://www.facebook.com/people/Page-Name/123456789/
• Short path: people/Page-Name/123456789
• Direct post URL: https://www.facebook.com/Cristiano/posts/pfbid0Dp9Wrmv1NAkFX1nSkKwLEKftjMSHbDYNBZE7L43y8JnTs77USeJ7cpC5FoGgm3inl
• Direct video URL: https://www.facebook.com/netflix/videos/2445344335530649/
• Direct photo URL: https://www.facebook.com/photo/?fbid=10123456789012345&set=a.2012345678901234
• Share-style URL: https://www.facebook.com/share/p/1aocP4P5eR/

Direct post, video, photo, and share URLs are processed only when Direct Post URL Scraping is enabled.
## `posts_count` (type: `integer`):

How many timeline posts to request from each profile or page. The actor keeps paginating until this limit is reached or Facebook exposes no more public posts.
## `include_individual_posts` (type: `boolean`):

Turn on to scrape direct Facebook post, video, photo, and share URLs from the Facebook URLs field. When off, those direct URLs are skipped. Returned direct URLs are billed as individual posts.
## `include_comments` (type: `boolean`):

Turn on to add top-level public comments in comment_details for each post. There is no charge just for enabling this switch; billing applies only to visible comments that are actually returned. When off, comment_details returns a guidance object while top-level Facebook comment counts can still appear when available.
## `comments_limit` (type: `integer`):

Requested number of top-level public comments to include per post when comment collection is enabled. Returned comments appear in comment_details.all_comments. If Facebook exposes fewer comments than requested, comment_details.request explains that.
## `comment_filter` (type: `string`):

Choose the public Facebook comment ordering used while paginating top-level comments. This applies only when comment collection is enabled. Most relevant has no surcharge. Newest and All comments add an extra per-post filter charge.
## `include_comment_replies` (type: `boolean`):

Turn on to expand public replies under each collected top-level comment. Full reply records stay nested under comment_details.all_comments[].all_replies, and each parent comment includes reply_details with requested-versus-returned feedback. There is no charge just for enabling this switch; billing applies only to visible replies that are returned.
## `comment_replies_limit` (type: `integer`):

Requested number of visible replies to include under each top-level comment when reply expansion is enabled. Full reply rows stay under each comment, and reply_details reports per-comment reply availability so you can see when fewer replies were public than requested.
## `include_post_share_person_details` (type: `boolean`):

Turn on to add the share_details group with public reshare stories from Facebook's People who shared this post overlay. There is no charge just for enabling this switch; billing applies only to visible reshare-story rows that are actually returned. When off, share_details returns a guidance object while top-level share_count_total can still appear when available.
## `share_people_limit` (type: `integer`):

Requested number of visible public reshare stories to include per post when share-detail collection is enabled. Returned stories appear in share_details.all_share_people. If Facebook exposes fewer rows than requested, share_details.request explains that. Billing is based on the number of returned public reshare stories.
## `posts_newer_than` (type: `string`):

Only scrape posts created after this date. Leave empty for no lower date limit. Applying a date filter adds a small extra per-post surcharge.
## `posts_older_than` (type: `string`):

Only scrape posts created before this date. Leave empty for no upper date limit. Applying a date filter adds a small extra per-post surcharge.

## Actor input object example

```json
{
  "username": [
    "Cristiano"
  ],
  "facebook_urls": [
    {
      "url": "https://www.facebook.com/IamSRK"
    }
  ],
  "posts_count": 10,
  "include_individual_posts": false,
  "include_comments": false,
  "comments_limit": 20,
  "comment_filter": "most_relevant",
  "include_comment_replies": false,
  "comment_replies_limit": 10,
  "include_post_share_person_details": false,
  "share_people_limit": 10
}
````

# 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 = {
    "username": [
        "Cristiano"
    ],
    "facebook_urls": [
        {
            "url": "https://www.facebook.com/IamSRK"
        }
    ],
    "posts_count": 10,
    "comments_limit": 20,
    "comment_filter": "most_relevant",
    "comment_replies_limit": 10,
    "share_people_limit": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("premiumscraper/facebook-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 = {
    "username": ["Cristiano"],
    "facebook_urls": [{ "url": "https://www.facebook.com/IamSRK" }],
    "posts_count": 10,
    "comments_limit": 20,
    "comment_filter": "most_relevant",
    "comment_replies_limit": 10,
    "share_people_limit": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("premiumscraper/facebook-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 '{
  "username": [
    "Cristiano"
  ],
  "facebook_urls": [
    {
      "url": "https://www.facebook.com/IamSRK"
    }
  ],
  "posts_count": 10,
  "comments_limit": 20,
  "comment_filter": "most_relevant",
  "comment_replies_limit": 10,
  "share_people_limit": 10
}' |
apify call premiumscraper/facebook-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Posts Scraper⚡",
        "description": "📊Scrape public Facebook posts from Pages, Profiles, and direct post, video, photo, or share URLs. Get text, media, reactions, comment and share counts, HD/SD video URLs, captions, timestamps, optional comments, replies, share details, date filters, and multi-profile support⚡Facebook Posts Scraper⚡",
        "version": "1.0",
        "x-build-id": "rOAN0ap3IXYNpWOr9"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/premiumscraper~facebook-posts-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-premiumscraper-facebook-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/premiumscraper~facebook-posts-scraper/runs": {
            "post": {
                "operationId": "runs-sync-premiumscraper-facebook-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/premiumscraper~facebook-posts-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-premiumscraper-facebook-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": {
                    "username": {
                        "title": "👤 Facebook Username(s)",
                        "type": "array",
                        "description": "Enter one or more Facebook usernames such as Cristiano, IamSRK, or nike. Each username is automatically converted into a profile or page URL.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "facebook_urls": {
                        "title": "🔗 Facebook URLs",
                        "type": "array",
                        "description": "Add one or more Facebook profile, page, or direct post URLs. Supported formats:\n• Username: Cristiano\n• Profile URL: https://www.facebook.com/Cristiano\n• People URL: https://www.facebook.com/people/Page-Name/123456789/\n• Short path: people/Page-Name/123456789\n• Direct post URL: https://www.facebook.com/Cristiano/posts/pfbid0Dp9Wrmv1NAkFX1nSkKwLEKftjMSHbDYNBZE7L43y8JnTs77USeJ7cpC5FoGgm3inl\n• Direct video URL: https://www.facebook.com/netflix/videos/2445344335530649/\n• Direct photo URL: https://www.facebook.com/photo/?fbid=10123456789012345&set=a.2012345678901234\n• Share-style URL: https://www.facebook.com/share/p/1aocP4P5eR/\n\nDirect post, video, photo, and share URLs are processed only when Direct Post URL Scraping is enabled.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "posts_count": {
                        "title": "📰 Timeline Posts Per Profile/Page",
                        "minimum": 1,
                        "type": "integer",
                        "description": "How many timeline posts to request from each profile or page. The actor keeps paginating until this limit is reached or Facebook exposes no more public posts.",
                        "default": 10
                    },
                    "include_individual_posts": {
                        "title": "🔗 Enable Direct Post URL Scraping",
                        "type": "boolean",
                        "description": "Turn on to scrape direct Facebook post, video, photo, and share URLs from the Facebook URLs field. When off, those direct URLs are skipped. Returned direct URLs are billed as individual posts.",
                        "default": false
                    },
                    "include_comments": {
                        "title": "💬 Include Comments",
                        "type": "boolean",
                        "description": "Turn on to add top-level public comments in comment_details for each post. There is no charge just for enabling this switch; billing applies only to visible comments that are actually returned. When off, comment_details returns a guidance object while top-level Facebook comment counts can still appear when available.",
                        "default": false
                    },
                    "comments_limit": {
                        "title": "💬 Top-Level Comments Limit",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Requested number of top-level public comments to include per post when comment collection is enabled. Returned comments appear in comment_details.all_comments. If Facebook exposes fewer comments than requested, comment_details.request explains that.",
                        "default": 20
                    },
                    "comment_filter": {
                        "title": "🧮 Comment Ordering",
                        "enum": [
                            "most_relevant",
                            "newest",
                            "all_comments"
                        ],
                        "type": "string",
                        "description": "Choose the public Facebook comment ordering used while paginating top-level comments. This applies only when comment collection is enabled. Most relevant has no surcharge. Newest and All comments add an extra per-post filter charge.",
                        "default": "most_relevant"
                    },
                    "include_comment_replies": {
                        "title": "↪️ Include Comment Replies",
                        "type": "boolean",
                        "description": "Turn on to expand public replies under each collected top-level comment. Full reply records stay nested under comment_details.all_comments[].all_replies, and each parent comment includes reply_details with requested-versus-returned feedback. There is no charge just for enabling this switch; billing applies only to visible replies that are returned.",
                        "default": false
                    },
                    "comment_replies_limit": {
                        "title": "↪️ Replies Per Comment Limit",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Requested number of visible replies to include under each top-level comment when reply expansion is enabled. Full reply rows stay under each comment, and reply_details reports per-comment reply availability so you can see when fewer replies were public than requested.",
                        "default": 10
                    },
                    "include_post_share_person_details": {
                        "title": "🔁 Include People Who Shared This Post",
                        "type": "boolean",
                        "description": "Turn on to add the share_details group with public reshare stories from Facebook's People who shared this post overlay. There is no charge just for enabling this switch; billing applies only to visible reshare-story rows that are actually returned. When off, share_details returns a guidance object while top-level share_count_total can still appear when available.",
                        "default": false
                    },
                    "share_people_limit": {
                        "title": "🔁 People Who Shared Limit",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Requested number of visible public reshare stories to include per post when share-detail collection is enabled. Returned stories appear in share_details.all_share_people. If Facebook exposes fewer rows than requested, share_details.request explains that. Billing is based on the number of returned public reshare stories.",
                        "default": 10
                    },
                    "posts_newer_than": {
                        "title": "📅 Posts Newer Than",
                        "type": "string",
                        "description": "Only scrape posts created after this date. Leave empty for no lower date limit. Applying a date filter adds a small extra per-post surcharge."
                    },
                    "posts_older_than": {
                        "title": "📅 Posts Older Than",
                        "type": "string",
                        "description": "Only scrape posts created before this date. Leave empty for no upper date limit. Applying a date filter adds a small extra per-post surcharge."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
