Skip to content

Instagram Hashtag Scraper

Try for free

Scrape public Instagram posts and reels for one or more hashtags. Get captions, likes, comment counts, media URLs, timestamps, and author details for trend and campaign tracking.

📸 Instagram Hashtag Scraper

Collect public Instagram posts and reels for the hashtags your team tracks, and land them in a Scrapely dataset ready to export.

Social, content, and research teams use it to turn a list of hashtags into captions, creators, media, and engagement from the public grid. No session cookie.

Watch the video tutorial to see how it works:

✨ Features

  • 🏷️ Run one hashtag or a list. A leading # is optional. Each entry is its own search. Spaces in one entry are merged into a single hashtag. The same hashtag entered twice (any letter case, with or without #, or as a tag link) is searched once.
  • ⚡ Several hashtags of a list are read at the same time, each on its own proxy exit; while Instagram refuses many requests, fewer run at once. Rows are saved in the order of your list.
  • ⏱️ If the run's timeout comes before every hashtag is done, the scraper stops shortly before it, keeps every row it already found, and names the hashtags it did not reach in the status message and the NOT_REACHED record of the run's key-value store, so you can run them again or give the run a longer timeout.
  • 🖼️ posts reads the public tag page and the batches it loads while scrolling. It saves image and sidecar posts on that page, and image and sidecar posts from the public profiles of accounts that page shows when the caption includes the hashtag.
  • 🎬 reels prefers items Instagram marks as clips (productType clips). When that feed is closed, it keeps videos from the public grid.
  • 🔒 Instagram shows some hashtags only to logged-in visitors: their tag page sends logged-out visitors to the login page. For such a hashtag the scraper finds its public posts or reels through Google search and reads each one from Instagram, keeping only those whose caption has the hashtag. These rows come in search order, and the status message names the hashtags read this way.
  • 🔢 resultsLimit caps how many items are saved per hashtag.
  • 🧵 A bad entry, a blocked tag, or a tag with no public items is skipped and listed in the status message and the OUTPUT record. It is never saved as a row, and the rest of the list still runs.
  • 🏠 Each run uses Scrapely Proxy: it starts on datacenter exits and moves to residential exits for the rest of the run when Instagram blocks or rate-limits them.

🚀 Why teams use this

  • Schedule it, call it from the Scrapely API, and export the dataset from the run.
  • One rejected hashtag does not abort the others, so a production list can contain a dead tag and still return the rest.
  • The actor writes a field only when the public payload has it. A real 0 or false stays. A missing count is left off the item.
  • When Instagram disables like and view counts, likesCount is -1. That value is the hidden-count flag, not a guessed total.
  • You do not paste a password or a session cookie. The actor reads the logged-out page.

The public grid is the logged-out hashtag page, not a promise of every post ever tagged. Instagram shows logged-out visitors only part of a hashtag:

  • posts reads every batch the tag page loads until Instagram ends it, then the public profiles of the accounts it shows. With a resultsLimit above 100, each account is read until its timeline ends or six pages in a row have no post with the hashtag, and the profile reads get more time (they always stop before the run's timeout).
  • reels uses the tag grid. Instagram's reels feed can ask logged-out visitors to log in, so a reels search may return only a small batch from the grid.
  • The count Instagram puts on a hashtag is for logged-in members. Logged out, a tag page usually lists a few dozen top posts and then ends, whatever that count says: on 2026-11-05 #reiju was titled "176K reels" while its logged-out tag page ended after 28 posts. So a large resultsLimit can come back short.
  • When a hashtag saves fewer items than resultsLimit, the status message says why (for example "Instagram shows logged-out visitors only part of #reiju: its tag page and the recent posts of the 27 accounts it shows had 32 public posts with it, fewer than the 100 requested.") and the OUTPUT record lists it in shortInputs.

💡 Use cases

  • Follow a campaign or branded hashtag and collect every new public post.
  • Find creators who post about a topic for influencer outreach.
  • Measure engagement on a hashtag over time.

🧪 Example input

{
  "hashtags": [
    "natgeo"
  ],
  "resultsLimit": 20,
  "resultsType": "posts"
}

🧾 Sample output

One item from a real run of the example input, shortened. Long text is cut and lists show their first entries.

{
  "id": "3000000000000000000",
  "type": "Sidecar",
  "shortCode": "EXAMPLE1234",
  "caption": "Cuál fue tu favorita? 😍 #natgeo #sony #bealpha #natgeo animals",
  "hashtags": [
    "natgeo",
    "sony"
  ],
  "url": "https://www.instagram.com/p/EXAMPLE1234/",
  "displayUrl": "https://scontent.cdninstagram.com/…",
  "alt": "Photo by Andrés Clausen on October 09, 2026.",
  "ownerUsername": "example_creator",
  "ownerId": "1234567890",
  "productType": "carousel_container",
  "inputUrl": "https://www.instagram.com/explore/tags/natgeo/",
  "searchTerm": "natgeo"
}

📥 Input

FieldRequiredWhat you send
hashtagsYesList of hashtags. One entry, one search; a repeated hashtag is searched once.
resultsTypeNoposts (default) or reels.
resultsLimitNoMaximum saved items per hashtag. Default 20. Minimum 1. No upper limit; a hashtag returns at most what Instagram shows logged-out visitors (see above).
{
  "hashtags": ["natgeo"],
  "resultsType": "posts",
  "resultsLimit": 20
}

travel photography is searched as travelphotography.

📤 Output

A saved post includes only the fields Instagram sent. These are the names the dataset can contain:

id, type, shortCode, caption, hashtags, mentions, url, commentsCount, firstComment, latestComments, dimensionsHeight, dimensionsWidth, originalHeight, originalWidth, displayUrl, images, videoUrl, audioUrl, alt, likesCount, videoViewCount, videoPlayCount, igPlayCount, fbLikeCount, fbPlayCount, reshareCount, timestamp, childPosts, locationName, locationId, ownerFullName, ownerUsername, ownerId, productType, videoDuration, paidPartnership, affiliate, sponsors, taggedUsers, isPinned, musicInfo, coauthorProducers, isCommentsDisabled, facebookPage, threadsNetProfile, inputUrl, searchTerm.

inputUrl is the hashtag page that produced the row. searchTerm is the entry you submitted. url is the public post URL. images and childPosts are present for carousels when the payload includes the slides. musicInfo and audioUrl are present when the clip payload includes that audio. latestComments is the preview on the post, up to five, not a full comment thread and not nested replies. fbLikeCount and fbPlayCount appear only when the payload includes those counts.

Every dataset row is a post or reel. Hashtags that are invalid, blocked or empty are listed in the run's status message and in the OUTPUT record of the run's key-value store:

{
  "saved": 10,
  "failedInputs": [
    {"input": "example", "reason": "No public reels or videos for this hashtag."},
    {"input": "closedtag", "reason": "Tag page redirects logged-out visitors to the login page: closed to the public or does not exist."}
  ]
}

OUTPUT also lists repeated entries that were searched once (repeatedInputs), hashtags not reached before the run timeout (notReached), and hashtags that saved fewer items than resultsLimit with the reason (shortInputs: hashtag, saved, requested, reason), when there are any.

reason says in one sentence why the hashtag saved nothing (closed to logged-out visitors, nothing matching on the tag page or its accounts' profiles, or Instagram answering too slowly), or gives a short code and status. It does not include a response body. A hashtag whose tag page redirects logged-out visitors to the login page is read from Google search results (see Features); it is reported with that reason only when search finds no public post or reel with it. A run that finds nothing saves no rows and ends with a status message that starts with No results:. The run fails only when no hashtag is valid or Instagram blocked every hashtag after retries.

❓ FAQ

Can I schedule it or use the API? Yes. Save your input as a task and schedule it, or start runs and read the results through the Scrape.ly API, CLI, or from AI agents through the Scrape.ly MCP server.

//From the blog\\

Latest articles

All articles

The internet is full of data.
Start owning yours.

Scrape.ly gives you the infrastructure, the tooling, and the team to extract, process, and operationalize web data at any scale. Setup takes minutes.

No credit card. No setup calls.