# 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:** 20 total users, 8 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

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

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Facebook 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(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "posts": [
    "https://www.facebook.com/metaai/posts/pfbid026rKrwaS6ayt38tUsSji2HYoWULHtx1pXrRLhr5rgUk59ELrGYWGFgWFNZpq6UPzLl"
  ]
}' |
apify call xtracto/facebook-post-detail --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/facebook-post-detail"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/WpinEJiyRY8JKHT7s/builds/hpbUzCU2N9mUg9ZT1/openapi.json
