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

Scrape top Instagram posts and reels for any hashtag or keyword. Get captions, media, likes, comments, reel play counts, owner, audio, location and hashtags - for trend research, influencer discovery and content ideas. No login needed.

- **URL**: https://apify.com/calm\_builder/instagram-hashtag-scraper.md
- **Developed by:** [Coder](https://apify.com/calm_builder) (community)
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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

Collect the top public Instagram posts and reels for any hashtag or keyword: captions, media, likes, comments, reel play counts, owner, audio, location and hashtags, in a clean, structured format.

Add hashtags, choose how many posts you need, and export the results as JSON, CSV or Excel, or pull them through the Apify API. No Instagram account or login needed.

### What This Actor Does

- Collects Instagram's top public posts and reels for each hashtag or keyword
- Supports many hashtags in one run and never returns the same post twice
- Searches by hashtag (`#coffeeshop`) or by keyword phrase (`coffee shop`)
- Can follow related hashtags to collect more posts on a topic
- Can return reels only
- Returns engagement (likes, comments, **reel play counts**), media, audio, owner, tagged users and location

### Best For

- Trend and content research
- Finding influencers and creators in a niche
- Competitor and campaign monitoring
- Collecting examples for content ideas and creative briefs
- Building datasets for dashboards, NLP or AI workflows

### Input

Add one or more hashtags or keywords and set how many posts to collect for each.

#### Main input fields

- `hashtags`
  One entry per row, with or without `#`. Hashtag links such as `https://www.instagram.com/explore/tags/travel/` also work.
- `resultsLimit`
  How many posts to collect for each hashtag.
- `resultsType`
  `posts` for every top post, `reels` for reels only.
- `keywordSearch`
  Treats each entry as a phrase (`coffee shop`) instead of a single hashtag (`#coffeeshop`).
- `includeRelatedHashtags`
  Also collects top posts from hashtags Instagram lists as related, until the limit is reached.

#### Example input

```json
{
  "hashtags": ["travel", "coffeeshop"],
  "resultsLimit": 50,
  "resultsType": "posts",
  "keywordSearch": false,
  "includeRelatedHashtags": false
}
```

### Output

Each dataset item is one Instagram post or reel. `inputUrl` shows the hashtag page the post came from.

#### Fields

| Field                                                  | Description                                                   |
| ------------------------------------------------------ | ------------------------------------------------------------- |
| `url`, `shortCode`, `id`                               | Post link and identifiers                                     |
| `type`, `productType`                                  | `Image`, `Video` or `Sidecar` (carousel); `clips` for reels   |
| `caption`, `hashtags`, `mentions`                      | Post text and the hashtags and accounts it mentions           |
| `timestamp`                                            | Publish time (ISO 8601, UTC)                                  |
| `likesCount`, `commentsCount`                          | Engagement counts                                             |
| `videoPlayCount`, `videoDuration`                      | Play count and length for reels and videos                    |
| `displayUrl`, `images`, `videoUrl`, `audioUrl`         | Media links                                                   |
| `ownerUsername`, `ownerFullName`, `ownerId`            | Who published the post                                        |
| `taggedUsers`, `coauthorProducers`                     | Tagged accounts and collaborators                             |
| `locationName`, `locationId`                           | Tagged location, when the post has one                        |
| `paidPartnership`                                      | Whether the post is a paid partnership                        |
| `inputUrl`                                             | The hashtag page the post came from                           |

#### Example output

```json
{
  "inputUrl": "https://www.instagram.com/popular/travel/",
  "id": "3985535646503749253",
  "type": "Video",
  "productType": "clips",
  "shortCode": "DdPd43hg0aF",
  "url": "https://www.instagram.com/p/DdPd43hg0aF/",
  "caption": "Three days in the Dolomites #travel #italy",
  "hashtags": ["travel", "italy"],
  "mentions": [],
  "timestamp": "2026-09-13T20:55:32.000Z",
  "likesCount": 100362,
  "commentsCount": 258,
  "videoPlayCount": 1484927,
  "videoDuration": 30.04,
  "displayUrl": "https://instagram.fvii2-1.fna.fbcdn.net/v/t51.82787-15/...",
  "videoUrl": "https://instagram.fvii2-4.fna.fbcdn.net/o1/v/t2/f2/m86/...",
  "ownerUsername": "example_creator",
  "ownerFullName": "Example Creator",
  "ownerId": "787132",
  "locationName": "Dolomites, Italy",
  "paidPartnership": false
}
```

Media links are provided by Instagram and expire after a while, so download any files you need soon after the run.

### How To Use

1. Add one or more hashtags or keywords to `hashtags`.
2. Set `resultsLimit` to how many posts you need for each.
3. Optionally choose reels only, keyword search or related hashtags.
4. Run the actor and open the dataset, or export it as JSON, CSV or Excel, or read it through the Apify API.

### Pricing

This actor uses pay-per-event pricing, so you only pay for results you receive:

- **Post** — charged once for each post or reel saved to your dataset.
- **Actor start** — a small fixed fee of $0.001 per run.

Hashtags that return nothing are not charged. Platform usage is included in these prices. Current prices for each Apify plan are shown on the actor's Pricing tab.

#### Free plan

On the Apify free plan, each run processes up to **3** hashtags and up to **10** posts per hashtag. Upgrade to a paid Apify plan to remove these limits.

### Best Practices

- Start with a small `resultsLimit` to check the output quickly.
- Use several specific hashtags rather than one broad one; each hashtag gives its own set of top posts.
- Turn on related hashtags when you need more posts on a topic, and use `inputUrl` to filter the results.

### FAQ

#### How many posts can I get per hashtag?

Instagram shows the public around 60 top posts per hashtag. Turn on related hashtags to collect more on the same topic.

#### Are these the most recent posts?

No. These are the top posts Instagram shows for the hashtag. The chronological "recent" feed is only visible to logged-in users.

#### Why are most results reels?

Instagram's top posts for a hashtag are mostly reels. Photos and carousels appear when Instagram ranks them among the top posts.

#### Why does a post come from a slightly different hashtag than I entered?

Some very broad hashtags have no public page of their own. In that case the actor collects the closest hashtags Instagram suggests (for example `#sunsetview` for `#sunset`), and `inputUrl` shows which one.

#### Can I collect stories?

No. Stories are only visible to logged-in users.

### Responsible Use

Use this actor only for publicly available content, and make sure your use complies with applicable laws (including data protection rules such as GDPR) and Instagram's terms. Avoid collecting personal data you don't need.

### Troubleshooting

- Check the run log: it names any hashtag that returned nothing.
- Try a more specific hashtag, or turn on keyword search for phrases.
- Test with a small `resultsLimit` before large runs.

# Actor input Schema

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

Enter one hashtag or keyword per row, with or without `#`.

Examples: `travel`, `#coffeeshop`, or a hashtag link such as `https://www.instagram.com/explore/tags/travel/`. Turn on keyword search below to search a phrase such as `coffee shop` instead.

## `resultsLimit` (type: `integer`):

How many posts to collect for **each hashtag or keyword**.

Instagram shows around 60 top posts per hashtag to the public. Turn on related hashtags to collect more.

## `resultsType` (type: `string`):

Collect every top post, or reels only.

## `keywordSearch` (type: `boolean`):

Treat each entry as a phrase (for example `coffee shop`) rather than a single hashtag (`#coffeeshop`).

## `includeRelatedHashtags` (type: `boolean`):

Also collect top posts from hashtags Instagram lists as related, until the limit is reached.

Useful when you need more than ~60 posts per hashtag. Related hashtags can drift from the original topic; each post's `inputUrl` shows which hashtag it came from.

## Actor input object example

```json
{
  "hashtags": [
    "travel",
    "coffeeshop"
  ],
  "resultsLimit": 20,
  "resultsType": "posts",
  "keywordSearch": false,
  "includeRelatedHashtags": false
}
```

# Actor output Schema

## `results` (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": [
        "travel",
        "coffeeshop"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("calm_builder/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": [
        "travel",
        "coffeeshop",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("calm_builder/instagram-hashtag-scraper").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": [
    "travel",
    "coffeeshop"
  ]
}' |
apify call calm_builder/instagram-hashtag-scraper --silent --output-dataset

```

## MCP server setup

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

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/V7n5pQRiid00VnGdW/builds/snqwAAeLG7kdsdhpq/openapi.json
