Have a question?

Contact Us

How to scrape Instagram — ScrapingBot

How to scrape Instagram?

5 min read
Web scraping 8 min read  ·  Published: 06/05/2026

Instagram Scraper API: How to Extract Profiles, Hashtags and Posts with ScrapingBot

Looking for a reliable Instagram scraper API? With over 1.2 billion users, Instagram is one of the biggest social networks in the world — and a goldmine of marketing data. This guide shows you how to use ScrapingBot's Instagram scraper API to extract profiles, hashtags, and posts in clean JSON, without any blocking.

1. Why use an Instagram scraper API?

Instagram is much more than a photo-sharing app. With over 1.2 billion active users, it has become a key platform for brands, marketers, and researchers alike. As a result, using an Instagram scraper gives you access to highly valuable and actionable data:

  • Stay up to date with current trends and viral content in your industry
  • Understand your audience's interests through hashtag and post analysis
  • Benchmark influencers by follower count and engagement rate
  • Track competitor brand activity and content performance
  • Build social listening pipelines for real-time market intelligence

On top of that, Instagram's public data is rich and diverse — from profile biographies and post captions to likes, comments, and media URLs. Web scraping is therefore the most efficient way to collect all of this automatically at scale.

2. What data can your Instagram scraper collect?

ScrapingBot's Instagram scraper supports three types of data extraction. Below is a breakdown of what you get for each type:

Instagram Profiles scraper

FieldDescriptionType
usernameInstagram handlestring
profileImageURL of the profile picturestring
biographyProfile bio textstring
externalURLLink in biostring
followersNumber of followersinteger
followingNumber of followed profilesinteger
postsNumber of posts + post detailsarray
likes (per post)Number of likes on each postinteger
comments (per post)Comments on each postarray
verifiedVerified badge statusboolean

Instagram Hashtags

FieldDescriptionType
postURLURL of the poststring
authorIDPost author identifierstring
mediaURLURL of the post mediastring
postTextCaption text of the poststring
commentsNumber of commentsinteger
likesNumber of likesinteger

Instagram Posts

FieldDescriptionType
postURLURL of the poststring
postDatePublication datestring
postTextCaption textstring
likesNumber of likesinteger
commentsNumber of commentsinteger
mediaMedia URLs (images/videos)array
sponsorSponsored content indicatorboolean
sponsorLinksSponsor URL if applicablestring

3. Technical challenges of an Instagram scraper API

Instagram, as a Meta platform, is one of the most heavily protected social networks against automated access. Before diving into the code, it is essential to understand what you would face trying to scrape it directly:

  • Anti-bot detection — Instagram identifies headless browsers and blocks suspicious requests almost instantly.
  • JavaScript rendering — Profile and post data loads dynamically; therefore, a plain HTTP request returns an empty shell.
  • IP rate limiting — Repeated requests from the same IP trigger temporary or permanent bans.
  • Login walls — Most profile data requires authentication, adding another layer of complexity.
  • Frequent API changes — Meta regularly updates its infrastructure, which means scrapers break without warning.

4. How ScrapingBot handles them

Automatic IP rotation and JS rendering

Instagram scraper — example of a public Instagram profile

A public Instagram profile — followers, posts, bio and media are all extractable with ScrapingBot's Instagram scraper.

ScrapingBot's Instagram scraper abstracts all of this complexity. It rotates residential IPs automatically, handles JavaScript rendering, and manages authentication layers — so you get clean structured JSON without maintaining any browser automation infrastructure yourself.

Two-step API pattern

In addition, the API uses a two-step request pattern specifically designed to bypass social network protections. First, a POST call initiates the scraping job. Then, once the job is complete, a GET call retrieves the structured result. As a result, you can collect data reliably without worrying about bans or blocks.

5. Step-by-step: build your Instagram scraper API

Step 1 — Create a ScrapingBot account

To get started, ScrapingBot offers free access with 100 credits per month — no payment information required. If you already have an account, simply log in and head to the Documentation.

Step 2 — First API call: get your Response ID

Next, send a POST request to initiate the scraping job. The scraper parameter determines what type of Instagram data you want to extract:

POST http://api.scraping-bot.io/scrape/data-scraper

Depending on what you want to scrape, use one of the following configurations:

Scraper valueParameterDescription
instagramProfileaccountURL of the Instagram profile to scrape
instagramHashtaghashtagInstagram hashtag to scrape (e.g. #travel)
instagramPosturlURL of the Instagram post to scrape

For example, to scrape an Instagram profile, your request body would look like this:

{
  "scraper": "instagramProfile",
  "account": "https://www.instagram.com/username/"
}
💡 Note: The scraper value must be exactly instagramProfile, instagramHashtag, or instagramPost — the API is case-sensitive.

Step 3 — Second API call: retrieve your data

Once you have your responseId, send a GET request to fetch the result:

GET http://api.scraping-bot.io/scrape/data-scraper-response?responseId=YOUR_RESPONSE_ID&scraper=instagramProfile

Should the scraping job still be running, you will receive a pending message:

{ "status": "pending", "message": "Scraping is not finished for this request, try again in a few" }

In that case, retry the GET request after a few seconds. In practice, most requests complete quickly.

Full Python example — scraping an Instagram profile

Here is a complete Python script that handles both API calls and polls until the data is ready:

import requests
import time

USERNAME = "your_username"
API_KEY  = "your_api_key"
AUTH     = (USERNAME, API_KEY)

TARGET_ACCOUNT = "https://www.instagram.com/natgeo/"

# Step 1 — Initiate the scraping job
post_response = requests.post(
    "https://api.scraping-bot.io/scrape/data-scraper",
    json={"scraper": "instagramProfile", "account": TARGET_ACCOUNT},
    auth=AUTH
)
response_id = post_response.json().get("responseId")
print(f"Response ID: {response_id}")

# Step 2 — Poll until the result is ready
while True:
    get_response = requests.get(
        f"https://api.scraping-bot.io/scrape/data-scraper-response"
        f"?responseId={response_id}&scraper=instagramProfile",
        auth=AUTH
    )
    data = get_response.json()

    if data.get("status") == "pending":
        print("Pending... retrying in 3 seconds")
        time.sleep(3)
    else:
        print("Data retrieved:")
        print(data)
        break

Parsing the response

Finally, once the response is retrieved, here is how to extract the key fields cleanly:

def parse_instagram_profile(raw):
    d = raw.get("data", {})
    return {
        "username":     d.get("username"),
        "biography":    d.get("biography"),
        "external_url": d.get("externalURL"),
        "followers":    d.get("followers"),
        "following":    d.get("following"),
        "post_count":   d.get("posts"),
        "verified":     d.get("verified"),
    }

profile = parse_instagram_profile(data)
print(profile)

6. Going further

Once your Instagram scraper is up and running, you can pipe the raw data into a CSV with pandas, store it in a database, or feed it into a marketing analytics dashboard.

Moreover, you can combine profile, hashtag, and post scrapers to build a comprehensive social listening pipeline. Additionally, ScrapingBot supports Threads, TikTok, LinkedIn, and many other platforms via the same API interface — ideal if you're building a multi-source social data strategy.

Ready to try it? Get 100 free credits when you sign up for ScrapingBot — no credit card required.

Try ScrapingBot for free →

Looking for something more specific?

Start using ScrapingBot

Ready to Unlock Web Data?
Data is only useful once it’s accessible. Let us do the heavy lifting so you can focus on insights.