Comments API
Read and answer comments on every post, from one API
List the comments on posts you published through postpeg, reply in the thread, and hide the ones you don’t want shown, on Instagram, Facebook, LinkedIn and Threads. One comment shape for every network, so one inbox in your product covers them all.
List comments
GET /v1/posts/{id}/comments returns top-level comments, each with the replies the network includes inline, the author, like and reply counts, and whether it’s hidden. author.is_owner is true for comments written by the connected account itself, so you can tell your user’s replies from everyone else’s. Pass next_cursor back as cursor for the next page.
Comment or reply
POST /v1/posts/{id}/comments with text (up to 8,000 characters) comments on the post itself; add reply_to with a comment id to answer in its thread. Send an Idempotency-Key header so a retry never posts the same reply twice.
curl https://api.postpeg.com/v1/posts/post_mfz2k3v8q1w5e9r4t7y0u2i6o3/comments \
-H "Authorization: Bearer $POSTPEG_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: reply-17998765432109876" \
-d '{
"text": "Yes, every scheduled post gets retries, old and new.",
"reply_to": "17998765432109876"
}'{
"id": "18034567890123456",
"account_id": "acc_mfz20b5n1s8f4j7xv2p9r6hu1c",
"platform": "instagram",
"reply_to": "17998765432109876"
}Hide a comment
POST /v1/posts/{id}/comments/{comment_id}/hide hides a comment from everyone but its author; send "hidden": false to show it again. Hiding works on Instagram, Facebook and Threads. LinkedIn doesn’t support it, so there you can list and reply only.
Posts on several accounts
A post can go to several accounts that support comments, say Instagram and LinkedIn. Then pass account_id to say which one you mean; without it you get a 400 that lists the choices. Comments need the post to be live on that account: naming a target that failed or hasn’t published yet returns a 409 with its status.
Building a comment inbox
A typical inbox keeps it simple: list your recent posts with GET /v1/posts?status=published, fetch each one’s comments, and show the ones where author.is_owner is false and no reply of yours follows. When your user answers, send the reply with an Idempotency-Key built from the comment id, so a double click or a retried request can’t answer twice.
Because every network returns the same comment shape (id, text, author, counts, parent_id, is_hidden), one component renders Instagram, Facebook, LinkedIn and Threads threads alike. Label each with its platform so your user knows where the reply will appear.
Where comments are available
Comments work on Instagram, Facebook, LinkedIn and Threads. Asking for comments on another network returns a 400 naming it. See the comments docs for every field.
Questions
- Can I read comments on posts I didn’t publish through postpeg?
- No. The comments endpoints work on posts published through postpeg, addressed by the postpeg post id.
- Which networks let me hide comments?
- Instagram, Facebook and Threads. LinkedIn comments can be listed and replied to, but not hidden.
- Will a retried reply post twice?
- Not if you send an
Idempotency-Keyheader. A repeat of the same request returns the first reply instead of creating another. - Are comment requests limited by plan?
- No. Comments are unlimited on every paid plan, within the API’s rate limits and the networks’ own.
The rest of the API
- Posting APIPost text, images and video to any mix of accounts in one request, checked against each network’s rules before anything is sent.
- Scheduling APIPass scheduled_at up to a year ahead. Posts go out within a minute of their time, and can be cancelled until they do.
- Analytics APIImpressions, reach, likes, shares and follower growth per post and per account, with null where a network doesn’t report a number.
- Instagram DM APIRead direct-message conversations and reply to people who wrote first, within the 24-hour window.
Send your first post in a few minutes
The 7-day trial has every feature and 3 connected accounts, with no card. The quickstart takes you from a key to a published post.