# Instagram Hashtag Scraper (Posts & Reels) (`locaihost/instagram-hashtag`) Actor

Scrape public Instagram posts and reels from hashtag pages, with or without #. Caption, hashtags, views, owner, date and image or video links, plus optional full details and comments. New-only mode for schedules. No login, no cookies. $0.30 per 1,000 posts.

- **URL**: https://apify.com/locaihost/instagram-hashtag.md
- **Developed by:** [locaihost data](https://apify.com/locaihost) (community)
- **Categories:** Social media, Lead generation, Marketing
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.17 / 1,000 posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Instagram Hashtag Scraper (Posts & Reels)

Get the public posts and reels on Instagram hashtag pages as JSON, CSV or Excel rows: caption, hashtags, views, owner, date and image or video links. Paste hashtags, with or without #. Add full post details or the latest public comments if you need them. No login, no cookies, no Instagram account.

What people use it for:

- Content research: what the top reels for a hashtag look like, and how many views they get.
- Trend tracking: run a set of hashtags every day and see which new reels appear.
- Creator discovery: the accounts behind the top reels for your niche's hashtags.
- Campaign hashtags: the public posts Instagram shows for your campaign's tag.

### Quick start

Paste this into the **JSON** tab of the input and click **Start**:

```json
{"hashtags": ["streetfood"], "maxPostsPerHashtag": 24}
```

You get the 24 top public reels on the #streetfood page: 24 rows, usually in under 10 seconds.

More examples:

```json
{"hashtags": ["#veganrecipes", "#mealprep", "homeworkout"], "maxPostsPerHashtag": 48, "postDetails": true}
```

```json
{"hashtags": ["streetfood"], "maxPostsPerHashtag": 10, "includeComments": true}
```

Hashtag links (`https://www.instagram.com/explore/tags/streetfood/`) work too.

### What you get

One row per post or reel (`type` is `post`), plus a free `unavailable` row for a hashtag with no public page, saying why. With **Include comments** on, comment rows (`type` is `comment`) follow each post.

| Row | Fields |
|---|---|
| Post | `foundViaHashtag`, `shortCode`, `url`, `postType`, `ownerUsername`, `caption`, `hashtags`, `mentions`, `viewsCount`, `displayUrl`, `videoUrl`, `mediaUrls`, `date`, `id` |
| Detailed post (**Full post details** on) | adds `takenAt` (exact time), `likesCount`, `commentsCount`, every photo and video in `mediaUrls`, `taggedUsers`, `coauthors`, `location`, `audio`, `width`, `height` |
| Comment (**Include comments** on) | `text`, `createdAt`, `likes`, `replyCount`, `postCode`, `postUrl`, `commentId` |
| Every row | `type`, `details` (keyword or full; posts only), `source`, `input`, `scrapedAt` |

Three real rows from a run on 2026-11-04 (shortened: image links cut, captions trimmed, account names replaced):

```json
[
  {"type": "post", "foundViaHashtag": "streetfood", "shortCode": "Db4s3PGAc-8", "url": "https://www.instagram.com/reel/Db4s3PGAc-8/", "postType": "reel", "ownerUsername": "account_1", "caption": "Hardworking Old Man At Kolkata\n\n#streetfood \n#instagramreels...", "hashtags": ["streetfood", "instagramreels", "trendingreels", "reels"], "viewsCount": 22093266, "details": "keyword", "source": "streetfood"},
  {"type": "post", "foundViaHashtag": "streetfood", "shortCode": "Dc75mXFNPFd", "url": "https://www.instagram.com/reel/Dc75mXFNPFd/", "postType": "reel", "ownerUsername": "account_2", "caption": "Cheese Burst Pizza Sandwich😍\nEp. 9 Of Sandwich Series❤️...", "hashtags": ["garlicbread", "sandwich", "snacks", "trending"], "viewsCount": 11101592, "details": "keyword", "source": "streetfood"},
  {"type": "post", "foundViaHashtag": "streetfood", "shortCode": "DUw2AEsig9X", "url": "https://www.instagram.com/reel/DUw2AEsig9X/", "postType": "reel", "ownerUsername": "account_3", "caption": "Most Unique Idli Sandwich...", "hashtags": ["food", "foodstagram", "instafood", "foodblogger", "maharashtra"], "viewsCount": 6748605, "details": "keyword", "source": "streetfood"}
]
```

### Pricing

You pay per row returned. There is no charge for Apify platform usage on top.

| Row | Free and Starter | Scale | Business |
|---|---|---|---|
| Post | $0.30 per 1,000 | $0.225 per 1,000 | $0.165 per 1,000 |
| Detailed post (Full post details on) | $0.50 per 1,000 | $0.375 per 1,000 | $0.275 per 1,000 |
| Comment (Include comments on) | $0.30 per 1,000 | $0.225 per 1,000 | $0.165 per 1,000 |

A detailed post is charged instead of a post, never on top. Plus $0.00005 per run start. **Apify's free $5 monthly credit covers about 16,000 posts.** Free-plan runs stop at 1,000 rows each; any paid Apify plan removes the cap.

**What's free:** hashtags with no public page and entries that aren't hashtags (each comes back as a free `unavailable` row saying why), and posts and comments skipped by **Only new posts**. To cap a run's spend, set **Maximum cost per run** in the run options, or **Max rows** in the input.

### Limits

- What a signed-out visitor sees. Someone who opens a hashtag without signing in gets Instagram's public page for the word: its top reels, not every post with the tag in date order. Most carry the tag; some are close matches. The `hashtags` field shows which posts carry it.
- Depth: Instagram decides how far each public hashtag page goes. When it ends before your limit, the run says so.
- The biggest one-word hashtags have no public page. Instagram asks signed-out visitors to log in before showing any tag page, and its public pages skip some of the largest topics (for example #fitness, #skincare and #food in November 2026). For those, the Actor reads Instagram's public pages for related searches (such as "fitness ideas") and keeps only posts whose caption carries the exact tag. You may get fewer posts than you asked for, and the run's status says which searches were used. If none of those pages has a tagged post, you get one free row saying so. Very rare hashtags can end that way too.
- Posts from a hashtag page carry what the page shows: views, caption, owner and video link, without likes. Turn on **Full post details ($)** for likes, comment counts, exact times, tagged accounts and location.
- Comments: each post's own page shows signed-out visitors its newest 7 to 12 comments, so that is the most each post gives. Commenter usernames are not collected here.
- Likes and views are `null` when the owner hides them, never 0.
- Image and video links are Instagram's signed links and stop working after a few days. Download what you need soon after the run.
- Email addresses and phone numbers are removed from captions and comments.

### Filters: recent posts only, post types

Off by default; a run without them is unchanged. **Posts newer than** (a date or "7 days") leaves older posts out, and
**Post types** (reel, video, image, carousel) keeps only those. Left-out posts are never charged, never pushed and
don't count toward **Posts per hashtag**.

### Logged-in mode: deeper hashtag lists and comment pages

Optional, and same prices. Signed out, Instagram hides its biggest tags (#fitness, #food, #skincare) and shows only a
few comments per post. Logged in, the run reads the list Instagram shows a signed-in visitor, page after page,
including those big tags, and each post's comments page after page (up to **Comments per post**). Only posts whose
caption carries the exact tag are kept.

- **Deeper data with our account** (paid Apify plans, no cookie needed): uses our own Instagram account. It is shared
  by every user, so it has a daily limit and serves one run at a time; when it is busy, used up for the day or
  paused, the run reads signed out and says so.
- **Instagram session cookie:** your own account's `sessionid` instead (secret field, never stored, sent only to
  instagram.com). Your account, your risk: follow Instagram's terms and the laws that apply to you.

Account safety: one request every 2 to 3 seconds, **Max logged-in requests** per run, and the first time Instagram
asks the account to verify itself or slow down, the logged-in part stops at once and the run finishes signed out.
Private accounts, stories, messages and follower lists are never read.

### Only new posts, and schedules

Turn on **Only new posts** and schedule the Actor daily or weekly. Each run looks at the same window (for example the top 24 posts per hashtag) and returns only the posts in it that earlier runs with the same input haven't returned. Skipped posts cost nothing. Set up a schedule under **Schedules** in Apify Console.

### Integrations: API, n8n, Make and AI agents

**API.** Run it and get the rows back in one call:

```bash
curl -X POST "https://api.apify.com/v2/acts/locaihost~instagram-hashtag/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"hashtags": ["streetfood", "veganrecipes"], "maxPostsPerHashtag": 48}'
```

**n8n, Make, Zapier, Google Sheets, Slack, webhooks.** Apify's built-in integrations send each run's dataset wherever you need it, for example a daily sheet of new top reels for your niche's hashtags.

**AI agents (MCP).** Add this Actor to Claude, Cursor or any MCP client with `https://mcp.apify.com/?tools=locaihost/instagram-hashtag`, then ask something like *"Which #mealprep reels have the most views right now?"*

### FAQ

#### How much does it cost to scrape an Instagram hashtag?

$0.30 per 1,000 posts on the Free and Starter plans, less on Scale and Business. Apify's free $5 monthly credit covers about 16,000 posts.

#### Do I need an Instagram account or cookies?

No. The Actor never logs in and never asks for cookies or passwords. It reads only what Instagram shows a signed-out visitor.

#### Why doesn't every post contain the hashtag?

Instagram's public hashtag page lists top reels for the word, which includes close matches. Filter on the `hashtags` field if you need posts that carry the exact tag.

#### Can I get profiles and their posts too?

Yes, from [Instagram Scraper](https://apify.com/locaihost/instagram-scraper), which this Actor is built on: profiles, posts, reels, keywords and hashtags in one run.

#### Is it legal to scrape Instagram hashtags?

The Actor collects only public information a signed-out visitor can see, and never logs in. Instagram's terms restrict automated collection, so check them against your use. Email addresses and phone numbers are removed from captions. You are responsible for how you use the results, including Instagram's terms and the data-protection law that applies to you (for example GDPR when you process data about people in the EU).

### More from locaihost data

- [Instagram Scraper](https://apify.com/locaihost/instagram-scraper): public profiles, posts, reels and keyword pages.
- [TikTok trends](https://apify.com/locaihost/tiktok-trends): trending TikTok hashtags, songs and videos.

### Did it help?

Did it help? A short rating on the Store helps other people find it.

### Support

Something not working, or a field you need? Open an issue on the **Issues** tab: we answer issues within 24 hours.

# Changelog

This Actor's version history is a separate document: https://apify.com/locaihost/instagram-hashtag/changelog.md

# Actor input Schema

## `hashtags` (type: `array`):

Hashtags, with or without # (streetfood, #streetfood) or hashtag links (/explore/tags/...). Each returns the public posts and reels Instagram shows a signed-out visitor on that hashtag's page.

## `maxPostsPerHashtag` (type: `integer`):

Most posts to return for each hashtag. Instagram decides how far each public hashtag page goes; when it ends sooner, the run says so.

## `postDetails` (type: `boolean`):

Open every post on its own page for the exact time, likes, comment count, every photo and video in it, tagged accounts, location and audio. These rows are charged as detailed posts instead of posts. Off: posts carry caption, hashtags, views, owner, date and video link.

## `includeComments` (type: `boolean`):

Also return the public comments on each post (text, date, likes, reply count), charged per comment. Instagram shows signed-out visitors only the newest 7 to 12 comments of a post, so that is the most each post gives.

## `maxCommentsPerPost` (type: `integer`):

Most comments to return for each post, newest first.

## `onlyNew` (type: `boolean`):

Of the latest posts on each hashtag page (Posts per hashtag), return only those this input hasn't returned in an earlier run. For daily or weekly schedules. Skipped posts are not charged.

## `maxResults` (type: `integer`):

Stop after this many charged rows in total. 0 means no limit (the run's maximum charge still applies).

## `postsNewerThan` (type: `string`):

Only posts published after this: a date like 2026-10-01 (midnight UTC) or a period like "7 days", "2 weeks" or "3 months". Hashtag lists are ranked, not newest first, so older posts are left out (free) and the list carries on. Leave empty for every post.

## `postTypes` (type: `array`):

Only these kinds of posts from profiles, keywords and hashtags. Other posts are free and don't count toward the posts asked for. Empty = every kind. Keyword pages list reels only.

## `includeCommenterNames` (type: `boolean`):

Off: commenterUsername is empty and @handles inside comment text are replaced by @\[user]. On: the commenter's public username is kept (never a picture or bio).

## `useOurAccount` (type: `boolean`):

On a paid Apify plan, the logged-in requests go through our own Instagram account, so you don't need one. Our account is shared by everyone, so it has a daily limit and serves one run at a time: when it is busy, used up for the day or paused, the run reads signed out and says so. Same prices. Your own session cookie below takes priority if you give one.

## `sessionCookie` (type: `string`):

The value of the sessionid cookie from your own Instagram account, signed in at instagram.com (see "Logged-in mode" in the README for how to copy it). Use your own account. We never store it: it is kept in memory for this run only, sent only to instagram.com, and removed from every log and message. Leave empty for the usual signed-out run.

## `maxLoggedInRequests` (type: `integer`):

Logged-in mode only: most requests your session makes in this run (one every 2 to 3 seconds). When it is used up, the rest is read signed out. Keep it modest to keep your account safe.

## `listing` (type: `string`):

Set by this listing.

## Actor input object example

```json
{
  "hashtags": [
    "streetfood",
    "#veganrecipes",
    "homeworkout"
  ],
  "maxPostsPerHashtag": 24,
  "postDetails": false,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "onlyNew": false,
  "maxResults": 0,
  "includeCommenterNames": false,
  "useOurAccount": false,
  "maxLoggedInRequests": 600,
  "listing": "hashtag"
}
```

# Actor output Schema

## `posts` (type: `string`):

One row per post or reel: hashtag, caption, views, owner, date, media links.

## `comments` (type: `string`):

One row per public comment, when Include comments is on.

## `full` (type: `string`):

Every field of every row, including free rows.

## `summary` (type: `string`):

Counts, free rows by reason, anything that failed, access stats and cost.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "hashtags": [
        "streetfood"
    ],
    "maxPostsPerHashtag": 24
};

// Run the Actor and wait for it to finish
const run = await client.actor("locaihost/instagram-hashtag").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "hashtags": ["streetfood"],
    "maxPostsPerHashtag": 24,
}

# Run the Actor and wait for it to finish
run = client.actor("locaihost/instagram-hashtag").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "hashtags": [
    "streetfood"
  ],
  "maxPostsPerHashtag": 24
}' |
apify call locaihost/instagram-hashtag --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,locaihost/instagram-hashtag"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/uzuCE6Mo2RDUaGiz6/builds/NcBFXu9lt4gsifVqN/openapi.json
