← Back to Blog
Product Education2025-01-15by Social Flex Team

What Is Instagram Post Scraping? A Complete Guide for 2026

What Instagram post scraping is, what data you can collect from a public post, the legal picture, the three ways to do it, and a working API example.

instagram scrapingdata extractionsocial media analyticsinstagram apiweb scraping

Instagram post scraping means collecting the data attached to a public post or reel with software instead of by hand. For a post with a few dozen comments you can copy what you need. For a post with thousands, or for a hundred posts, you need a tool.

This guide covers what you can collect, what the law and Instagram's terms say, the three ways to do it, and a working example.

What data can you get from a public post?

A public Instagram post or reel exposes two kinds of data.

The post itself

  • The author's username
  • The caption, including hashtags and mentions
  • The like count and comment count
  • The date it was posted
  • The cover image

The comments under it

  • The commenter's username
  • The comment text
  • When it was posted
  • How many likes it received
  • Replies to the comment, each with the same fields

Private accounts are out of scope. If you cannot see a post in a browser without following the account, a scraper should not be collecting it either.

What people use it for

Giveaways and contests. Export every comment on the giveaway post, remove duplicates, check each entry against your rules, and pick a winner from a list you can show to anyone who asks.

Customer feedback. Comments on product posts are unprompted feedback. Exported to a spreadsheet, they can be searched, tagged and counted, which you cannot do inside the Instagram app.

Competitor research. The comments under a competitor's launch post tell you what their customers ask for and complain about.

Influencer vetting. Reading an influencer's comments shows whether the audience is real people talking about the content or rows of generic one-word replies.

Academic and market research. Researchers use comment datasets to study how people talk about a topic in public.

Is scraping Instagram legal?

This is not legal advice, and the answer depends on where you are and what you do with the data. The general picture has three parts.

Instagram's terms. Meta's terms prohibit collecting data from its products by automated means without permission. Scraping is a breach of those terms whatever the courts say about anything else.

US court decisions. Two cases come up most often:

  • In hiQ Labs v. LinkedIn (Ninth Circuit, 2022), the court held that scraping pages open to the public probably does not violate the Computer Fraud and Abuse Act. hiQ later lost on breach-of-contract grounds and the case settled, so the decision was not a blanket approval.
  • In Meta v. Bright Data (Northern District of California, January 2024), the judge ruled that Meta's terms did not bar scraping public data while logged out. The ruling was narrow. It interpreted Meta's terms as written at the time and did not address data behind a login.

Privacy law. Usernames and comments are personal data under laws such as the GDPR, even when they are public. If you collect them you need a lawful basis, a clear purpose, sensible retention limits and a way to honour deletion requests.

Some practical rules follow from that:

  • Collect public data only.
  • Collect what you need for a stated purpose, and no more.
  • Do not use the data to harass, profile or discriminate against people.
  • Do not republish people's comments in a way they would not expect.
  • If the project is commercial or large, ask a lawyer first.

Three ways to collect the data

1. Instagram's official API

Meta's Instagram API is the sanctioned route. It works well for accounts you own or manage: you can read your own posts, the comments on them, and your insights.

It does not let you read the comments on another account's posts, which rules it out for giveaway auditing on someone else's post, competitor research and most market research. It also requires a Business or Creator account and, for anything beyond testing, Meta's app review.

2. Building your own scraper

You can write a scraper yourself. A short script that fetches a post page will not get far, because Instagram loads comments through paginated internal requests that need a valid session, and those requests change without notice.

A working scraper has to handle sessions, pagination through thousands of comments, separate requests for reply threads, rate limiting, and repairs every time Instagram changes something. It suits teams with unusual requirements and the engineering time to maintain it.

3. Using a scraping service

A service runs the scraper for you and gives you a dashboard, an API or both. You hand it a post URL and get structured data back. You pay per result instead of paying in engineering time.

Social Flex is one of these. The rest of this guide uses it for the example.

Example: export every comment from a post

Without code

  1. Create a free account. It comes with 5,000 credits.
  2. Paste the post or reel URL on your dashboard.
  3. Wait for the job to finish, then download the CSV or JSON.

The Instagram comment extractor page walks through the same steps.

With the API

Submit a job, poll until it completes, then fetch the result:

import requests
import time

API_KEY = "sf_live_YOUR_API_KEY"
BASE = "https://api.social-flex.com"
HEADERS = {"X-API-Key": API_KEY, "Content-Type": "application/json"}

# 1. Submit the job
job = requests.post(
    f"{BASE}/scrape",
    headers=HEADERS,
    json={"post_url": "https://www.instagram.com/p/ABC123DEF456/"},
).json()

# 2. Poll until it finishes
while True:
    status = requests.get(f"{BASE}/jobs/{job['id']}", headers=HEADERS).json()
    if status["status"] in ("completed", "failed"):
        break
    time.sleep(5)

# 3. Fetch the result
if status["status"] == "completed":
    data = requests.get(f"{BASE}/jobs/{job['id']}/result", headers=HEADERS).json()
    print(f"{len(data['comments'])} comments from @{data['post']['username']}")

The result looks like this:

{
  "post": {
    "shortcode": "ABC123DEF456",
    "username": "example_user",
    "caption": "Post caption text...",
    "likes": 1250,
    "comments_count": 89,
    "creation_date": "2026-03-10T14:30:00Z"
  },
  "comments": [
    {
      "username": "commenter1",
      "text": "Great post!",
      "likes": 5,
      "reply_count": 2,
      "timestamp": "2026-03-10T15:00:00Z"
    }
  ],
  "total_comments": 89
}

You can also pass a webhook URL and be notified when the job finishes instead of polling. The API documentation has the full reference.

What it costs with Social Flex

  • Comments: 1 credit per comment and 1 per reply. Reply extraction is on paid plans.
  • Post details only: free. A basic scrape returns the caption, counts and date without the comments and uses no credits.
  • Free plan: 5,000 one-time credits, one job every 24 hours, up to 1,000 comments per job.
  • One-off credit packs: from $9 for 10,000 credits. No subscription, and the credits do not expire.
  • Monthly plans: from $19 a month for 30,000 credits.

Current prices are on the pricing page.

Working with the data afterwards

A few habits save time once you have the export:

  • Record when you collected it. Like counts and comment counts keep changing after you scrape.
  • Remove duplicates before counting. People comment more than once, especially on giveaways.
  • Keep the original file. Do your cleaning in a copy so you can go back.
  • Expect every language and plenty of emoji. Open the CSV as UTF-8 so the text is not mangled.

Frequently asked questions

Can I scrape a private account? No. Only public posts, reels and profiles.

Do I need to know how to code? No. The dashboard handles it. The API is there if you want to automate.

Does it use my Instagram account? No. You do not connect or log in with your own Instagram account.

How long does a scrape take? It depends on the number of comments. Small posts finish quickly and posts with tens of thousands of comments take longer. The dashboard and the API both show live progress while a job runs.

Can I get replies as well as top-level comments? Yes, on paid plans. Each reply costs one credit.

Can I scrape more than posts? Yes. Given a profile URL, Social Flex can also return the profile record, export the profile's followers, or build a list of contact details from that audience. Follower and contact exports are on paid plans.


Want to try it on a real post? Create a free account and paste a URL.

Try Social Flex for free

Extract Instagram comments at scale. 5,000 free credits, no credit card required.

Start Free