
Developer guide
Facebook Comments API: Read, Reply to and Moderate Comments
Handle Facebook comments by API in 2026: as a Page with Meta's Graph API, or from your users' own accounts.
Tom BeckerIs Saturday morning still free?New
Anna LeeYes, 10am works. See you there!Replied
Maya RuizDo you also shoot family photos?Open
GET
comments
POSTcomments/{id}
PATCHcomments/{id}
200 OK
Table of Contents
Meta's Graph API
Connected accounts
Choosing
Short answer
A Facebook comments API lets your app read, post, reply to and moderate Facebook comments with HTTP requests. Two routes exist: Meta's Graph API, where every comment your app writes comes from a Page, or a connected account, where your app comments on behalf of the user who linked it.
This guide does not cover collecting public comments. For the wider picture, see how the Facebook APIs fit together.
With Unipile
Comment from your users' accounts in 3 steps
1
Connect the account
Your user links their Facebook account through Hosted Auth. No Meta app, no App Review.
2
Call the comments endpoint
List, reply, edit or delete from that account, with your X-API-KEY header.
GET /v2/{account_id}/posts/{post_id}/comments
3
Catch new comments
There is no comment webhook: reread the list and compare it with the last known ID.
Definition
What Is the Facebook Comments API?
Meta has no product called "Comments API". Facebook comments are comment nodes of the Graph API, read and created through the /{object-id}/comments edge of a post, photo, video or comment.
In practice, a Facebook comments API means calls on that edge and node. Nodes, edges and tokens: see our Facebook Graph API overview.
Meta's Content Library serves comments to approved researchers only, and the website Comments plugin was discontinued on Feb. 10, 2026.
/{post-id}/commentsLists a post's comments and receives new ones./{comment-id}The comment: read, update or delete it.fromWho wrote the comment.messageThe text of the comment.created_timeWhen the comment was posted./{comment-id}/commentsReplies to that comment.
Meta Graph API
How Do You Get Comments from a Facebook Post with the Graph API?
Call GET /{page-post-id}/comments with a Page access token. Add filter=stream for every reply level (the default, toplevel, stops at first-level comments), summary=true for total_count and fields=from,message.
GET
/{page-post-id}/comments?filter=stream&summary=true&order=reverse_chronological&fields=from,message,created_time
Three traps
- User tokens return nothing. On a Post, Photo, Album or Video, a user access token gets empty data.
- Comment IDs need MODERATE. Through Page Public Content Access, the comment
idonly comes back if the token holder can perform theMODERATEtask on the Page. total_countcan overcount. Deleted or private comments still count.
Reading comments takes the parent object's rights: see the permissions of the Facebook Page API and our Facebook API access token guide.
Source: /{object-id}/comments reference, v27.0, verified Nov. 17, 2026.
Meta Graph API
How Do You Reply to a Facebook Comment with the Graph API?
Send POST /{comment-id}/comments with a message (or /{page-post-id}/comments for a first-level comment), plus an optional attachment_url image. The Page is the author: commenting as a person returns error 1705.
POST
/{comment-id}/comments message="Thanks, we open at 9am." access_token={PAGE_ACCESS_TOKEN}
Who is the author?
Requires pages_manage_engagement, pages_read_engagement, pages_read_user_engagement and the MODERATE and CREATE_CONTENT tasks.
Meta docs
Never as a person
"The author of the comment will be the Page."
To reply in each user's own name, you need a connected account.
- @mentions. Write
@and the person's Page-scoped ID (PSID). Only people who commented on or created the post, with "Others Tagging this Page" on. - Private replies. When
can_reply_privatelyis true: one Messenger message to the commenter, within 7 days, withpages_messagingand theMESSAGINGtask. See how to send a Messenger message via API.
Sources: Comments and @mentions, Private replies, v27.0, verified Nov. 17, 2026.
Moderation
How Do You Moderate Facebook Page Comments by API?
With a Page access token and pages_manage_engagement, your app hides a Page comment, deletes it, and hears about new ones through the feed webhook.
Hide
POST /{comment-id} with is_hidden=true; false shows it again. Page comments only.
Delete
DELETE /{comment-id} removes the comment and returns {"success": true}.
Get notified
Subscribe the Page to feed via /{page-id}/subscribed_apps. Events with item: comment carry a verb (add, edited, remove, hide), the comment_id and the parent_id.
- Webhooks need an admin. An admin with
MODERATEgrantspages_manage_metadatafirst. Verification and signatures: see Facebook API webhooks.
Sources: Comment and Page webhooks references, v27.0, verified Nov. 17, 2026.
With Unipile
Read, Reply to, Edit and Delete Comments from a Connected Account
Each user connects their Facebook account through Hosted Auth and your app gets an account_id. Through /v2/{account_id}/posts/{post_id}/comments, your app lists comments and replies, then comments, replies, edits and deletes the account's own comments, with no Meta app and no Page token. The Meta tab shows the Graph API equivalent.
const BASE = "https://api.unipile.com/v2";
const headers = {
"X-API-KEY": process.env.UNIPILE_API_KEY,
"content-type": "application/json"
};
// 1. List the comments of a post (newest first, 10 per page)
const res = await fetch(`${BASE}/${ACCOUNT_ID}/posts/${POST_ID}/comments`, { headers });
const { data, next_cursor } = await res.json();
// 2. Reply to the newest comment from the connected account
await fetch(`${BASE}/${ACCOUNT_ID}/posts/${POST_ID}/comments/${data[0].id}`, {
method: "POST", headers,
body: JSON.stringify({ text: "Yes, 10am works. See you there!" })
});
import os, requests
BASE = "https://api.unipile.com/v2"
headers = {"X-API-KEY": os.environ["UNIPILE_API_KEY"]}
# 1. List the comments of a post (newest first, 10 per page)
page = requests.get(f"{BASE}/{ACCOUNT_ID}/posts/{POST_ID}/comments",
headers=headers).json()
newest = page["data"][0]
# 2. Reply to the newest comment from the connected account
requests.post(f"{BASE}/{ACCOUNT_ID}/posts/{POST_ID}/comments/{newest['id']}",
headers=headers, json={"text": "Yes, 10am works. See you there!"})
# 1. List the comments of a post (newest first, 10 per page)
curl --request GET \
--url "https://api.unipile.com/v2/{ACCOUNT_ID}/posts/{POST_ID}/comments" \
--header "X-API-KEY: {YOUR_API_KEY}"
# 2. Reply to one comment from the connected account
curl --request POST \
--url "https://api.unipile.com/v2/{ACCOUNT_ID}/posts/{POST_ID}/comments/{COMMENT_ID}" \
--header "X-API-KEY: {YOUR_API_KEY}" \
--header "content-type: application/json" \
--data '{ "text": "Yes, 10am works. See you there!" }'
# Meta Graph API: list a Page post's comments with a Page access token
curl -G "https://graph.facebook.com/v27.0/{PAGE_POST_ID}/comments" \
-d "filter=stream" -d "summary=true" \
-d "fields=from,message,created_time" \
-d "access_token={PAGE_ACCESS_TOKEN}"
# Reply to one comment: the Page is the author
curl -X POST "https://graph.facebook.com/v27.0/{COMMENT_ID}/comments" \
-d "message=Yes, 10am works. See you there!" \
-d "access_token={PAGE_ACCESS_TOKEN}"
# Response: the ID of the new comment
{ "id": "{NEW_COMMENT_ID}" }
Docs: Manage post comments. Meta tab: /{object-id}/comments, v27.0, verified Nov. 17, 2026.
Comment endpoints
Base path:
https://api.unipile.com/v2/{account_id}GET
/posts/{post_id}/commentsList a post's commentsGET
/posts/{post_id}/comments/{comment_id}/repliesList the replies to a commentPOST
/posts/{post_id}/commentsAdd a comment to a postPOST
/posts/{post_id}/comments/{comment_id}Reply to a commentPATCH
/posts/{post_id}/comments/{comment_id}Edit the text of a commentDELETE
/posts/{post_id}/comments/{comment_id}Delete the account's own commentGET
/users/me/commentsThe account's own comments, 25 per pageLimits to plan for
| Case | Rule |
|---|---|
| Page size | 10 per page, whatever limit; then next_cursor |
| Order | Newest first |
attachments | One image per comment; text can then be empty |
| Animated GIF | Published as a still image |
| Delete | Only the account's own comments |
Page size
10 per page, whatever
limit; then next_cursorOrder
Newest first
attachments
One image per comment;
text can then be emptyAnimated GIF
Published as a still image
Delete
Only the account's own comments
can_comment only accepts anyone at post creation and cannot change later: see our Facebook post API guide.
React to comments
The account adds or removes its reaction with POST or DELETE on /posts/{post_id}/comments/{comment_id}/reactions, and GET lists reactions, 10 per page. The reaction field takes seven values:
facebook_likefacebook_lovefacebook_carefacebook_hahafacebook_wowfacebook_sadfacebook_angry
Partial lists
On very large Pages, the list of who reacted can be partial or empty; counters stay exact. Details in Manage post reactions.
Compliance
Your users comment from their own accounts
Unipile is not a Meta product or a Meta Partner; your users connect their own accounts and remain bound by Meta's terms.
New comments
How Do You Know When a New Comment Arrives?
With Meta, the Page's feed webhook pushes every new comment. Unipile has no comment event today: your app rereads the comments of followed posts and compares them with the last stored ID.
1
Read the list
Fetch each followed post's comments.
GET /posts/{post_id}/comments
2
Stop at the last known ID
Newest first, so everything above it is new.
last_seen_comment_id
3
Handle the new ones
Show them, then store the newest ID.
reply_counter for new replies
Messenger messages and reactions do have real-time webhooks: see the Facebook Messenger API page.
Decision
Page Moderation or User Comments: Which Approach Fits Your Product?
The Graph API fits a tool that moderates clients' Pages, with a Meta app and App Review. A connected account fits a product where users answer comments in their own name.
| Criteria | Meta Graph API | Connected account (Unipile) |
|---|---|---|
| Author | The Page | The user, in their own name |
| Setup on your side | Meta app, permissions, App Review | API key and Hosted Auth |
| Hide a comment | is_hidden on Page comments | Not documented |
| Delete a comment | Comments on the Page's posts | The account's own comments |
| New comments | feed webhook | Read the list again |
| Other networks | Facebook only | Same API for LinkedIn, Instagram and more |
Author
Graph APIThe Page
Connected accountThe user, in their own name
Setup on your side
Graph APIMeta app, permissions, App Review
Connected accountAPI key and Hosted Auth
Hide a comment
Graph API
is_hidden on Page commentsConnected accountNot documented
Delete a comment
Graph APIComments on the Page's posts
Connected accountThe account's own comments
New comments
Graph API
feed webhookConnected accountRead the list again
Other networks
Graph APIFacebook only
Connected accountSame API for LinkedIn, Instagram and more
Related: connect a personal Facebook account and Facebook Messenger API pricing.
Use cases
Use Cases: Comments in Support Tools, CRMs and AI Agents
Show comments where your users already handle their messages.
Same model on the other Meta network: see our Instagram API guide.
All commentsTo answerDone
Tom BeckerIs Saturday morning still free?Question
Julia ChenThe prints look great.Feedback
Maya RuizPrice for a family session?Sales
GET
v2/{ACCOUNT_ID}/posts/{POST_ID}/comments
200 OK
Support and community tools
Comments sit next to messages, answered from the user's account.
CRM activity
A contact record shows that person's comments on your user's posts.
AI agents with approval
An agent drafts a reply; your app sends it only after the user approves.
Start handling Facebook comments from your app
Moderate your clients' Pages with the Graph API. For comments in users' own names, connect their accounts through Unipile.
EU Regulated
Digital Markets Act (DMA)
Each user connects their own account, with no profile storage. Unipile is not a Meta Partner. Unipile and the DMA
All Facebook API endpoints in one place
Comments are one part of it: browse every Facebook endpoint available with Unipile, from messages to posts and reactions, or start from our complete Facebook API guide.
Facebook Comments API FAQ
Reading, posting, hiding, deleting, pagination and private replies.
With the Graph API, call GET /{page-post-id}/comments with a Page access token (a user token returns empty data on posts). With Unipile, call GET /v2/{account_id}/posts/{post_id}/comments from the user's connected account.
With the Graph API, only as a Page: commenting as a person returns error 1705. With Unipile, the connected account comments in the user's own name with POST /v2/{account_id}/posts/{post_id}/comments.
Yes, on Page comments, with the Graph API: POST /{comment-id} with is_hidden set to true or false, using a Page access token. Hiding is not documented on the Unipile side.
Yes. With the Graph API and a Page access token, DELETE /{comment-id} removes comments on the Page's posts. A Unipile connected account deletes only its own comments.
The Graph API pages results with cursors. With Unipile, Facebook returns up to 10 comments or replies per page whatever the limit, newest first; follow next_cursor for the next page.
Yes, with Meta's private replies: one message to the person who commented, within 7 days, with pages_messaging. The conversation continues only if they answer. See how to send a Messenger message via API.
No. Unipile is an independent company, not a Meta Partner, and is not endorsed or approved by Meta. Comments go through your users' own Facebook accounts. Facebook is a trademark of Meta Platforms, Inc.
No. Your users connect their own Facebook account through hosted authentication, so you skip the Meta app, the pages_manage_engagement permission and the App Review of the Graph API route.
Unipile is designed in the spirit of the Digital Markets Act: each user connects their own account and decides what they write, and Unipile acts on their behalf without storing user profiles. More on our Digital Markets Act page.
Yes. Every comment goes through an account bound by Meta's Terms of Service. Keep to legitimate uses, such as answering people who commented on your user's posts; spam and unauthorized automation can get accounts restricted.
Still have questions? Our team is here to help.
Talk to an expert
