Skip to content
ScrapeField

Blog · Guides ·

How to scrape Instagram in 2026: three ways

Instagram’s own Graph API, a scraper that signs in, or an API with no login of yours: what each can read, what each costs, and the calls for an account’s posts and their comments.

ScrapeField

Instagram data people ask for comes in three kinds: accounts, their posts and Reels, and the comments under them. Which way you get them decides whose accounts you can read and whose account is at risk.

1. Instagram’s Graph API

Free, official, and built for the accounts you or your customers own: publishing, moderating, insights. Through Business Discovery it reads other business and creator accounts’ basic metrics and media, but not personal accounts, and you need your own professional Instagram account and a Facebook Login app first. Our comparison with the Instagram API sets the two side by side.

2. A scraper that signs in

Instagram shows little to visitors who are not signed in, so most scrapers you run yourself sign in to an account and read as it. That works for a while, at one person’s pace, until Instagram notices and asks for a check or blocks the account; every change to the app breaks the parser. We never take a customer’s login, cookie or session, for that reason.

3. An API with no login of yours

One call with a username, and the answer is JSON, with the field names Instagram’s Graph API uses. An account’s recent posts and Reels come up to 24 a call for 3 credits, so 1,000 posts cost about $0.10 on our smallest pack and $0.05 on the largest. Comments come up to 50 a call for 3 credits.

curl -H "Authorization: Bearer $SCRAPEFIELD_KEY" \
  "https://api.scrapefield.com/v1/instagram/posts?username=ferrari"

An account’s posts, and every comment on the newest, in TypeScript:

const base = 'https://api.scrapefield.com/v1/instagram';
const headers = { Authorization: `Bearer ${process.env.SCRAPEFIELD_KEY}` };
const get = async (path: string) => {
  const res = await fetch(`${base}/${path}`, { headers });
  const body = await res.json();
  if (!res.ok) throw new Error(body.error.message);
  return body;
};
const { data: recent } = await get('posts?username=ferrari');
const comments = [];
if (recent.length) {
  let cursor: string | null = null;
  do {
    const q = new URLSearchParams({ shortcode: recent[0].shortcode });
    if (cursor) q.set('cursor', cursor);
    const page = await get(`comments?${q}`);
    comments.push(...page.data);
    cursor = page.meta.next_cursor;
  } while (cursor);
}

And in Python:

import os, requests

base = "https://api.scrapefield.com/v1/instagram"
headers = {"Authorization": f"Bearer {os.environ['SCRAPEFIELD_KEY']}"}

def get(path, **params):
    body = requests.get(f"{base}/{path}", params=params, headers=headers).json()
    if "error" in body:
        raise RuntimeError(body["error"]["message"])
    return body

recent = get("posts", username="ferrari")["data"]
comments, cursor = [], None
while recent:
    params = {"shortcode": recent[0]["shortcode"]}
    if cursor:
        params["cursor"] = cursor
    page = get("comments", **params)
    comments += page["data"]
    cursor = page["meta"]["next_cursor"]
    if cursor is None:
        break

A post has shortcode, caption, timestamp, media_type, like_count, comments_count and, for a Reel, view_count. Every Instagram endpoint, with a playground that runs with no key, is on the Instagram API page.

Which one

Your own accounts, or your customers’: the Graph API. A few posts by hand: the app. Accounts that are not yours, at any volume, personal ones included: an API, with no account of yours signed in. From here: an account’s engagement rate.

More articles