# Facebook Comments API (facebook.comments)

- Canonical page: https://everyinfra.com/en/facebook-api/comments
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "facebook", "action": "comments", "params": {...}}
- Price: $0.002778 per call ($2.78 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 10, max 50 per call
- Mode: async by default (202 + job_id, poll GET /api/v1/jobs/{job_id})

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=facebook&action=comments

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | Specifies the target URL corresponding to the requested action. Use public Page URLs for profile and user_posts, post URLs for post and comments, group page URLs or group identifiers for group_posts, and business page URLs for reviews (which appends /reviews). Arbitrary Facebook URLs cannot be interchanged across actions. |
| limit | integer (1–50) | no | 10 | The most rows to return in this call, an integer from 1 to 50. The default applies when you leave it out, and a call can return fewer rows. Larger values return 422 before any charge. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
| author_name | Author's display name. |
| author_username | Author's username (@handle), usually usable in URLs. |
| depth | Comment level: 0 is a top-level comment, 1 is a reply to it, 2 is a reply to a reply. Rows at depth >= 1 reuse their parent comment group id — rebuild the tree with depth + reply_to_id. When the main source is unavailable, a backup returns top-level comments only, so every row has depth 0 and there are no reply rows. |
| reply_to_id | Id of the comment this row replies to (present only at depth >= 1; always null at depth 0). Reply rows reuse the parent group id as their row id, so treat this field as the parent link. |
| comment_url | Permanent link to this comment; on reply rows the link carries a reply_comment_id parameter pointing at the commented row. |
| author_id | Numeric user id of the comment author (stable identifier for cross-request deduplication). |
| author_url | Profile link of the comment author. |
| like_count | Likes. null means the platform or this capability does not disclose it; it is not 0. |
| reply_count | Replies, usually replies to a comment. null means not disclosed. |
| posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "facebook",
  "action": "comments",
  "params": {
    "url": "https://www.facebook.com/nasa"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "facebook",
        "action": "comments",
        "params": {
            "url": "https://www.facebook.com/nasa",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-10-24T18:28:34Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 16. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "facebook",
  "action": "comments",
  "results": [
    {
      "id": "•••",
      "text": "Houston, we have a Saturday. Four astronauts, one very big rocket, and zero 'just needs a little duct tape.' Go get 'em, Artemis crew. 🚀",
      "author_name": "•••",
      "author_username": "•••",
      "depth": 0,
      "comment_url": "https://www.facebook.com/reel/1803909017420449/?comment_id=1886311312779861",
      "author_id": "•••",
      "author_url": "https://www.facebook.com/•••",
      "like_count": 0,
      "posted_at": "2026-10-24T12:11:38+00:00",
      "platform": "facebook"
    },
    {
      "id": "•••",
      "text": "Excited to follow the next steps toward the lunar surface! 🚀 Which Artemis III test will be most critical to preparing for the landing?",
      "author_name": "•••",
      "author_username": "•••",
      "depth": 0,
      "comment_url": "https://www.facebook.com/reel/1803909017420449/?comment_id=2063125671029513",
      "author_id": "•••",
      "like_count": 0,
      "posted_at": "2026-10-24T08:06:31+00:00",
      "platform": "facebook"
    }
  ],
  "count": 16,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=facebook
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
