# Instagram Hashtag Scraper: Top Reels by Hashtag or Keyword (`data-for-agents/instagram-hashtag-reels-scraper`) Actor

Top Instagram reels for a hashtag or keyword, no login. One row per reel, ranked by plays: plays, likes, comments, caption, hashtags, date, video URL, owner. Optional posted-within filter. $1.25 per 1,000 reels; failures and empty searches are free, no start fee.

- **URL**: https://apify.com/data-for-agents/instagram-hashtag-reels-scraper.md
- **Developed by:** [Data for Agents](https://apify.com/data-for-agents) (community)
- **Categories:** Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 4 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.25 / 1,000 reels

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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: Top Reels by Hashtag or Keyword

Give a hashtag or a keyword and get the public Instagram reels found for it, ranked by views. No login, no cookies.

**One row per reel:** rank, views, likes, comments, caption, hashtags, mentions, date, video URL, thumbnail, duration, owner username and id.

**$1.25 per 1,000 reels: you pay per reel returned.** Failed terms, empty searches and every error row are free. No start fee.

### Input

```json
{ "hashtags": ["fitness"], "keywords": ["home workout"], "resultsLimit": 20, "postedWithin": "month" }
```

- `hashtags`: with or without `#`, or a hashtag link. Only reels that carry the hashtag in their caption are returned.
- `keywords`: words or a phrase. Every word must be in the reel's caption or the owner's name.
- `resultsLimit`: the most reels per term, default 20, up to 200.
- `postedWithin`: `any`, `day`, `week`, `month` or `year`, checked against the reel's own date.

### Output

```json
{
  "status": "ok", "error_code": null, "searchTerm": "fitness", "searchType": "hashtag", "rank": 1,
  "url": "https://www.instagram.com/reel/XXXXXXXXXXX/", "shortCode": "XXXXXXXXXXX", "type": "Video",
  "ownerUsername": "example", "caption": "...", "hashtags": ["fitness"], "timestamp": "2026-11-01T12:00:00.000Z",
  "videoViewCount": 1200000, "likesCount": 54000, "commentsCount": 310, "videoUrl": "https://...", "displayUrl": "https://..."
}
```

### How it finds reels, and its limits

Instagram shows hashtag and search pages only to logged-in users. This Actor does not log in. It finds reels for your
term through a public web search, reads each reel's public page, keeps the ones that match, and ranks them by views.

- The result is the most-viewed reels **among those a public web search knows**, not Instagram's own "Top" tab.
- Very new reels (hours old) and reels from private accounts are usually missing.
- A narrow term can return fewer reels than `resultsLimit`. A term with none is one free `no_data` row.

### Errors

Every row has `status` and `error_code`. A row with `status: "error"` is free.

| error_code | Meaning |
|---|---|
| `missing_input`, `invalid_input` | No usable hashtag or keyword; fix the input. |
| `no_data` | No public reels found for the term. |
| `blocked`, `rate_limited`, `timeout`, `network_error`, `proxy_error` | Temporary; run again. |
| `site_changed` | A page changed shape; the Actor needs an update. |
| `partial_result` | On a reel row (`status: "ok"`, charged): some fields could not be read; the rest is good. |
| `cost_limit` | Your maximum charge was reached. |
| `run_timeout` | The run's time limit came first, or the run restarted mid-term; run the term again. |
| `internal_error` | A bug; please report it. |

A run always ends SUCCEEDED; the `OUTPUT` record says `ok`, `partial` or `failed` with counts.

### FAQ

**Is it legal?** The Actor reads only public pages, without logging in. Reel rows hold public creator data, which can be personal data: use it lawfully.

# Changelog

This Actor's version history is a separate document: https://apify.com/data-for-agents/instagram-hashtag-reels-scraper/changelog.md

# Actor input Schema

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

Hashtags, with or without #, or hashtag links (fitness, #homeworkout, https://www.instagram.com/explore/tags/fitness/). One word each. Returns the reels found that carry the hashtag in their caption, most views first. Up to 50 hashtags and keywords per run.

## `keywords` (type: `array`):

Search words or a phrase (home workout, meal prep high protein). Returns the reels found whose caption or owner name holds every word, most views first. Give hashtags, keywords or both.

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

The most reels to return per hashtag or keyword (default 20, up to 200). You pay per reel returned.

## `postedWithin` (type: `string`):

Only reels posted within the last day, week, month or year, checked against each reel's own date. Default any: no time filter. A short window returns fewer reels.

## Actor input object example

```json
{
  "hashtags": [
    "fitness"
  ],
  "resultsLimit": 10,
  "postedWithin": "any"
}
```

# Actor output Schema

## `reels` (type: `string`):

Every row: reels (status ok) and free notes (status error).

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

status (ok, partial, failed), reels returned, error rows by error_code.

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

// Run the Actor and wait for it to finish
const run = await client.actor("data-for-agents/instagram-hashtag-reels-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": ["fitness"],
    "resultsLimit": 10,
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-for-agents/instagram-hashtag-reels-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/r9MV3D0SUmIzJ84hJ/builds/ZHfzQIB3f7fydm3Yu/openapi.json
