# Facebook Post API

Get one public Facebook post by permalink: post text, creation time, author name, the aggregate reaction count with a per-type breakdown (like, love, wow, care, haha, sad), and attachment references with their CDN URLs and types. Attachment references are links, never proxied media bytes. Post comments are not available anonymously and are not stubbed in this response. A bare post id is rejected upstream; pass the full permalink. You supply the identifier yourself: this endpoint discovers nothing, so a caller without one has no way to obtain it here. An identifier that is gone, private or not served anonymously returns a non-billable 404 rather than an empty record.

- **Documentation:** [https://scrappa.co/docs/facebook-api/facebook_post](https://scrappa.co/docs/facebook-api/facebook_post)
- **API group:** Facebook API
- **Endpoint:** `GET https://scrappa.co/api/facebook/post`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `permalink` | string | Yes | Full Facebook permalink for the post (e.g. https://www.facebook.com/nasa/posts/1234567890). |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/facebook/post?permalink=https%3A%2F%2Fwww.facebook.com%2Fnasa%2Fposts%2F1234567890"
```

## Example response

```json
{
    "success": true,
    "post": {
        "post_id": "1234567890",
        "text": "Post body text.",
        "creation_time": 1790872565,
        "author_name": "NASA - Official Site",
        "permalink_url": "https://www.facebook.com/nasa/posts/1234567890",
        "reaction_count": 12000,
        "reactions": {
            "total": 12000,
            "by_type": {
                "like": 11000,
                "love": 900,
                "wow": 100
            },
            "share_count": 0
        },
        "attachments": [
            {
                "typename": "Photo",
                "id": "1644708703691166",
                "uri": "https://...",
                "permalink_url": "https://..."
            }
        ]
    },
    "meta": {
        "classification": "ok",
        "billable": true,
        "endpoint_family": "facebook_post",
        "duration_ms": 5100
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is missing or malformed, for example a handle with characters Facebook does not allow or a non-numeric id. |
| 404 | Not Found | The page, profile, group, event, photo, reel, post or listing does not exist, is not public, or was served by Facebook without the requested record. This is the truthful answer, not a temporary fault: it is never billed and retrying the same permalink will not change it. |
| 503 | Records Not Read | Facebook returned records for this request that the parser could not read. The origin status is 502 and it is reported here as 503 because Cloudflare replaces 502 and 504 bodies with its own page. This request is never billed: the customer received no data. |
| 503 | Temporarily Unavailable | The upstream service is temporarily unavailable. Please retry shortly. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
