Fetch a post's comments
Fetch one page of a post's comments.
GET /v1/facebook/post/{post_id}/comments
Path parameter
| Parameter | Description |
|---|---|
post_id | The same values as the post endpoint: a post id, a numeric id, or a full Facebook post URL. |
Query parameters
| Parameter | Required | Description |
|---|---|---|
cursor | no | Omit for the first page; pass the next_cursor from a previous response to fetch the next page of comments. |
Example
curl "$LISTENX_BASE/v1/facebook/post/100064000_123123123/comments" \
-H "X-API-Key: $LISTENX_KEY"
Response
{
"post_id": "100064000_123123123",
"returned": 2,
"has_next_page": true,
"next_cursor": "eyJ...",
"comments": [
{
"id": "987654321",
"author": {
"id": null,
"name": "Jane Doe",
"username": "jane.doe.astro",
"url": "https://www.facebook.com/jane.doe.astro"
},
"text": "Absolutely breathtaking photo, thank you for sharing this!",
"created_at": "2 hrs",
"like_count": 5,
"replies": []
}
],
"billing": {
"endpoint": "facebook.comments",
"units": 1,
"unit_price": "0.010000",
"amount": "0.010000",
"balance_after": "97.210000",
"request_id": "…"
}
}
Fields
| Field | Description |
|---|---|
post_id | The post these comments belong to. |
returned | Number of top-level comments on this page. |
has_next_page | true if more comment pages remain. |
next_cursor | Pass back as cursor to fetch the next page; null when exhausted. |
comments[] | Comments with author, text, timestamp, and like count. |
Comment
| Field | Description |
|---|---|
id | Comment id. |
author | Commenter details (id, name, username, url). |
text | Comment text. |
created_at | When the comment was posted, as shown by Facebook. |
like_count | Reactions on the comment, when available. |
replies[] | Nested replies, when present. |
Billing
Billed per page — units = 1 per request. See Billing.
Errors
| HTTP | code | Meaning |
|---|---|---|
| 400 | invalid_post_id | Not a valid post URL or id. |
| 404 | not_found | Private, removed, or nonexistent. |
| 429 | upstream_rate_limited | Transient block — retry with backoff. |