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.
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.
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.
/user/by_username
Profile by username
The full public profile: bio, follower and following counts, verification, category, links and the numeric id.
/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/quick_by_username
Quick profile lookup
An alias of /user/by_username with the same response, kept for existing integrations.
/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.
next_max_id from the previous page
/following/by_user_id
Following
Accounts a profile follows, a page at a time, searchable with query.
next_max_id from the previous page
/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.
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.
paging_info
/medias/tagged_by_user_id
Tagged posts
Posts in which other accounts tagged the profile.
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.
/media/by_url
Post or reel by URL
One post or reel with caption, owner, media versions, like and comment counts.
/media/by_shortcode
Post by shortcode
The same lookup using the code from the URL, such as Dd9RyBWBVih.
/media/shortcode_to_id
Shortcode to media ID
Converts a shortcode into the numeric media ID.
/media/id_to_shortcode
Media ID to shortcode
Converts a numeric media ID back into a shortcode.
/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.
/comments/replies
Comment replies
The replies to one comment, with text, likes and replier details, and the parent comment.
/search/users_by_keyword
Search users
Accounts matching a keyword, with names, verification and profile pictures.
/search/hashtags_by_keyword
Search hashtags
Hashtags matching a keyword, with their post counts.
/search/places_by_keyword
Search places
Locations matching a keyword.
/search/global
Search everything
Users, hashtags and places for a keyword in one response.
/search/posts
Search posts
Posts and reels matching a keyword, with captions, authors, counts and media.
Full parameter reference and response examples are in the Instagram docs. New to Instagram data? Read the Instagram scraping guide.
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.
/user/by_username returns the profile and its numeric id. The post, reel and tagged endpoints take it as user_id.
Posts, reels and tagged posts come back a page at a time with captions, media and engagement counts.
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.
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"]
A few patterns we see often, and the endpoints behind each one.
Search accounts and posts by keyword, then size them up by followers, category and verification before you reach out.
Collect the posts a brand is tagged in and read the comments and replies people leave on them.
Follow posting frequency and engagement on a competitor’s posts and reels over time.
Turn a post or reel URL pasted into your app into its caption, owner, media and counts.
A Instagram call costs 5 credits, and only when it succeeds. Every endpoint costs the same.
creditsUsed field, and your dashboard logs every request with its status, duration and credits.
Every successful Instagram call
5credits
No. Requests are authenticated with your ScrapingBot API key. You never manage Instagram logins, cookies or sessions in your integration.
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.
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.
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.
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.
5 credits per successful call, on every endpoint. Errors and timeouts are refunded automatically. New accounts get 100 free credits, enough for 20 calls.
Instagram requests time out after 45 seconds. A request that times out returns an error and its credits are refunded.
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.
Create an account, copy your API key and make your first request in a few minutes. No credit card required.