# Instagram Hashtag Scraper (`fetch_cat/instagram-hashtag-scraper`) Actor

Export public Instagram hashtag posts and reels with captions, URLs, authors, hashtags, and visible engagement signals.

- **URL**: https://apify.com/fetch\_cat/instagram-hashtag-scraper.md
- **Developed by:** [Hanna Nosova](https://apify.com/fetch_cat) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.10 / 1,000 item processeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Instagram Hashtag Scraper

Export public Instagram hashtag posts and reels for social listening, creator intelligence, and brand monitoring workflows. The actor opens public hashtag pages anonymously and saves visible post/reel cards with captions, URLs, authors, hashtags, mentions, thumbnails, view text, and route diagnostics.

### What you can extract

- Public post and reel URLs from Instagram hashtag pages
- Shortcodes and media type (`post` or `reel`)
- Visible author usernames and profile URLs when shown in the card
- Captions / visible card text, hashtags, and mentions
- Visible view counts and thumbnail URLs when exposed by Instagram
- Provenance fields: requested hashtag, source URL, position, scrape time, and route status

Instagram limits what anonymous visitors can see. Fields that require login-only post detail pages, such as exact timestamps, full comments, private accounts, and non-visible like/comment totals, are intentionally not included.

### Ready-to-run examples

Open a public example to inspect its input, run it, or reuse it as a task:

- [Audit Instagram #dogs hashtag raw text output](https://apify.com/fetch_cat/instagram-hashtag-scraper/examples/instagram-dogs-hashtag-raw-text-audit)
- [Compare Instagram #cats and #nature hashtag posts](https://apify.com/fetch_cat/instagram-hashtag-scraper/examples/instagram-cats-nature-hashtag-compare)
- [Scrape Instagram #cats hashtag posts](https://apify.com/fetch_cat/instagram-hashtag-scraper/examples/instagram-cats-hashtag-posts)

#### Small hashtag export

```json
{
  "hashtags": ["cats"],
  "maxItemsPerHashtag": 10
}
```

#### Monitor several hashtags

```json
{
  "hashtags": ["cats", "nature", "dogs"],
  "maxItemsPerHashtag": 25
}
```

#### Include diagnostic raw text

```json
{
  "hashtags": ["https://www.instagram.com/explore/tags/cats/"],
  "maxItemsPerHashtag": 10,
  "includeRawText": true
}
```

### Input fields

- `hashtags` — Hashtag names or Instagram hashtag URLs. Examples: `cats`, `#nature`, `https://www.instagram.com/explore/tags/dogs/`.
- `maxItemsPerHashtag` — Maximum records to save for each hashtag, from 1 to 100.
- `includeRawText` — Adds the raw visible card text for diagnostics and parser review.
- `proxyConfiguration` — Optional Apify Proxy settings. Leave empty unless your run is blocked.

### Output fields

Each dataset item represents one public hashtag media card:

- `requestedHashtag`
- `sourceUrl`
- `postUrl`
- `shortCode`
- `mediaType`
- `authorUsername`
- `authorProfileUrl`
- `isVerified`
- `caption`
- `hashtags`
- `mentions`
- `visibleViewCount`
- `visibleViewCountText`
- `thumbnailUrl`
- `scrapedAt`
- `position`
- `routeStatus`
- `rawText` when requested

### Pricing and limits

This actor uses pay-per-event pricing with a per-item event for each saved dataset row. Use `maxItemsPerHashtag` to control spend. Instagram may expose fewer anonymous public cards than requested; when that happens the actor saves the available rows and marks them as `partial`.

See [current rates on the Actor Pricing tab](https://apify.com/fetch_cat/instagram-hashtag-scraper/pricing).

### API and integrations

Use this Instagram hashtag scraper as an Instagram hashtag API from the Apify Console, API, scheduler, webhooks, or integrations such as Make, Zapier, and n8n. The default dataset can be exported as JSON, CSV, Excel, XML, or RSS and used in social listening dashboards, enrichment pipelines, and alerts.

### Who is it for?

This actor is built for teams that need repeatable hashtag monitoring without manually opening Instagram search pages.

- Social listening teams tracking campaign hashtags and emerging conversations
- Creator intelligence teams finding public reels and posts around a niche
- Brand monitoring teams exporting public hashtag evidence for dashboards
- Agencies preparing recurring reports for clients or competitors
- Data teams enriching alerts, spreadsheets, BI tools, or internal review queues

### How to get best results

Start with one or two hashtags and a low `maxItemsPerHashtag` value. Once the route returns stable results, schedule the same input or expand the hashtag list. Instagram can vary anonymous public results by time and region, so treat the dataset as a snapshot of visible public cards at run time.

For larger monitoring jobs, split unrelated hashtag groups into separate runs. This makes partial results easier to diagnose and keeps each dataset focused on one campaign, brand, or content category.

### API usage

#### Node.js

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/instagram-hashtag-scraper').call({
  hashtags: ['dogs'],
  maxItemsPerHashtag: 10,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient
import os

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('fetch_cat/instagram-hashtag-scraper').call(run_input={
    'hashtags': ['dogs'],
    'maxItemsPerHashtag': 10,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/fetch_cat~instagram-hashtag-scraper/runs?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"hashtags":["dogs"],"maxItemsPerHashtag":10}'
```

### MCP integration

Use this actor from Apify MCP-compatible workflows when you want an assistant or automation tool to collect public hashtag cards on demand. Provide the same JSON input you would use in Console, then read the default dataset for URLs, captions, authors, and visible engagement signals.

Install the Apify MCP server in Claude Desktop or a compatible client:

```bash
claude mcp add apify -- npx -y @apify/actors-mcp-server --actors fetch_cat/instagram-hashtag-scraper
```

Example MCP server configuration:

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server", "--actors", "fetch_cat/instagram-hashtag-scraper"],
      "env": { "APIFY_TOKEN": "YOUR_APIFY_TOKEN" }
    }
  }
}
```

Example prompts:

- "Run the Instagram Hashtag Scraper for `dogs` and summarize the top captions."
- "Export 10 public cards for `nature` and list authors with visible view counts."
- "Compare hashtags `cats` and `dogs` using the dataset returned by the Apify actor."

A typical MCP workflow is: choose hashtags, run the actor, fetch the dataset, summarize posts by author or caption keywords, and hand the resulting URLs to a human reviewer or downstream enrichment step.

### Related Instagram actors

#### More Instagram scrapers

- [Instagram Stories & Highlights Scraper](https://apify.com/fetch_cat/instagram-stories-highlights-scraper) for public stories and saved highlights
- [Instagram Profile & Posts Scraper](https://apify.com/fetch_cat/instagram-profile-posts-scraper) for monitoring public profile feeds
- [Instagram Post Details Scraper](https://apify.com/fetch_cat/instagram-post-details-scraper) for post-level enrichment when you already have URLs
- [Instagram Reel Scraper](https://apify.com/fetch_cat/instagram-reel-scraper) for reel-focused collection
- [Instagram Search Scraper](https://apify.com/fetch_cat/instagram-search-scraper) for account or keyword discovery

This actor focuses on hashtag result cards; it intentionally does not replace post-detail, profile-feed, or logged-in workflows.

### FAQ

#### Does this scrape private Instagram content?

No. It only uses public anonymous Instagram hashtag pages available at run time.

#### Why did I receive fewer rows than requested?

Instagram can cap anonymous public hashtag pages or vary what it renders. Check `routeStatus`, `position`, and the run logs to distinguish a normal partial result from a blocked or empty route.

#### Can I scrape exact likes, comments, timestamps, or full post details?

Not in this v1 hashtag-card route. Those fields usually require login-only detail pages or a separate post-detail route, so they are not emitted as empty compatibility columns.

### Support

If a run returns unexpected results, open an issue from the Actor page and include the run ID, complete input, expected result, actual result, and the shortest public hashtag URL that reproduces the problem. For diagnostics, rerun a small sample with `includeRawText` enabled.

### Notes and limitations

- Results are limited to public anonymous Instagram surfaces available at run time.
- `routeStatus` is `ok` when the requested limit was reached and `partial` when Instagram exposed fewer cards than requested.
- The actor deduplicates media URLs per hashtag and preserves partial output across multi-hashtag runs.
- Login-only or private data is not scraped.

# Actor input Schema

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

Hashtag names or Instagram hashtag URLs. Use public hashtags only, for example cats, nature, or https://www.instagram.com/explore/tags/dogs/.

## `maxItemsPerHashtag` (type: `integer`):

Maximum number of public posts or reels to save for each hashtag. Start small because Instagram may cap anonymous public results.

## `includeRawText` (type: `boolean`):

Adds the raw visible card text to each output row for diagnostics. Usually keep this disabled for clean exports.

## `proxyConfiguration` (type: `object`):

Optional Apify Proxy settings. Leave empty unless your run is blocked; try datacenter before residential proxies.

## Actor input object example

```json
{
  "hashtags": [
    "cats"
  ],
  "maxItemsPerHashtag": 10,
  "includeRawText": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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": [
        "cats"
    ],
    "maxItemsPerHashtag": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/instagram-hashtag-scraper").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": ["cats"],
    "maxItemsPerHashtag": 10,
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "cats"
  ],
  "maxItemsPerHashtag": 10
}' |
apify call fetch_cat/instagram-hashtag-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fetch_cat/instagram-hashtag-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/0hNMJrC7yThjM8ODB/builds/BBD9yMaADke4h52hn/openapi.json
