# Instagram Hashtag Posts Scraper (`automation-lab/instagram-hashtag-posts-scraper`) Actor

Extract public Instagram hashtag posts with captions, timestamps, engagement metrics, creator metadata, and media links.

- **URL**: https://apify.com/automation-lab/instagram-hashtag-posts-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Social media
- **Stats:** 3 total users, 2 monthly users, 71.4% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Posts Scraper

Extract public **Instagram hashtag posts** for campaign monitoring, creator discovery, UGC research, and recurring content analysis. The Actor collects post and reel URLs, captions, timestamps, visible engagement, creator metadata, media previews, hashtags, and mentions without requiring an Instagram login.

Use a hashtag such as `apify`, a full public hashtag URL, or several campaign tags. Results are saved as typed records that can be exported to JSON, CSV, Excel, XML, RSS, or connected to an Apify integration.

### What does Instagram Hashtag Posts Scraper do?

The Actor opens each public Instagram hashtag page, discovers visible post and reel cards, and optionally visits each post to enrich the record. Detail enrichment can add the published timestamp, full caption, creator display name, likes, and comments when Instagram exposes those values publicly.

It deliberately excludes private profiles and login-only content. Missing public fields are returned as `null`, never guessed or converted to zero.

### Who is this Instagram hashtag scraper for?

- Social media managers monitoring campaign hashtags and public UGC.
- Influencer marketers finding creators active in a niche.
- Brand teams reviewing new posts under product and event tags.
- Researchers collecting repeatable public content samples.
- Agencies preparing hashtag reports for clients.
- Automation teams sending fresh post records to sheets, databases, or AI tools.

### Why use this Actor?

- Accept hashtags with or without `#` and full Instagram hashtag URLs.
- Process up to 20 distinct hashtags in one run.
- Include or exclude reels.
- Enrich public posts with timestamps and visible engagement.
- Preserve stable shortcodes and canonical post URLs for deduplication.
- Export structured data through the Apify API and integrations.
- Run on a schedule for repeatable monitoring.
- Use direct access by default and configure Apify Proxy only when needed.

### What Instagram hashtag post data can I extract?

| Field | Description |
| --- | --- |
| `hashtag` | Normalized hashtag that produced the record. |
| `postUrl` | Canonical public post or reel URL. |
| `shortcode` | Stable Instagram shortcode from the URL. |
| `mediaType` | `post` or `reel`. |
| `caption` | Public caption text when available. |
| `timestamp` | Public post timestamp in ISO 8601 format. |
| `likesCount` | Visible public like count. |
| `commentsCount` | Visible public comment count. |
| `viewsCount` | Visible reel view count from the hashtag grid. |
| `authorUsername` | Public creator username. |
| `authorDisplayName` | Public creator display name when exposed. |
| `authorProfileUrl` | Direct public creator profile URL. |
| `thumbnailUrl` | Public media preview image URL. |
| `videoUrl` | Public video URL when exposed during the run. |
| `hashtags` | Unique hashtags parsed from the caption. |
| `mentions` | Unique account mentions parsed from the caption. |
| `sourceUrl` | Hashtag page used for discovery. |
| `scrapedAt` | Timestamp when the Actor discovered the result. |

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

The Actor uses pay-per-event pricing: a small start charge plus one `result` event for each post or reel saved. BRONZE prices are **$0.0022 per run** and **$0.00148 per saved result**; the live Actor page remains the source of truth.

| Saved posts | BRONZE charge calculation |
| ---: | --- |
| 5 | One start event plus 5 × the per-result price |
| 25 | One start event plus 25 × the per-result price |
| 100 | One start event plus 100 × the per-result price |

These examples cover Actor charges. Instagram route, proxy, and platform usage can vary. Start with a small limit, inspect the dataset, and increase it only when the output fits your workflow.

### How to scrape Instagram posts by hashtag

1. Add one or more hashtags, such as `apify` or `webscraping`.
2. Optionally add full URLs such as `https://www.instagram.com/explore/tags/apify/`.
3. Set the maximum number of posts per hashtag.
4. Choose whether to include reels.
5. Keep detail enrichment enabled for timestamps and engagement fields.
6. Run the Actor and inspect the default dataset.
7. Export the data or connect a schedule, webhook, or integration.

### Input parameters

#### `hashtags`

A list of up to 20 hashtags. Values can include or omit the leading `#`.

```json
["apify", "#webscraping"]
```

#### `startUrls`

Optional public Instagram hashtag URLs. URL inputs and `hashtags` are combined and deduplicated.

```json
[{ "url": "https://www.instagram.com/explore/tags/apify/" }]
```

#### `maxPostsPerHashtag`

Maximum unique results saved for each hashtag, from 1 to 200. Instagram may expose fewer public cards than requested.

#### `includeReels`

When `true`, the Actor returns reels and regular posts. Set it to `false` when a campaign workflow requires only regular posts.

#### `includeDetails`

When `true`, each discovered public post is opened for caption, timestamp, visible engagement, and creator enrichment. Disable it for a faster URL-and-preview collection workflow.

#### `proxyConfiguration`

Optional Apify Proxy configuration. Direct access is the default. If Instagram limits a route, you can explicitly enable a datacenter or residential proxy configuration. The Actor never silently enables a paid residential fallback.

### Example input

```json
{
  "hashtags": ["apify"],
  "maxPostsPerHashtag": 5,
  "includeReels": true,
  "includeDetails": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### Example output

```json
{
  "hashtag": "apify",
  "postUrl": "https://www.instagram.com/reel/DX5rTD_soy2/",
  "shortcode": "DX5rTD_soy2",
  "mediaType": "reel",
  "caption": "I literally used Claude (and Apify and LinkedIn) to get unlimited jobs\n#ai #aitools #claude #apify #linkedin",
  "timestamp": "2026-05-04T03:14:57.000Z",
  "likesCount": 13000,
  "commentsCount": 25000,
  "viewsCount": 458000,
  "authorUsername": "msbintel",
  "authorDisplayName": "MSB Intel | Everything AI",
  "authorProfileUrl": "https://www.instagram.com/msbintel/",
  "thumbnailUrl": "https://scontent.cdninstagram.com/...jpg",
  "videoUrl": null,
  "hashtags": ["#ai", "#aitools", "#claude", "#apify", "#linkedin"],
  "mentions": [],
  "sourceUrl": "https://www.instagram.com/explore/tags/apify/",
  "scrapedAt": "2026-08-02T02:10:00.000Z"
}
```

Public page layouts vary, so fields can be `null`. A null count means “not exposed,” not zero engagement.

### Campaign monitoring workflow

For recurring hashtag campaign monitoring:

1. Create one Actor task with the campaign tags.
2. Keep shortcodes and timestamps in the output.
3. Schedule the task hourly, daily, or weekly.
4. Deduplicate downstream records by `shortcode`.
5. Compare new rows with the previous dataset or your database.
6. Send new creator or engagement records to a spreadsheet, Slack, or a review queue.

The Actor collects snapshots; it does not maintain a hidden cross-run history or send alerts by itself. Apify schedules, webhooks, and downstream storage provide those workflow steps.

### Creator discovery workflow

Collect a focused niche hashtag, keep detail enrichment enabled, and group output by `authorUsername`. Use `authorProfileUrl` for public review and combine captions, mentions, and engagement fields to prioritize relevant creators. Do not treat one post’s engagement as a complete creator-performance metric.

### Export and integrations

The default dataset works with:

- Google Sheets and Microsoft Excel exports.
- Make and Zapier automations.
- Slack or Discord webhook workflows.
- Airtable content-review queues.
- Data warehouses and BI tools.
- LLM classification or summarization pipelines.
- Apify schedules, webhooks, and dataset APIs.

### API usage with JavaScript

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/instagram-hashtag-posts-scraper').call({
  hashtags: ['apify'],
  maxPostsPerHashtag: 5,
  includeReels: true,
  includeDetails: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### API usage with Python

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_APIFY_TOKEN')
run = client.actor('automation-lab/instagram-hashtag-posts-scraper').call(run_input={
    'hashtags': ['apify'],
    'maxPostsPerHashtag': 5,
    'includeReels': True,
    'includeDetails': True,
})

items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### API usage with cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~instagram-hashtag-posts-scraper/runs?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"hashtags":["apify"],"maxPostsPerHashtag":5,"includeDetails":true}'
```

### MCP setup

Use the Actor as a tool from an MCP-compatible assistant.

Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/instagram-hashtag-posts-scraper"
```

#### Claude Desktop setup

Add this JSON to Claude Desktop's MCP configuration:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/instagram-hashtag-posts-scraper"
    }
  }
}
```

#### Cursor setup

Open **Settings → MCP servers**, add an HTTP server named `apify`, and use the same Actor-specific MCP URL shown above.

#### VS Code setup

In an MCP-compatible VS Code assistant extension, add an HTTP server named `apify` with the same URL, reconnect, and confirm the Instagram Hashtag Posts Scraper tool appears.

Example prompts:

- “Collect five public posts under #apify and summarize their captions.”
- “Find public creators posting under #webscraping and return profile links.”
- “Compare visible engagement for posts under #apify and #webscraping.”

### Tips for reliable results

- Begin with 3–10 posts per hashtag.
- Prefer specific campaign tags over very broad tags.
- Keep detail enrichment enabled only when its extra fields are needed.
- Deduplicate downstream records by `shortcode`.
- Use a proxy only after a direct route is limited.
- Schedule small repeat runs instead of one unnecessarily large browser run.
- Treat changing counts as snapshots collected at `scrapedAt`.

### Limits and failure behavior

- Only public content visible without an Instagram login is supported.
- Private profiles and login-only posts are excluded.
- Instagram decides which cards and fields are publicly visible.
- The Actor can return fewer records than the requested maximum.
- Media URLs may be temporary CDN URLs.
- Detail enrichment may preserve grid fields when a specific detail page is unavailable.
- If no useful public records are found for the entire run, the Actor fails instead of returning a misleading successful empty dataset.
- Instagram layout or anti-automation changes can require an Actor update.

### Responsible use and legality

Use the Actor only for lawful purposes and public data you are permitted to process. Follow Instagram’s terms, applicable privacy rules, intellectual-property requirements, and local laws. Avoid spam, harassment, surveillance, discriminatory profiling, or attempts to identify private individuals. Apply data minimization and retention controls appropriate to your use case.

### FAQ

#### Does this Actor require an Instagram account?

No. It is designed for public hashtag pages and public post metadata visible without login.

#### Can it scrape private profiles?

No. Private, restricted, and login-only content is outside the supported scope.

#### Why are some engagement or timestamp fields null?

Instagram does not expose every field for every post, region, session, or media type. The Actor returns `null` rather than inventing a value.

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

The number is a maximum, not a guarantee. Instagram may expose fewer cards or stop loading more public results for the current route.

#### Should I enable a proxy?

Start with direct access. If your run is rate-limited or challenged, configure Apify Proxy explicitly and validate the output and cost for that route.

#### Can I monitor only new posts?

Schedule repeat runs and deduplicate by `shortcode` in a dataset, database, or integration. The Actor itself returns the current public snapshot and does not store a hidden historical state.

### Related automation-lab Actors

- [Instagram Comments Scraper](https://apify.com/automation-lab/instagram-comments-scraper) for comment-level follow-up.
- [Instagram Reels Audio Scraper](https://apify.com/automation-lab/instagram-reels-audio-scraper) for reel audio metadata.
- [Instagram Mentions & Tagged Posts Scraper](https://apify.com/automation-lab/instagram-mentions-tagged-posts-scraper) for account-centered mentions and tagged content.
- [Instagram Scraper](https://apify.com/automation-lab/instagram-scraper) for broader profile and post workflows.

### Support

If a public hashtag unexpectedly returns no records, include the Actor run ID, sanitized input, expected public hashtag URL, and whether a proxy was configured. That evidence helps distinguish an Instagram page change from a route-specific limit.

# Actor input Schema

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

Hashtags to monitor, with or without #. Up to 20 unique hashtags per run.

## `startUrls` (type: `array`):

Optional public URLs such as https://www.instagram.com/explore/tags/apify/. URL tags are combined with the Hashtags field.

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

Maximum number of unique public post or reel records saved for each hashtag.

## `includeReels` (type: `boolean`):

Save reel results as well as regular photo and carousel posts.

## `includeDetails` (type: `boolean`):

Open each public post to collect timestamps, like and comment counts, full captions, and creator display names when exposed. Disable for a faster URL-and-preview workflow.

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

Optional Apify Proxy configuration. Direct access is used by default; enable a proxy if Instagram limits your cloud route.

## Actor input object example

```json
{
  "hashtags": [
    "apify"
  ],
  "startUrls": [],
  "maxPostsPerHashtag": 20,
  "includeReels": true,
  "includeDetails": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Public post, creator, engagement, timestamp, and media records.

# 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": [
        "apify"
    ],
    "startUrls": [],
    "maxPostsPerHashtag": 20,
    "includeReels": true,
    "includeDetails": true,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/instagram-hashtag-posts-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": ["apify"],
    "startUrls": [],
    "maxPostsPerHashtag": 20,
    "includeReels": True,
    "includeDetails": True,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/instagram-hashtag-posts-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": [
    "apify"
  ],
  "startUrls": [],
  "maxPostsPerHashtag": 20,
  "includeReels": true,
  "includeDetails": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call automation-lab/instagram-hashtag-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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