Social Media Comments API: List, Reply & Hide

How to manage Instagram and Facebook comments programmatically — list, reply, delete, hide, like, and moderate comments across platforms with a single API.

Social Media Comments API: List, Reply & Hide

Publishing is half the job

You build a system that publishes posts across Instagram, Facebook, LinkedIn, and YouTube. It works. Posts go out on schedule, media uploads correctly, everything lands where it should.

Then the comments start coming in. A customer asks a question under your Instagram post. Someone leaves a negative review on your Facebook video. A spam bot drops links on every post from the last week. A brand partner leaves a comment that needs a public reply within an hour.

Most teams handle comments manually — logging into each platform, scrolling through notifications, typing replies one at a time. This works when you manage one account with a few posts per week. It breaks down when you manage multiple accounts, publish daily, or need to respond at scale.

The alternative is managing comments programmatically. Read them via API, reply via API, hide or delete the ones that violate your guidelines, and like the ones worth acknowledging — all without logging into a single platform dashboard.


The challenge with platform-native comment APIs

Each social platform exposes comment functionality differently, and each comes with its own set of limitations.

Instagram uses Meta’s Graph API. To list comments on a media object, you call GET /{media-id}/comments. Replying requires a POST to the same endpoint with a message parameter. You can hide comments, but the endpoint and field names differ from Facebook’s. Deleting is supported, but only for comments made by your Page or business account. You cannot like comments via the Instagram Graph API at all.

Facebook also uses the Graph API, but with different permissions and slightly different behavior. You can list, reply, delete, hide, and like comments on Page posts. Liking uses a POST /{comment-id}/likes endpoint. The permission model is layered — you need pages_manage_engagement on top of pages_read_user_content and pages_show_list, each requiring separate app review submissions.

LinkedIn, Threads, YouTube, and TikTok each have their own comment APIs with different authentication schemes, rate limits, and supported actions. Some require additional app review. Some have limited write access. Some do not support certain operations at all.

If you are building against these APIs directly, you are maintaining separate integrations for each platform. Each one has different error handling, different pagination, and different data shapes. A “list comments” feature that works on Instagram does not transfer to Facebook without rewriting the query, the auth, and the response parsing.


A unified approach to comment management

Postproxy now provides a Comments API that normalizes comment operations across platforms behind a single interface. One set of endpoints, one authentication model, one response format — regardless of which platform the comment lives on.

The API covers the operations that matter for comment management:

OperationWhat it does
ListRetrieve paginated top-level comments with nested replies
GetFetch a single comment by ID
ReplyPost a reply to any comment or to the post itself
DeleteRemove a comment from the platform
Hide / UnhideToggle comment visibility without deleting
Like / UnlikeLike or remove a like from a comment

Every operation uses the same base URL pattern: /api/posts/:post_id/comments. You specify which platform profile to target with the profile_id query parameter. The API handles the platform-specific translation behind the scenes.


Listing and reading comments

The most common starting point is pulling comments for a post. Maybe you are building a moderation dashboard, syncing comments into a CRM, or feeding them into a sentiment analysis pipeline.

Terminal window
curl "https://app.postproxy.dev/api/posts/POST_ID/comments?profile_id=PROFILE_ID" \
-H "Authorization: Bearer YOUR_API_KEY"

The response returns paginated top-level comments, each with a flat replies array containing all nested replies:

{
"total": 42,
"page": 0,
"per_page": 20,
"data": [
{
"id": "abc123",
"external_id": "17858893269123456",
"body": "Love this product! Where can I get one?",
"author_username": "curious_customer",
"author_avatar_url": "https://...",
"like_count": 5,
"is_hidden": false,
"posted_at": "2026-03-30T14:22:00Z",
"replies": [
{
"id": "def456",
"external_id": "17858893269789012",
"body": "Thanks! Link in our bio.",
"author_username": "yourbrand",
"parent_external_id": "17858893269123456",
"posted_at": "2026-03-30T14:35:00Z"
}
]
}
]
}

Pagination applies to top-level comments only. All replies — regardless of nesting depth — are flattened into the replies array of their root comment, sorted by creation date. Each reply retains its parent_external_id so you can reconstruct the thread hierarchy on your side if needed.

One API call gives you a complete conversation view — no follow-up requests to fetch replies for each comment.


Replying to comments programmatically

To reply to a comment:

Terminal window
curl -X POST "https://app.postproxy.dev/api/posts/POST_ID/comments?profile_id=PROFILE_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Thanks for your feedback! Check the link in our bio.",
"parent_id": "abc123"
}'

To post a new top-level comment on the post itself, omit parent_id:

Terminal window
curl -X POST "https://app.postproxy.dev/api/posts/POST_ID/comments?profile_id=PROFILE_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "We just dropped a new color option! Check it out."
}'

Comments are created immediately on Postproxy’s side and published to the platform asynchronously. The initial response returns the comment with status: "pending" and external_id: null. Once the platform confirms publication, the status updates to "published" and the external_id is populated with the platform’s native comment ID.

If you need confirmation that the comment was published, poll the comment status or use webhooks.


Moderating comments: hide, delete, and like

Hiding comments

Hiding is the non-destructive moderation option. The comment stays in the system but becomes invisible to the public. Useful for comments that violate guidelines but that you may want to review or restore later.

Terminal window
# Hide a comment
curl -X POST "https://app.postproxy.dev/api/posts/POST_ID/comments/COMMENT_ID/hide?profile_id=PROFILE_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
# Unhide it later
curl -X POST "https://app.postproxy.dev/api/posts/POST_ID/comments/COMMENT_ID/unhide?profile_id=PROFILE_ID" \
-H "Authorization: Bearer YOUR_API_KEY"

Both return { "accepted": true } and process asynchronously on the platform.

Deleting comments

For content that should be permanently removed:

Terminal window
curl -X DELETE "https://app.postproxy.dev/api/posts/POST_ID/comments/COMMENT_ID?profile_id=PROFILE_ID" \
-H "Authorization: Bearer YOUR_API_KEY"

Deletion is irreversible on the platform. The API returns the comment object with its current state so you can log it before it disappears.

Liking comments

Liking acknowledges a comment without composing a reply.

Terminal window
curl -X POST "https://app.postproxy.dev/api/posts/POST_ID/comments/COMMENT_ID/like?profile_id=PROFILE_ID" \
-H "Authorization: Bearer YOUR_API_KEY"

Note that not all platforms support all actions. Instagram does not support like/unlike via API, for example. Attempting an unsupported action returns a 405 Method Not Allowed with a clear error message indicating which platform lacks support.


Building an automated moderation pipeline

With the Comments API, you can build moderation workflows that run without human intervention for the routine cases and escalate the edge cases.

Here is a pattern for a basic moderation pipeline:

async function moderateComments(postId, profileId) {
const response = await fetch(
`https://app.postproxy.dev/api/posts/${postId}/comments?profile_id=${profileId}&per_page=50`,
{ headers: { "Authorization": `Bearer ${API_KEY}` } }
);
const { data: comments } = await response.json();
for (const comment of comments) {
// Check for spam patterns
if (containsSpam(comment.body)) {
await hideComment(postId, comment.id, profileId);
await logModeration(comment, "hidden", "spam");
continue;
}
// Check for questions that match your FAQ
const faqMatch = matchFAQ(comment.body);
if (faqMatch) {
await replyToComment(postId, comment.id, profileId, faqMatch.answer);
await logModeration(comment, "auto-replied", "faq");
continue;
}
// Like positive comments
if (await analyzeSentiment(comment.body) > 0.8) {
await likeComment(postId, comment.id, profileId);
}
}
}

This handles three common scenarios: spam gets hidden, questions get auto-answered, and positive comments get liked. Anything that does not match these patterns falls through to manual review.

You could extend this with AI-powered classification, keyword blocklists, or escalation rules that flag comments for human review when confidence is low.


Flexible comment ID resolution

Every endpoint that accepts a comment ID in the path works with either Postproxy’s internal ID or the platform’s native external ID. If you already have the platform’s comment ID from another system — a webhook payload, a notification, or a third-party tool — you can use it directly:

Terminal window
# Both of these work
curl "https://app.postproxy.dev/api/posts/POST_ID/comments/abc123xyz?profile_id=PROFILE_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
curl "https://app.postproxy.dev/api/posts/POST_ID/comments/17858893269123456?profile_id=PROFILE_ID" \
-H "Authorization: Bearer YOUR_API_KEY"

Use whichever ID you have.


Platform support and what is coming

The Comments API currently supports Instagram and Facebook with full coverage for listing, replying, deleting, and hiding. Facebook also supports liking and unliking.

Support for Threads, YouTube, and LinkedIn is coming soon. The same endpoints and response format will apply — no integration changes needed.


Use cases

Customer support automation. Pull comments across all posts, classify them by intent (question, complaint, praise, spam), auto-reply to common questions, and route complex issues to your support team.

Brand monitoring and sentiment analysis. Sync comments into your analytics pipeline. Track sentiment over time, identify trending topics in your comment sections, and measure engagement quality beyond simple like counts.

Community management at scale. Manage comments across dozens of accounts and hundreds of posts without switching between platform dashboards. Hide spam in bulk, reply to questions consistently, and maintain brand voice across platforms.

Content performance feedback loops. Feed comment data back into your content strategy. Posts that generate questions might need clearer calls to action. Posts that generate complaints might indicate messaging misalignment. Posts that generate praise tell you what is working.

Compliance and moderation. Enforce content guidelines programmatically. Auto-hide comments containing prohibited content, log all moderation actions for audit trails, and ensure consistent policy enforcement across platforms and accounts.


Getting started

The Comments API is available now for all Postproxy accounts. If you are already using the publishing API, you already have access — no additional setup required.

  1. Pick a post — you need a published post’s ID and the profile_id for the platform profile you want to manage comments on.
  2. List commentsGET /api/posts/:post_id/comments?profile_id=PROFILE_ID to see what is there.
  3. Take action — reply, hide, delete, or like based on your use case.

Full endpoint documentation, request/response examples in seven languages, and error reference are in the Comments API reference.

Ready to get started?

Start with our free plan and scale as your needs grow. No credit card required.