Comment Moderation

IGTV media is now supported in v10.0+. This applies to all endpoints except those used for content publishing and webhooks. To support this change, new media_product_type and video_title fields have been added to the IG Media node. IGTV media must have been shared to Instagram at the time of publish (Post a Preview or Share Preview to Feed enabled) in order to be accessible via the API.

You can use the Instagram Graph API to reply to comments, delete comments, hide/unhide comments, and disable/enable comments on IG Media objects owned by Instagram Business and Instagram Creator Accounts.

Endpoints

The API consists of the following endpoints. Refer to each endpoint's reference documentation for parameter and permission requirements.

Examples

Getting & Replying to Comments

You can get all of the comments on a media object, analyze and filter the returned data set against specific criteria, then reply to any comments that match your criteria.

First, query the GET /{ig-media-id}/comments endpoint to get all of the comments and their IDs on the media object:

Sample Request

GET graph.facebook.com
  /17895695668004550/comments

Sample Response

{
  "data": [
    {
      "timestamp": "2017-08-31T18:10:30+0000",
      "text": "I love this!",
      "id": "17873440459141021"
    },
    {
      "timestamp": "2017-08-31T19:16:02+0000",
      "text": "This is awesome!",
      "id": "17870913679156914"
    },
    ... // results truncated for brevity
  ]
}

Next, parse the returned results for comments that match whatever criteria you are using and use the matching comments to reply in the comment thread to the Instagram users who made the comments:

Sample Request

POST graph.facebook.com
  /17870913679156914/replies?message=Thanks%20for%20sharing!

Sample Response

{
  "id": "17873440459141029"
}

If you have a lot of comments that you want to reply to, you could batch the replies into a single request.