Skip to content

Python guide

Scrape Instagram comments
with Python.
One script. Every page.

Text, likes and dates for the comments on a public Instagram post or reel, saved to CSV. One API key. No Instagram login, cookies or browser.

  • 3 creditsper page
  • 14comments on the recorded page
  • 0Instagram logins
import csv
import os
import requests

API_URL = "https://www.monocrawl.com/v1/instagram/post-comments"
HEADERS = {"x-api-key": os.environ["MONOCRAWL_API_KEY"]}
POST = "https://www.instagram.com/p/DdttvvwsKwS/"


def get_comments(post_url, max_pages=100):
    params = {"url": post_url}
    for _ in range(max_pages):
        body = requests.get(API_URL, params=params, headers=HEADERS, timeout=60).json()
        if not body.get("success"):
            raise RuntimeError(body["error"]["message"])
        yield from body["data"]["items"]
        if not body["data"].get("has_more"):
            break
        params = {"url": post_url, "cursor": body["data"]["cursor"]}


with open("comments.csv", "w", newline="", encoding="utf-8") as file:
    writer = csv.writer(file)
    writer.writerow(["id", "created_at", "likes", "author", "text"])
    for comment in get_comments(POST):
        author = comment.get("author") or {}
        writer.writerow([comment["id"], comment["created_at"], comment["likes"],
                         author.get("handle"), comment["text"] or ""])

$ python comments.py

GET /v1/instagram/post-comments page 1

✓ 14 comments · 3 credits · has_more: true

↻ following the cursor until has_more is false

✓ comments.csv · this reel: 399 comments ≈ 29 pages ≈ 87 credits (estimate)

Replay of a real call, recorded 26 Sep 2026

Four steps

Copy, paste, run.
See what each step returns.

Terminal
export MONOCRAWL_API_KEY="mn_your_key_here"
pip install requests

What you get

MONOCRAWL_API_KEY=mn_••••••••Free plan · 1,000 credits a month · No card

What comes back

One page.
Real comments.

A real page from Gymshark’s reel announcing its Sam Sulek collection: 14 of its 399 comments, for 3 credits. 8 are below, commenters left out.

  • idThe comment’s Instagram id
  • textWhat the commenter wrote
  • created_atWhen, as an ISO timestamp
  • likesLikes on the comment
  • authorThe commenter’s public profile
  • has_moreWhether another page follows
  1. that's a long time without the bathroom

    026 Sept 2026
  2. Samsung Led

    026 Sept 2026
  3. This is cold!

    026 Sept 2026
  4. Havnt picked up some Gymshark in a while, hoping this is the one!

    026 Sept 2026
  5. Finally your actually in one this is what we want

    026 Sept 2026
  6. Cinema

    026 Sept 2026
  7. Why does this guy always wear a hat?

    026 Sept 2026
  8. Pls don’t have it be all boxed in fit for tops/shirts/jumpers etc 🤞🏾

    026 Sept 2026
Show the JSON
{
  "success": true,
  "data": {
    "count": 14,
    "has_more": true,
    "cursor": "mlc1.…",
    "items": [
      {
        "id": "18127312405853087",
        "text": "that's a long time without the bathroom",
        "created_at": "2026-09-26T17:26:31.000Z",
        "likes": 0
      },
      {
        "id": "18123663448851610",
        "text": "Samsung Led",
        "created_at": "2026-09-26T17:25:34.000Z",
        "likes": 0
      },
      {
        "id": "17942273697349910",
        "text": "This is cold!",
        "created_at": "2026-09-26T16:44:41.000Z",
        "likes": 0
      },
      {
        "id": "18227681749328346",
        "text": "Havnt picked up some Gymshark in a while, hoping this is the one!",
        "created_at": "2026-09-26T16:12:39.000Z",
        "likes": 0
      },
      {
        "id": "18000210033021694",
        "text": "Finally your actually in one this is what we want",
        "created_at": "2026-09-26T16:05:41.000Z",
        "likes": 0
      },
      {
        "id": "17909398872510621",
        "text": "Cinema",
        "created_at": "2026-09-26T14:28:44.000Z",
        "likes": 0
      },
      {
        "id": "18121956046903852",
        "text": "Why does this guy always wear a hat?",
        "created_at": "2026-09-26T14:22:08.000Z",
        "likes": 0
      },
      {
        "id": "18114776474470276",
        "text": "Pls don’t have it be all boxed in fit for tops/shirts/jumpers etc\n🤞🏾",
        "created_at": "2026-09-26T11:30:03.000Z",
        "likes": 0
      }
    ]
  }
}

Cost

3 credits a page.
Nothing for failures.

Every page of comments costs 3 credits; the recorded page returned 14. Replies cost 2 credits a page. Slide to see what a post costs.

87credits, 3 per page
11posts like this a month on the free plan
114on Starter, $29 a month

Estimated at 14 comments a page, as on the recorded page. Failed calls are free.

Two more things

Replies, errors
and rate limits.

Replies to a comment

A comment with replies has its own thread. Fetch it from instagram/comment-replies with the post URL and the comment’s id: same fields, same cursor, 2 credits a page.

replies.py
REPLIES_URL = "https://www.monocrawl.com/v1/instagram/comment-replies"

params = {"url": POST, "comment_id": "18227681749328346"}
body = requests.get(REPLIES_URL, params=params, headers=HEADERS, timeout=60).json()
for reply in body["data"]["items"]:
    print(reply["likes"], reply["text"])

Errors and rate limits

A failed call returns success: false with an error type and message, and costs nothing. On HTTP 429, wait and try again.

Rate limits by plan
comments.py
import time

def get_page(params, attempts=5):
    for attempt in range(attempts):
        response = requests.get(API_URL, params=params, headers=HEADERS, timeout=60)
        if response.status_code != 429:
            return response.json()
        time.sleep(2 ** attempt)
    raise RuntimeError("Still rate limited; try again later")

Other platforms

Same loop.
Swap the endpoint.

The same key collects comments from other platforms. Each endpoint’s reference lists its fields and paging.

Questions

Scraping Instagram comments,
answered.

Do I need an Instagram account, cookies or a browser?

No. You call Monocrawl with your API key and get the comments back as JSON. It works for public posts and reels.

How many comments does one call return?

One page. The recorded page returned 14, with has_more set to true and a cursor for the next page. Pass the cursor back with the same post URL.

What does it cost?

3 credits for each page that comes back, and 2 credits a page for replies. The free plan’s 1,000 credits a month cover about 333 pages, and failed calls are free.

Can I get the replies to a comment?

Yes. Use instagram/comment-replies with the post URL and the comment’s id. It returns replies with the same fields and pages them the same way.

How do I find an account’s posts first?

Call instagram/posts with the account’s handle. It returns recent posts with their URLs and comment counts, 1 credit a page. Then run this loop on each post URL.

Does Instagram have an official API for comments?

Meta’s Instagram API returns comments on accounts you manage. Our Instagram data API comparison sets out the official routes and the main providers side by side.

Start free

The comments on any public Instagram post.
3 credits a page.

1,000 free credits every month. No card required.

Get a free API key