Instagram API · 100 free credits

Instagram data,
without the login.

Send a username, a post URL or a keyword and get structured JSON back: profiles, followers, posts, reels, stories, comments and search results. No Instagram account, cookies or sessions to manage.

Real examples
POST/api/v1/instagram endpoint/user/by_usernameusernamenasa
Free account, 100 credits to start. No card needed. Try your own
Real response
Profile by username Hover anything to see its field, click to find it in the JSON
Hover a line or the preview to see its JSON path
Endpoints

Twenty endpoints. One request shape.

Every call is a POST to /api/v1/instagram with an endpoint path and its params, and every response comes back in the same envelope, with the results in data.

Request format
POST https://scrapingbot.io/api/v1/instagram
x-api-key: YOUR_API_KEY
content-type: application/json

{
  "endpoint": "/medias/by_user_id",
  "params": { "user_id": "25025320", "count": 12 }
}

You can also send the key as a Bearer token or an api_key query parameter.

Profiles 3

/user/by_username

Profile by username

The full public profile: bio, follower and following counts, verification, category, links and the numeric id.

  • username required · handle, @handle or profile URL

/user/by_id

Profile by ID

The same profile, looked up by numeric user ID. Send a username instead and it switches lookups for you.

  • user_id required

/user/quick_by_username

Quick profile lookup

An alias of /user/by_username with the same response, kept for existing integrations.

  • username required
Followers 2

/followers/by_user_id

Followers

Accounts that follow a profile, a page at a time, with the total in user_count. Search the whole list by name with query. Very large accounts show only about 50 recent followers.

  • user_id required
  • query · username or name to find
  • max_id · next_max_id from the previous page

/following/by_user_id

Following

Accounts a profile follows, a page at a time, searchable with query.

  • user_id required
  • query · username or name to find
  • max_id · next_max_id from the previous page
Posts, reels and stories 4

/medias/by_user_id

User posts

A page of a profile’s posts with captions, media, like and comment counts, plus page_info for the next page.

  • user_id required
  • count · 1–50, default 12
  • end_cursor · from page_info

/reels/by_user_id

User reels

A page of a profile’s reels with media, captions and engagement, plus paging_info for the next page.

  • user_id required
  • page_size · 1–50, default 12
  • max_id · from paging_info

/medias/tagged_by_user_id

Tagged posts

Posts in which other accounts tagged the profile.

  • user_id required
  • count · up to 12
  • end_cursor · from page_info

/stories/by_username

Stories

A profile’s active stories with image and video links, when each was posted and when it expires. Empty when there are none.

  • username required · handle, @handle or profile URL
Single posts 4

/media/by_url

Post or reel by URL

One post or reel with caption, owner, media versions, like and comment counts.

  • url required · post or reel URL

/media/by_shortcode

Post by shortcode

The same lookup using the code from the URL, such as Dd9RyBWBVih.

  • shortcode required

/media/shortcode_to_id

Shortcode to media ID

Converts a shortcode into the numeric media ID.

  • shortcode required

/media/id_to_shortcode

Media ID to shortcode

Converts a numeric media ID back into a shortcode.

  • id required
Comments 2

/comments/media_comments_by_id

Post comments

Comments on a post or reel with text, like and reply counts and commenter details, plus a pagination_token.

  • code_or_id_or_url required · media ID, shortcode or URL
  • pagination_token · from the previous page

/comments/replies

Comment replies

The replies to one comment, with text, likes and replier details, and the parent comment.

  • code_or_id_or_url required · media ID, shortcode or URL
  • comment_id required · from the comments list
Search 5

/search/users_by_keyword

Search users

Accounts matching a keyword, with names, verification and profile pictures.

  • keyword required

/search/hashtags_by_keyword

Search hashtags

Hashtags matching a keyword, with their post counts.

  • keyword required

/search/places_by_keyword

Search places

Locations matching a keyword.

  • keyword required

/search/global

Search everything

Users, hashtags and places for a keyword in one response.

  • keyword required

/search/posts

Search posts

Posts and reels matching a keyword, with captions, authors, counts and media.

  • query required

Full parameter reference and response examples are in the Instagram docs. New to Instagram data? Read the Instagram scraping guide.

Workflow

From a username to every post.

Most jobs follow the same three steps. Each step is a single call, and every list endpoint hands you the cursor for its next page.

01

Resolve the account

/user/by_username returns the profile and its numeric id. The post, reel and tagged endpoints take it as user_id.

02

Pull the content

Posts, reels and tagged posts come back a page at a time with captions, media and engagement counts.

03

Follow the cursor

Send page_info.end_cursor back as end_cursor (or paging_info.max_id as max_id for reels) until there are no more pages.

Every post from a profile
import requests

API = "https://scrapingbot.io/api/v1/instagram"
HEADERS = {"x-api-key": "YOUR_API_KEY"}

def call(endpoint, **params):
    body = {"endpoint": endpoint, "params": params}
    res = requests.post(API, headers=HEADERS, json=body)
    res.raise_for_status()
    return res.json()["data"]

profile = call("/user/by_username", username="instagram")

posts, cursor = [], None
while True:
    page = call("/medias/by_user_id", user_id=profile["id"],
                count=50, end_cursor=cursor)
    posts += [edge["node"] for edge in page["edges"]]
    if not page["page_info"]["has_next_page"]:
        break
    cursor = page["page_info"]["end_cursor"]
Use cases

What teams build with it.

A few patterns we see often, and the endpoints behind each one.

Influencer discovery

Search accounts and posts by keyword, then size them up by followers, category and verification before you reach out.

/search/users_by_keyword/search/posts/user/by_username

Brand and UGC monitoring

Collect the posts a brand is tagged in and read the comments and replies people leave on them.

/medias/tagged_by_user_id/comments/media_comments_by_id/comments/replies

Competitor tracking

Follow posting frequency and engagement on a competitor’s posts and reels over time.

/medias/by_user_id/reels/by_user_id

Link enrichment

Turn a post or reel URL pasted into your app into its caption, owner, media and counts.

/media/by_url
Billing

You pay for answers, not attempts.

A Instagram call costs 5 credits, and only when it succeeds. Every endpoint costs the same.

  • Failed calls are refundedErrors and timeouts are credited back automatically, and requests with missing or invalid parameters are never charged.
  • 100 free credits to startThat covers 20 Instagram calls on the free plan. No credit card needed to sign up.
  • See the cost of every callEach response carries a creditsUsed field, and your dashboard logs every request with its status, duration and credits.
  • One balance for every APIThe same credits work for website scraping, TikTok, Instagram, Google, Amazon and ChatGPT. Paid plans refresh them every billing cycle.

Every successful Instagram call

5credits

Free to start
20 calls
from 100 free credits
Failed calls
0 credits
refunded automatically

Questions, answered

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

No. Requests are authenticated with your ScrapingBot API key. You never manage Instagram logins, cookies or sessions in your integration.

What data can I get?

Public profiles, followers and following, posts, reels, tagged posts, active stories, single posts and reels by URL or shortcode, comments and their replies, and search across users, hashtags, places and posts.

Should I send a username or a user ID?

Profile lookups take either: send a username to /user/by_id (or an ID to /user/by_username) and the API switches to the right lookup. Stories take a username. Post, reel, tagged, follower and following endpoints need the numeric user_id, which /user/by_username returns as id.

How do I page through posts, reels and comments?

Posts and tagged posts return page_info.end_cursor: send it back as end_cursor while has_next_page is true. Reels return paging_info.max_id, sent back as max_id while more_available is true. Comments return a pagination_token for the next page. Follower and following lists return next_max_id, sent back as max_id while has_more is true.

Can I get every follower of a large account?

Not always. For accounts with a very large audience, Instagram lists only about 50 recent followers and no further pages, even though user_count shows the full number. To check whether a particular account follows them, search the whole list with query.

What does a call cost?

5 credits per successful call, on every endpoint. Errors and timeouts are refunded automatically. New accounts get 100 free credits, enough for 20 calls.

How long can a request take?

Instagram requests time out after 45 seconds. A request that times out returns an error and its credits are refunded.

Where can I try it before writing code?

Every account has an Instagram playground in the dashboard: pick an endpoint, fill in the params, run it and copy the request. The docs cover every endpoint with examples.

Your first 20 Instagram calls are free.

Create an account, copy your API key and make your first request in a few minutes. No credit card required.