# Facebook Post Detail (`xtracto/facebook-post-detail`) Actor

Scrape a single public Facebook post: text, author, timestamp, reaction count, comment count, images, and top comments.

- **URL**: https://apify.com/xtracto/facebook-post-detail.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.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.
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 Post Detail Scraper

Extract full details for a single public Facebook post by URL — author, full text, timestamp, attached media, reactions, comments count and shares count — in a clean structured JSON output.

### Why use this actor

- **No account / no login required** — just paste a public Facebook post URL.
- **No API key needed** — Facebook's Graph API does not return public post content without permissions; this actor returns the same data the public web page shows.
- **Rich detail** — full post text (not truncated), author name and profile URL, media URLs, ISO-8601 creation timestamp, reactions, comments count and shares count in a single row.
- **Bulk input** — pass a list of post URLs in one run; one clean dataset row per post.
- **Automatic retries** — transient failures retry with exponential backoff; posts that genuinely don't exist or are gated surface as `_error` rows so you can triage failures.
- **Stable JSON output** suitable for pipelines, spreadsheets, and databases — every row carries `_input`, `_source`, `_scrapedAt` envelope fields so you can join results back to your input list.

### How it works

1. You provide a list of Facebook post URLs (e.g. `https://www.facebook.com/NASA/posts/1524998752328829`).
2. The actor fetches each post page and reads the post record the same way the Facebook web app does, then assembles a flat JSON record with author, body, media and engagement counts.
3. Results stream into your dataset, ready to download as JSON, CSV, or Excel.

You do not need to manage scrapers, browsers, or rotating IPs — all handled internally.

### Input

```json
{
  "posts": [
    "https://www.facebook.com/NASA/posts/1524998752328829",
    "https://www.facebook.com/Meta/posts/pfbid02fponXQPxSYZfbPKTGuDWvV7evMdoSFdqGn7TPR3kium9mzh4McCc6JXghsHLPkZXl"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["DATACENTER"]
  }
}
````

| Field | Type | Description |
|---|---|---|
| `posts` | array | List of public Facebook post URLs to scrape. Standard `facebook.com/<page>/posts/<id>`, `story.php?story_fbid=...`, `share/p/...` and `permalink/...` formats are all accepted. |
| `proxyConfiguration` | object | Apify Proxy settings. Datacenter proxy works for most public posts; switch to Residential if you hit rate limits on large runs. |

### Output

Input: `https://www.facebook.com/NASA/posts/1524998752328829`

```json
{
  "_input": "https://www.facebook.com/NASA/posts/1524998752328829",
  "_source": "S1-primary",
  "_scrapedAt": "2026-05-18T11:37:16.784655+00:00",
  "postId": "1524998752328829",
  "id": "UzpfSTEwMDA0NDU2MTU1MDgzMToxNTI0OTk4NzUyMzI4ODI5OjE1MjQ5OTg3NTIzMjg4Mjk=",
  "ownerName": "NASA - National Aeronautics and Space Administration",
  "ownerProfileUrl": "https://www.facebook.com/NASA",
  "ownerImageUrl": "https://scontent.fcgk12-2.fna.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=cp0_dst-png_s50x50&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&...",
  "createdAt": "2026-05-13T17:25:44+00:00",
  "createdAtEpoch": 1778693144,
  "text": "Planning is underway for our Artemis III mission, which will test the capabilities of NASA's Orion spacecraft and one or both commercial landers from Blue Origin and SpaceX as they meet and dock in Earth's orbit. \n\nThis highly complex mission will be an important step to landing astronauts on the Moon with Artemis IV in 2028. Details: https://go.nasa.gov/4dv2scO",
  "permalink": "https://www.facebook.com/NASA/posts/pfbid02fponXQPxSYZfbPKTGuDWvV7evMdoSFdqGn7TPR3kium9mzh4McCc6JXghsHLPkZXl",
  "reactionCount": null,
  "reactionCountText": "7.1K",
  "commentCount": 527,
  "shareCount": 640
}
```

| Field | Type | Description |
|---|---|---|
| `_input` | string | The URL exactly as you supplied it. Use this to join results back to your input list. |
| `_source` | string | Internal tag for the path used to fetch the record. `S1-primary` means the fastest, richest path; values starting with `S2-`/`S3-` indicate a fallback was used. |
| `_scrapedAt` | string | ISO-8601 UTC timestamp when the record was scraped. |
| `postId` | string | Facebook's numeric post ID. Stable for the lifetime of the post. |
| `id` | string | Facebook's encoded post ID (base64). Useful for cross-referencing with other Facebook records. |
| `ownerName` | string | Display name of the page or profile that authored the post. |
| `ownerProfileUrl` | string | Canonical URL of the author's Facebook page or profile. |
| `ownerImageUrl` | string | URL of the author's profile picture (thumbnail size). Expires after a few hours — re-fetch if you need long-term storage. |
| `createdAt` | string | ISO-8601 UTC timestamp when the post was published. |
| `createdAtEpoch` | integer | Unix epoch (seconds) when the post was published. |
| `text` | string | Full post body, including line breaks and links. `null` if the post is media-only with no caption. |
| `permalink` | string | Canonical Facebook permalink (uses the long `pfbid…` form). |
| `reactionCount` | integer | Total reactions when available as a raw integer. Often `null` on posts where Facebook only renders a rounded label — use `reactionCountText` instead. |
| `reactionCountText` | string | Facebook's rounded label for reactions (e.g. `"7.1K"`, `"1.2M"`). Always present. |
| `commentCount` | integer | Approximate comments count. Includes top-level and nested comments. |
| `shareCount` | integer | Approximate shares count. |

#### Error envelope

Posts that don't exist, are deleted, or fail to fetch return a structured error instead of crashing the run:

```json
{
  "_input": "https://www.facebook.com/NASA/posts/0000000000000000",
  "_error": "not_found",
  "_scrapedAt": "2026-05-18T11:38:02.012345+00:00"
}
```

Common `_error` values:

| Value | Meaning |
|---|---|
| `not_found` | Post was deleted, the page was removed, or the URL is malformed. |
| `login_wall` | Post is friends-only or otherwise gated behind a Facebook login. |
| `fetch_failed` | Network failure after retries. `_errorDetail` carries the underlying message. |

Filter on `_error` to triage failed rows.

### Pricing

This actor is billed per result: **$6.00 per 1,000 posts** (Tier 4). Each successful post = 1 result. Errors (`not_found`, `login_wall`) are not billed.

### Other Sosmed Actors

| Platform | Actor | Best for |
|---|---|---|
| Facebook | [Facebook Page Scraper](https://apify.com/xtracto/facebook-page) | Page profile — name, category, likes, follower count |
| Facebook | [Facebook Page Posts Scraper](https://apify.com/xtracto/facebook-page-posts) | Recent posts feed for any public page |
| Instagram | [Instagram Post Detail Scraper](https://apify.com/xtracto/instagram-post-detail-scraper) | Caption, media, likes and comments for a single post |
| Threads | [Threads Post Detail Scraper](https://apify.com/xtracto/threads-post-detail-scraper) | Full thread + replies for a single Threads URL |
| X (Twitter) | [X Post Detail Scraper](https://apify.com/xtracto/x-post-detail-scraper) | Tweet text, media, engagement counts |
| Bluesky | [Bluesky Post Detail Scraper](https://apify.com/xtracto/bluesky-post-detail-scraper) | Skeet content + counters by atproto URL |
| Reddit | [Reddit Post Detail Scraper](https://apify.com/xtracto/reddit-post-detail-scraper) | Submission body + score for any thread |
| YouTube | [YouTube Video Detail Scraper](https://apify.com/xtracto/youtube-video-detail-scraper) | Video metadata, views, likes, channel |

Browse the full catalog at [apify.com/xtracto](https://apify.com/xtracto).

### Notes

- Deleted posts and removed pages return `{"_error": "not_found", "_input": "..."}`. Filter these out before billing reports.
- `reactionCount` is the raw integer when Facebook exposes it; on many pages Facebook only renders a rounded label, in which case `reactionCount` is `null` and you should use `reactionCountText` (`"7.1K"`, `"1.2M"`).
- `commentCount` and `shareCount` are the counts Facebook displays on the post — Facebook itself rounds these for large posts, so treat them as approximate near the high end.
- `ownerImageUrl` is a short-lived CDN URL — re-fetch or re-host if you need long-term storage.
- For large jobs (>1,000 posts), keep the default Datacenter proxy but enable Apify Proxy rotation; switch to Residential only if you start seeing `login_wall` rows on otherwise public posts.

# Actor input Schema

## `posts` (type: `array`):

List of Facebook post URLs. Standard `facebook.com/<page>/posts/<id>`, `story.php?story_fbid=...`, `share/p/...` and `permalink/...` formats are all accepted.

## `proxyConfiguration` (type: `object`):

Apify Proxy configuration. Datacenter proxy works for most public posts; switch to Residential if you hit rate limits on large runs.

## Actor input object example

```json
{
  "posts": [
    "https://www.facebook.com/metaai/posts/pfbid026rKrwaS6ayt38tUsSji2HYoWULHtx1pXrRLhr5rgUk59ELrGYWGFgWFNZpq6UPzLl"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/facebook-post-detail").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 = { "posts": ["https://www.facebook.com/metaai/posts/pfbid026rKrwaS6ayt38tUsSji2HYoWULHtx1pXrRLhr5rgUk59ELrGYWGFgWFNZpq6UPzLl"] }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/facebook-post-detail").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 '{
  "posts": [
    "https://www.facebook.com/metaai/posts/pfbid026rKrwaS6ayt38tUsSji2HYoWULHtx1pXrRLhr5rgUk59ELrGYWGFgWFNZpq6UPzLl"
  ]
}' |
apify call xtracto/facebook-post-detail --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Post Detail",
        "description": "Scrape a single public Facebook post: text, author, timestamp, reaction count, comment count, images, and top comments.",
        "version": "0.1",
        "x-build-id": "qAjb7wQ48ibqGbmK5"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/xtracto~facebook-post-detail/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-xtracto-facebook-post-detail",
                "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/xtracto~facebook-post-detail/runs": {
            "post": {
                "operationId": "runs-sync-xtracto-facebook-post-detail",
                "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/xtracto~facebook-post-detail/run-sync": {
            "post": {
                "operationId": "run-sync-xtracto-facebook-post-detail",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "posts"
                ],
                "properties": {
                    "posts": {
                        "title": "Facebook post URLs",
                        "type": "array",
                        "description": "List of Facebook post URLs. Standard `facebook.com/<page>/posts/<id>`, `story.php?story_fbid=...`, `share/p/...` and `permalink/...` formats are all accepted.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy configuration. Datacenter proxy works for most public posts; switch to Residential if you hit rate limits on large runs.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
