Skip to main content

Fetch a post's comments

Fetch one page of a post's comments.

GET /v1/facebook/post/{post_id}/comments

Path parameter​

ParameterDescription
post_idThe same values as the post endpoint: a post id, a numeric id, or a full Facebook post URL.

Query parameters​

ParameterRequiredDescription
cursornoOmit 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​

FieldDescription
post_idThe post these comments belong to.
returnedNumber of top-level comments on this page.
has_next_pagetrue if more comment pages remain.
next_cursorPass back as cursor to fetch the next page; null when exhausted.
comments[]Comments with author, text, timestamp, and like count.

Comment​

FieldDescription
idComment id.
authorCommenter details (id, name, username, url).
textComment text.
created_atWhen the comment was posted, as shown by Facebook.
like_countReactions on the comment, when available.
replies[]Nested replies, when present.

Billing​

Billed per page — units = 1 per request. See Billing.

Errors​

HTTPcodeMeaning
400invalid_post_idNot a valid post URL or id.
404not_foundPrivate, removed, or nonexistent.
429upstream_rate_limitedTransient block — retry with backoff.