> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindcase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Facebook Comments API

> Extract comments and replies from Facebook posts, reels, and photos (text, author, likes, reply count, and thread position) by post URL

`POST /v1/data/facebook/comments/run`

**Pricing:** $0.0025 per comment ($2.50 per 1,000).

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**post\_url** `string` *required*

A Facebook post, reel, or photo permalink to scrape comments from.

Format e.g. `https://www.facebook.com/100044541544829/posts/1393461115481927`.

**maxResults** `integer`

Number of comments to return. Use 0 for all.

**includeNestedComments** `boolean` (default: true)

On: also pull replies under each comment (returned as their own rows). Off: top-level comments only.

**viewOption** `string` (default: RANKED\_UNFILTERED)

How Facebook orders the comments it returns.

Allowed values: `RANKED_UNFILTERED` (All comments, ranked), `RANKED_THREADED` (Ranked, grouped by thread), `RECENT_ACTIVITY` (Most recent activity first).

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/facebook/comments/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "post_url": "https://www.facebook.com/Cristiano/posts/pfbid0...",
    "maxResults": 50,
    "includeNestedComments": true
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/facebook/comments/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "post_url": "https://www.facebook.com/Cristiano/posts/pfbid0...",
    "maxResults": 50,
    "includeNestedComments": True
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/facebook/comments/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "post_url": "https://www.facebook.com/Cristiano/posts/pfbid0...",
  "maxResults": 50,
  "includeNestedComments": true
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one comment, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `postUrl` | Post URL | text |
| `postId` | Post ID | text |
| `pageId` | Page ID | text |
| `commentUrl` | Comment URL | text |
| `commentText` | Comment Text | text |
| `commentDate` | Comment Date | text |
| `likes` | Likes | number |
| `replies` | Replies | number |
| `replyDepth` | Reply Depth | number |
| `isReply` | Is Reply | boolean |
| `commenter` | Commenter | text |
| `commenterUrl` | Commenter URL | text |
| `commenterId` | Commenter ID | text |
| `replyingTo` | Replying To | text |
| `threadRootAuthor` | Thread Root Author | text |
| `commentMediaType` | Comment Media Type | text |
| `commentMediaCaption` | Comment Media Caption | text |
| `commentMediaUrl` | Comment Media URL | text |
| `commenterPicture` | Commenter Picture | text |
| `postCaption` | Post Caption | text |
| `replyingToDetails` | Replying To (details) | object |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "facebook/comments",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "commenterPicture": "https://scontent-atl3-1.xx.fbcdn.net/v/t39.30808-1/740611601_122140974807115229_1415355724447872379_n.jpg?stp=c0.0.452.452a_cp0_dst-jpg_tt6&cstp=mx452x452&ct...",
      "commentDate": "2026-08-15T01:48:37.000Z",
      "commenterId": "61583456871751",
      "commenterUrl": null,
      "commenter": "Tushar Arora",
      "threadRootAuthor": null,
      "replyDepth": 0,
      "commentText": "Max power combining air shows with astronaut appearances and tech displays at kennedy sounds like great family event tying it to americas 250th gives extra h...",
      "commentMediaUrl": null,
      "postUrl": "https://www.facebook.com/NASA",
      "commentUrl": "https://www.facebook.com/reel/1072516795457717/?comment_id=1549799309383817",
      "likes": 3,
      "replies": 0,
      "pageId": "54971236771",
      "commentMediaType": null,
      "isReply": false,
      "replyingTo": null,
      "postId": "1603187384509965",
      "commentMediaCaption": null,
      "replyingToDetails": null,
      "postCaption": "America’s newest and most exciting aerospace technology expo and air show is landing at NASA's Kennedy Space Center in Florida on Nov. 7-8!\n\nIn honor of Amer..."
    }
  ]
}
```

## Related APIs

For the posts themselves use [`facebook/posts`](https://docs.mindcase.co/apis/facebook/posts).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.