Skip to content

Fetching comments

Collect comments

When a scraping job is executed with the get_comments parameter set to true, all publicly available (non-deleted) comments for the specified video will be collected. You can retrieve these comments using the following endpoint.

To retrieve comments, you’ll need to use the post_id associated with the target Instagram post. This value is provided in the scraping results.

Base URL

GET https://instagram-scraper-api.datashake.com/v1/scrape/:request_id/comments

Path parameters

request_id

Field type: string
Required: true
Description: The unique identifier for the scraping request.

Request parameters

post_id

Field type: string
Required: true
Description: The unique identifier for the Instagram post.

page

Field type: integer
Required: false
Description: The page number of the results to retrieve.

per_page

Field type: integer
Required: false
Description: The number of results to retrieve per page.

Code example
curl --location 'https://instagram-scraper-api.datashake.com/v1/scrape/1742515679047322765-7538bd54-2bd7-45/comments?post_id=DGR-uEoRrfg&page=1&per_page=10' --header 'x-api-key: your-api-key'
import requests

url = "https://instagram-scraper-api.datashake.com/v1/scrape/comments/DGR-uEoRrfg"

params = {
    "post_id": "DGR-uEoRrfg",
    "page": 1,
    "per_page": 10
}
headers = {
    "x-api-key": "your-api-key"
}

response = requests.get(url=url, headers=headers, params=params)

Response

API response example
{
   "request_id":"1743405732704235622-3e02dd3d-6b32-49",
   "status":"completed",
   "credits_used":null,
   "request_metadata": {
        "url": "https://www.instagram.com/p/DFtCWGsTqIp/",
        "callback_url": "http://example.com/callback",
        "external_identifier": "my-custom-id",
        "get_comments": true
    },
   "results": [
      {
         "post_id":"DGR-uEoRrfg",
         "comment_id":"18066396955937624",
         "text":"Thank you iykyk💀💀☠",
         "author": {
            "username": "unicorn222605",   
            "name": null,   
            "id": null,   
            "profile_picture_url": "https://instagram.fixc1-10.fna.fbcdn.net/v/t51.2885-19/464760996_1254146839119862_3605321457742435801_n.png?stp=dst-jpg_e0_s150x150_tt6&cb=8577c754-c2464923&_nc_ht=instagram.fixc1-10.fna.fbcdn.net&_nc_cat=1&_nc_oc=Q6cZ2QFqUYilag6hQQs8Tiiu33u5pVDAdPxFyjHeuv9Vf1lirKkYnlxTyqyxDdF21AQqM449RrTetKT8IxtGC2OPcZeI&_nc_ohc=_lpPTFB1ZXQQ7kNvgE409w9&_nc_gid=HcLn7KXxrP9Js4p8Wpar1A&edm=AB11_MABAAAA&ccb=7-5&ig_cache_key=YW5vbnltb3VzX3Byb2ZpbGVfcGlj.3-ccb7-5-cb8577c754-c2464923&oh=00_AYGPYNf-ZkHYk4dQ3YKuqikOrVsRwl5ra92Q43LrU0kV6w&oe=67F1EF68&_nc_sid=dc5e7f",   
         },
         "upload_date": "2025-04-01",
         "replies_count":0,
         "likes_count":0,
      },
      {
         "post_id":"DGR-uEoRrfg",
         "comment_id":"18048955931201374",
         "text":"❤️❤️❤️❤️❤️❤️",
         "author": {
            "username": "bos_sbaby360",
            "id": null,
            "name": null,
            "profile_picture_url": "https://instagram.frmq2-2.fna.fbcdn.net/v/t51.2885-19/302403684_620810122747237_8922849619033907948_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_ht=instagram.frmq2-2.fna.fbcdn.net&_nc_cat=101&_nc_oc=Q6cZ2QGh_YTQRa7YJx7TXNWwGCG_WRCkqBC5rROfnmfbo4lrTB9fjRmeCHcZpmaKPz5bMI8&_nc_ohc=9En2X67Py4QQ7kNvgFyVxUt&_nc_gid=1vwAb-gaOPNNKKRihstv-Q&edm=APs17CUBAAAA&ccb=7-5&oh=00_AYEDQPESH0Uv9gaVJfePe4lQr-Tgb8LKnjC5NnQmPXIlvA&oe=67F1C972&_nc_sid=10d13b",
         },
         "upload_date": "2025-04-01",
         "replies_count":0,
         "likes_count":0,
      },
      ...
   ],
   "summary":null,
   "pagination":{
      "total":8,
      "page":1,
      "per_page":10,
      "total_pages":1
   }
}