YepAPI
Instagram API

Post Comments

Get comments on an Instagram post with pagination.

POST/v1/instagram/post-comments
$0.01/call

Usage

const res = await fetch('https://api.yepapi.com/v1/instagram/post-comments', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ shortcode: 'C5xAbCdEfGh' }),
});
const { data } = await res.json();
console.log(data);
curl -X POST https://api.yepapi.com/v1/instagram/post-comments \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"shortcode": "C5xAbCdEfGh"}'

Request Body

ParameterTypeRequiredDescriptionDefault
shortcodestringYesPost shortcode from the Instagram URL
end_cursorstringNoPagination cursor from previous response

Response

{
  "ok": true,
  "data": {
    "has_next_page": true,
    "end_cursor": "QVFDcE...",
    "comment_count": 1200,
    "comments": [
      {
        "id": "17891234567890123",
        "text": "Absolutely breathtaking!",
        "created_at": 1712346000,
        "like_count": 4500,
        "reply_count": 12,
        "owner": {
          "username": "photo_fan",
          "profile_pic_url": "https://scontent.cdninstagram.com/...",
          "is_verified": false
        }
      },
      {
        "id": "17891234567890124",
        "text": "Where was this taken?",
        "created_at": 1712347000,
        "like_count": 230,
        "reply_count": 3,
        "owner": {
          "username": "traveler_mike",
          "profile_pic_url": "https://scontent.cdninstagram.com/...",
          "is_verified": false
        }
      }
    ]
  }
}

Response Fields

FieldTypeDescription
okbooleanWhether the request succeeded
data.has_next_pagebooleanWhether more comments are available
data.end_cursorstringCursor for fetching the next page
data.comment_countnumberTotal number of comments on the post
data.commentsobject[]Array of comment objects
data.comments[].idstringUnique comment identifier
data.comments[].textstringComment text
data.comments[].created_atnumberUnix timestamp of when the comment was posted
data.comments[].like_countnumberNumber of likes on the comment
data.comments[].reply_countnumberNumber of replies to this comment
data.comments[].ownerobjectComment author information

Use the end_cursor value from the response to paginate through comments.

On this page