100 free credits — no credit card required.Start building
Logo
Developer tutorial

How to scrape Instagram comments with Python (2026)

This tutorial shows how to scrape Instagram comments in Python using the SocialCrawl API. You get each comment's text, author, like count, timestamp, and reply count for a given post URL, with cursor pagination from one GET request, with no Instagram developer account, proxies, or HTML parsing. The code below is runnable as-is, and the response underneath it is a real, unedited call.

How it works

  1. 1
    Get a free API keyCreate a SocialCrawl account and copy your API key from the dashboard. Every new account starts with free credits.
  2. 2
    Set up PythonInstall the requests library with `pip install requests`.
  3. 3
    Call the Instagram Post Comments endpointSend a GET request to /v1/instagram/post/comments with your API key in the x-api-key header and the `url` parameter.
  4. 4
    Read the responseParse the JSON. SocialCrawl returns each comment's text, author, like count, timestamp, and reply count for a given post URL, with cursor pagination in one normalized schema, so you write no HTML parsing or proxy code.

The code

A real, unedited response from the request above.

import requests

response = requests.get(
    "https://www.socialcrawl.dev/v1/instagram/post/comments",
    headers={"x-api-key": "YOUR_API_KEY"},
    params={"url": "https://www.instagram.com/p/DXidPIVDU6M/"},
)
data = response.json()
print(data)
[ RESPONSE ]
{
  "success": true,
  "platform": "instagram",
  "endpoint": "/v1/instagram/post/comments",
  "data": {
    "items": [
      {
        "comment": {
          "id": "18117485308668753",
          "url": null,
          "parent_id": null,
          "post_id": null,
          "text": "Tons of Anarchy",
          "author": {
            "username": "jarredsj26",
            "display_name": null,
            "avatar_url": "https://scontent-mad2-1.cdninstagram.com/v/t51.82787-19/687186353_18588797374033702_3901722029751450674_n.jpg?stp=dst-jpg_e0_s150x150_tt6&_nc_cat=104&ig_cache_key=GLGh9Sgm70eoaQpCADK8pouDsyU2bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=ls2w_0CyrAYQ7kNvwG4h8s4&_nc_oc=AdozgAd59OMY9RC2nwTdXLSGNI-Voyv-tGKPX_T7JpBw2tBcGTyvFPTMQ8YWWldPPWg&_nc_ad=z-m&_nc_cid=0&_nc_zt=24&_nc_ht=scontent-mad2-1.cdninstagram.com&_nc_gid=psQMb0zYldpmJHjks4TXtg&_nc_ss=783ba&oh=00_AQAo_e5sNdsrSJOwtePDWzvQrrs5koY2FWVjkl5g0cDHIA&oe=6A634198",
            "verified": false
          },
          "engagement": {
            "likes": 39181,
            "replies": 112
          },
          "flags": {
            "pinned": null,
            "deleted": false
          },
          "published_at": "2026-05-02T19:24:27.000Z"
        }
      },
      {
        "comment": {
          "id": "18046487261746100",
          "url": null,
          "parent_id": null,
          "post_id": null,
          "text": "That bike wasn’t originally that color it just can’t breathe",
          "author": {
            "username": "scotthilliard82",
            "display_name": null,
            "avatar_url": "https://scontent-mad1-1.cdninstagram.com/v/t51.82787-19/627516221_17977973213970637_4902965198421977432_n.jpg?stp=dst-jpg_e0_s150x150_tt6&_nc_cat=106&ig_cache_key=GD0jZyXNQDMT394-AFhpC-be1ApEbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=DCDLSFjamsEQ7kNvwGmULdo&_nc_oc=AdodTsudedtmxWFuIToJITn--pW9UrcN4wnvVAMdLo0gr2XA4lcMgxG32_bq0HDdHQM&_nc_ad=z-m&_nc_cid=0&_nc_zt=24&_nc_ht=scontent-mad1-1.cdninstagram.com&_nc_gid=psQMb0zYldpmJHjks4TXtg&_nc_ss=783ba&oh=00_AQD5iVBxq71OBhR4ApsldTLxYEtPljqajycLU6lmLed3Vg&oe=6A63519A",
            "verified": false
          },
          "engagement": {
            "likes": 25398,
            "replies": 48
          },
          "flags": {
            "pinned": null,
            "deleted": false
          },
          "published_at": "2026-04-25T05:29:20.000Z"
        }
      }
    ],
    "next_cursor": "{\"cached_comments_cursor\":\"18050174852518170\",\"bifilter_token\":\"GgYYgQEA0bljp4upQABR6wvEwV1AALQTrj4vHUAA9LykotgtQADmxENlpKc_AP47nyoXUEAAJOwsUDzvPwAGynjb_5Q_AOEblJVHfz8ATuhF3MjJPwA6etk2olVAAHQSzZQeU0AAsAjaR3hHQABkcN70XtE_AHAGbDq6CEIA-5JhUs8vQAAA\"}",
    "total": 3262,
    "dropped": 0
  },
  "credits_used": 5,
  "credits_remaining": 9999,
  "request_id": "req_example000000",
  "cached": false,
  "pagination": {
    "next_cursor": "sc.eyJ2IjoyLCJjIjoie1wiY2FjaGVkX2NvbW1lbnRzX2N1cnNvclwiOlwiMTgwNTAxNzQ4NTI1MTgxNzBcIixcImJpZmlsdGVyX3Rva2VuXCI6XCJHZ1lZZ1FFQTBibGpwNHVwUUFCUjZ3dkV3VjFBQUxRVHJqNHZIVUFBOUx5a290Z3RRQURteEVObHBLY19BUDQ3bnlvWFVFQUFKT3dzVUR6dlB3QUd5bmpiXzVRX0FPRWJsSlZIZno4QVR1aEYzTWpKUHdBNmV0azJvbFZBQUhRU3paUWVVMEFBc0FqYVIzaEhRQUJrY043MFh0RV9BSEFHYkRxNkNFSUEtNUpoVXM4dlFBQUFcIn0iLCJwIjoiY3Vyc29yIn0",
    "has_more": true,
    "page_size": 15
  }
}
API reference for this endpoint

Prefer another language?

FAQ

Have a question? We got answers

Find answers to frequently asked questions about SocialCrawl's API, pricing, and capabilities.

Contact us
Do I need a Instagram developer account to scrape Instagram comments?
No. SocialCrawl handles authentication and proxies upstream, so you never register a Instagram app, manage OAuth tokens, or run your own scrapers. One API key returns Instagram data directly.
What does the Instagram Post Comments endpoint return?
It returns each comment's text, author, like count, timestamp, and reply count for a given post URL, with cursor pagination. The response is normalized into SocialCrawl's unified schema, identical in shape across every platform.
How much does it cost to scrape Instagram comments?
Each call costs a small number of credits, and new accounts start with free credits. There are no monthly minimums, so you pay only for the calls you make.
Can I use this Python code in production?
Yes. The snippet on this page is the real request against the live API. For production, add error handling and follow the response cursor to paginate through large result sets.

Ask AI about SocialCrawl