Guides

How to scrape Instagram with an AI agent: posts and comments

Have an AI agent pull public Instagram profiles, posts, hashtags and comments over MCP: which tool fits each job, real prompts, and per-call costs.

Bogdan Carbune

Bogdan Carbune

9 min read

A cream paper camera with green threads running from its lens to small paper photo tiles and speech bubbles laid out in a paper tray

To scrape Instagram with an AI agent, give the agent a tool that reads public Instagram data, then ask for what you want in plain words. The agent picks the tool, sends a small JSON input (a handle, a hashtag, a post URL, a result count) and gets back structured rows: follower counts, captions, likes, comment text. It does not open a browser or log in as you. Over MCP, that is one connection in Claude, Claude Code or ChatGPT, and the agent can then audit a creator, sweep a hashtag or read the comments under a post in a single prompt. This guide shows which tool fits each job, the exact inputs, three prompts you can copy, what each run costs, and when Meta's official API is the better answer.

Why can't the agent just open instagram.com?

Because a plain fetch of a profile URL returns very little you can use, and the agent should not be logging in as you. Apify, which sells Instagram scrapers, explains the limits in its own Instagram scraping guide(checked November 2026): without a login, profiles and hashtags preload only a few posts, and comments and search are largely unavailable. The same guide states plainly: "Our scrapers do not support logging into Instagram." Hosted scrapers work around this, and Apify's guide says that works only to an extent, so treat comment results as possibly partial.

That leaves three real routes. Use Meta's API if you only need basic numbers about professional accounts. Build your own scraper if Instagram is your whole business and you can maintain it. For everything in between, connect the agent to a hosted scraping tool and let it call that.

Which Instagram data can an AI agent get?

Public data, in five shapes. Each one is a separate tool, because each answers a different question. These are the five Instagram tools in the Goro catalog, with the per-unit price the agent sees before it runs them. Every call is billed on actual usage, with a minimum and a hard cap per call shown on each tool page.

Instagram tools

ToolGive itYou get backPrice
instagram.searchA keyword, and whether you want users, hashtags or placesMatching profiles with follower stats, hashtags with post counts, or places with addressesfrom $0.0069 per result
instagram.profileUp to 50 usernamesFollowers, following, bio, verification, external link, post countfrom $0.0069 per profile
instagram.postsOne username or profile URLRecent posts with captions, engagement counts, media URLs, timestampsfrom $0.0150 per post
instagram.hashtagOne hashtag or keywordPosts or reels carrying it, with captions, engagement and author handlesfrom $0.0069 per result
instagram.urlOne profile, post or reel URLPosts, reels, details, or the comments under a postfrom $0.0060 per result
Comments come only from instagram.url, and only on a post URL. None of these tools read private accounts or return follower lists.

The comment rule trips people up. The posts, profile and hashtag tools return comment counts, not comment text. To read what people actually wrote, the agent takes a post URL from an earlier result and passes it to instagram.url with resultsType set to comments.

RoutingOne question, one tool
Five questions on the left, each connected by a line to the Instagram tool that answers it on the right. The comments question is highlighted and maps to instagram.url.YOU ASKTHE AGENT CALLSwho posts about this topic?instagram.searchusers, hashtags, placeshow big is this account?instagram.profileup to 50 handles a callwhat has it posted lately?instagram.postscaptions, likes, dateswhat is happening on #tag?instagram.hashtagposts or reels per tagwhat do people say under it?instagram.urlcomments on a post url
The agent chains these on its own: search finds handles, posts finds the busy posts, url reads their comments.

How do you connect the agent?

Add one remote MCP server. Nothing gets installed, and there is no scraper or proxy on your side.

  1. Pick a plan. Signing up and browsing the catalog is free, but running a tool needs a plan. Build is $19 a month and includes $25 of tool credit. The pricing page has both plans.
  2. In Claude Code, run the command below, then type /mcp in a session and follow the sign-in in your browser. That is the flow the Claude Code MCP docs describe for remote servers.
  3. In Claude on the web or Desktop, open Customize, then Connectors, click "+ Add", then "Add custom connector", and paste https://mcp.usegoro.ai/mcp. Anthropic's custom connectors article(checked November 2026) says custom connectors are available on Free, Pro, Max, Ultra, Team and Enterprise plans, and that "Free users are limited to one custom connector." The Claude Desktop setup guide walks through every screen. On Team and Enterprise, an Owner adds it under Organization settings > Connectors first, and members then click "Connect" in Customize > Connectors.
  4. In ChatGPT, the FAQ in OpenAI's custom MCP article(checked November 2026) says: "Full MCP is only available to Business and Enterprise/Edu users, currently. Pro users can connect custom MCP servers with read/fetch permissions." The ChatGPT setup guide covers the rest.
  5. Turn it on in the chat.In Claude, click the "+" button, then "Connectors", and toggle it on.
terminal
claude mcp add --transport http goro https://mcp.usegoro.ai/mcp

Sign-in is OAuth, so there is no key to paste. Once connected, the agent can search the catalog, read a tool's schema and price, and run it.

What do the tool calls look like?

You rarely write these yourself, since the agent fills them in from your prompt. They are worth reading once, because the inputs decide both what comes back and what it costs. Each call names a tool slug and an input object.

Profile stats for a list of handles

One call takes up to 50 usernames, so checking a shortlist is a single round trip.

run_tool: instagram.profile
{
  "slug": "instagram.profile",
  "input": {
    "usernames": ["natgeo", "nasa"]
  }
}

Recent posts from one account

One account per call. onlyPostsNewerThanaccepts a date or a relative window like "30 days", and skipping pinned posts keeps old evergreen content out of an engagement average.

run_tool: instagram.posts
{
  "slug": "instagram.posts",
  "input": {
    "username": ["natgeo"],
    "resultsLimit": 20,
    "skipPinnedPosts": true,
    "onlyPostsNewerThan": "30 days"
  }
}

Comments under a post

The only way to get comment text. Pass a post URL, not a profile URL.

run_tool: instagram.url
{
  "slug": "instagram.url",
  "input": {
    "directUrls": ["https://www.instagram.com/p/<post-shortcode>/"],
    "resultsType": "comments",
    "resultsLimit": 30
  }
}

Posts on a hashtag

One hashtag per call, with the leading # optional. Set resultsType to reels if you only care about video.

run_tool: instagram.hashtag
{
  "slug": "instagram.hashtag",
  "input": {
    "hashtags": ["matchalatte"],
    "resultsType": "posts",
    "resultsLimit": 50
  }
}

Find accounts you do not know yet

Search by keyword with searchType set to user. The results carry follower stats, so you can filter before spending anything on deeper calls.

run_tool: instagram.search
{
  "slug": "instagram.search",
  "input": {
    "search": "vegan bakery london",
    "searchType": "user",
    "searchLimit": 25
  }
}

Three prompts that do real work

1. Audit one creator or competitor

The most common job. Write the steps out, because a numbered prompt makes the agent size each call to the task instead of guessing.

prompt
Audit the Instagram account @<handle>.
1. Get the profile: followers, following, post count, bio, link.
2. Pull the last 20 posts, skip pinned ones.
3. Pick the 3 posts with the most comments and pull 30 comments from each.
Give me a table of the 20 posts (date, type, likes, comments, first line
of caption), the median engagement, and the 5 questions or complaints
that come up most in the comments. Tell me which tools ran and the cost.

That runs one profile call, one posts call for 20 posts and three comment calls of 30 each. At catalog prices it comes to about $0.85: $0.0069 for the profile, $0.30 for the posts and $0.54 for the 90 comments.

2. Build a creator shortlist

"Find 25 Instagram accounts for vegan bakeries in London, get their profiles, drop anything under 2,000 followers or without a website link, and give me the rest sorted by followers." That is one search and one profile call for 25 handles, about $0.34 in total. The lead generation playbook picks up from there with email lookup and enrichment.

3. Read a hashtag or watch rivals every week

"Pull the 50 latest posts on #matchalatte and tell me which accounts post most and which formats get the most comments." Fifty results cost about $0.34. Watching four competitor accounts at 12 posts each comes to $0.72 a run. Run either on a schedule and you have the start of the weekly brief in the social listening playbook.

How much does it cost to scrape Instagram this way?

Under a dollar for each job below. You pay per result, the agent sees the price before each call, and commodity tools like these run without stopping to ask, then report which tool ran and what it cost.

Example runs

JobCallsAbout
Creator audit1 profile, 20 posts, 90 comments$0.85
Creator shortlist25 search results, 25 profiles$0.34
Hashtag sweep50 posts on one tag$0.34
Weekly rival check4 accounts, 12 posts each$0.72
Computed from catalog prices. Billing follows actual results, so a run that returns fewer rows costs less. The Build plan's $25 of monthly credit covers runs like these.

The thing that moves the bill is result count, so ask for what the task needs. Twenty posts tell you how an account is doing. Five hundred tell you the same thing at 25 times the price.

When is Meta's official API the better choice?

When you only need basic numbers about professional accounts and you already run one yourself. Meta's Business Discovery docs(checked November 2026) say you can use the Instagram API with Facebook Login to "get basic metadata and metrics about other Instagram professional accounts". Queries run from your own professional account with your own access token, and "Data about age-gated Instagram professional accounts will not be returned." The docs give this example request:

Business Discovery, from Meta's docs
https://graph.facebook.com/v27.0/17841405309211844
  ?fields=business_discovery.username(bluebottle){followers_count,media_count}
  &access_token=<YOUR_APP_USERS_INSTAGRAM_USER_ACCESS_TOKEN>

The same docs show the request extended to another account's media, with comments_count, like_count and view_count per post. If follower counts and per-post like and comment counts for professional accounts are all you need, that is the route Meta sanctions, and it is worth setting up. For hashtags, Meta has a separate Hashtag Search API, which caps you at 30 unique hashtags per account in a rolling 7 days. Business Discovery only returns data about professional accounts. Both APIs run from your own Business or Creator account and need a Meta app and an access token, and Hashtag Search also needs App Review for Instagram Public Content Access.

Building your own scraper makes sense at the other end: high volume on Instagram alone, and someone on the team to fix it when the site changes.

Is it legal to scrape Instagram with an AI agent?

This is not legal advice, and the answer depends on where you are and what you collect. Every tool here reads only public data, but public is not the same as free to use for anything. Instagram's own Terms of Usesay you can't collect information "in an automated way without our express permission", so a commercial project should get legal advice before relying on scraped data. Captions and comments are personal data in many places. Check your local privacy rules before you build on it, keep only the fields the task needs, and do not store comment authors' details unless you have a reason to. The instagram.search tool can enrich top results with a business email, and its own schema flags that as personal data and tells you to check your jurisdiction. Treat every field like that.

Common questions

Can an AI agent scrape Instagram comments?

Yes, from public posts. The agent passes a post URL to a tool that reads comments, here instagram.url with resultsType set to comments. Profile, posts and hashtag tools return comment counts, not the text, so a typical run pulls posts first, picks the busiest ones, then reads their comments.

Can I scrape private Instagram accounts?

No. The tools in this guide read public profiles, posts, hashtags and comments only. Private accounts, follower lists and DMs are out of reach, and you should not try to get them by logging in with a scraper.

Does Instagram have an official API for this?

Partly. Meta's Business Discovery feature, part of the Instagram API with Facebook Login, returns basic metadata and metrics about other professional accounts, queried from your own professional account. It does not return data for age-gated professional accounts, and hashtags go through Meta's separate Hashtag Search API, limited to 30 unique hashtags a week.

How much does it cost to scrape Instagram with an agent?

Usually under a dollar per job. At current catalog prices a profile is from $0.0069, a post from $0.0150 and a comment from $0.0060, so a full creator audit with 20 posts and 90 comments comes to about $0.85. Running tools needs a plan; Build is $19 a month with $25 of tool credit.

Which AI agents can do this?

Any client that can connect a remote MCP server: Claude on the web and Desktop as a custom connector, Claude Code with claude mcp add, ChatGPT on Business and Enterprise/Edu plans (Pro can connect for read and fetch only, see our ChatGPT guide), or your own agent built on an MCP SDK. The tool calls are the same in each.