# Instagram Hashtag Scraper — Reels & Posts by Keyword or Profile (`afanasenko/instagram-hashtag-reels-scraper`) Actor

Instagram hashtag scraper for posts and Reels: search Instagram by hashtag, keyword or profile and export each post with caption, views, likes, comments, date, author and follower count to CSV, JSON or Excel. Filter by date and type. No login.

- **URL**: https://apify.com/afanasenko/instagram-hashtag-reels-scraper.md
- **Developed by:** [Andrey Afanasenko](https://apify.com/afanasenko) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

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 — Reels & Posts by Keyword or Profile

[![Apify Actor](https://apify.com/actor-badge?actor=afanasenko/instagram-hashtag-reels-scraper)](https://apify.com/afanasenko/instagram-hashtag-reels-scraper)

> **Type a hashtag, a search phrase or a username. Get every post and Reel as a spreadsheet row: link, caption, views, likes, comments, date, author and the author's follower count.**
> Mix all three sources in one run. Filter by date, by type (Reels or photos and carousels) and skip pinned posts. Any language. No login, no cookies. Export to CSV, JSON or Excel.

> **🆓 Free to start:** 100 rows per run · 15 runs a month · all three sources and every filter included · no card, no login.

### 🎯 What it does

**You give** any mix of:

- **Hashtags** — `pilates`, `#veganrecipes`, `кето`, `رمضان`
- **Search keywords** — phrases searched the way the Instagram app searches posts: `skincare routine`, `real estate miami`, `рецепты на ужин`
- **Profiles** — `natgeo`, `@nasa` or a profile link

**You get** one row per post or Reel, with the same columns whatever the source: the post link and type, caption with its #hashtags and @mentions, publication date, views (Reels and videos), likes, comments, shares when shown, duration, audio, location, cover and video links, and the author with their follower count and blue check.

**A post found by two of your sources is saved once** — and charged once.

**How each source is ordered.** A profile lists its newest posts first. A hashtag and a search phrase list posts **the way Instagram ranks them — by relevance, not by date**: a strong post from last year can come before yesterday's. Instagram no longer offers a newest-first tab for hashtags, so no tool can give "the latest posts of a hashtag" any more. To get recent posts only, set **Posted within (days)** — older posts are skipped and not charged.

### 📦 Output sample

Each row holds:

- **The post** — Type (reel, video, photo, carousel), URL, Shortcode, Post ID, Caption, Hashtags, Mentions, Posted At, Is Pinned, Paid Partnership, Location
- **Its numbers** — Views, Likes, Comments, Shares, Duration, Carousel Slides
- **The author** — Author, Author Name, Author ID, Author Verified, Author Followers
- **Audio** — Audio title, artist, original audio or not
- **Media** — Thumbnail and video links (Instagram's links expire after some days — download what you need)
- **Where it came from** — Source (hashtag / keyword / profile), Query, Position in that source

A real row from a run on 21.11.2026 (media links shortened):

```json
{
  "source": "hashtag",
  "query": "pilates",
  "position": 5,
  "type": "reel",
  "id": "3762952843477720993",
  "shortcode": "DQ4sayWCR-h",
  "url": "https://www.instagram.com/reel/DQ4sayWCR-h/",
  "caption": "Trying our best under the circumstances 🫠\n\n#pilates #fitness #girls",
  "hashtags": ["pilates", "fitness", "girls"],
  "mentions": [],
  "postedAt": "2025-11-10T18:24:00.000Z",
  "ownerUsername": "noy_tawil1",
  "ownerFollowers": 234054,
  "ownerVerified": true,
  "likes": 37163,
  "comments": 207,
  "views": 1449111,
  "shares": 15914,
  "durationSec": 5.967,
  "audioTitle": "Original audio",
  "isOriginalAudio": true,
  "thumbnailUrl": "https://…",
  "videoUrl": "https://…",
  "scrapedAt": "2026-11-21T15:21:00.000Z"
}
```

### ⚡ Quick start

1. Type one or more **Hashtags**, **Search keywords** or **Profiles** (one per line).
2. Set **Max posts per source** — 50 by default.
3. Optional: **Content type** (Reels only, or photos and carousels only), **Posted within (days)**, **Skip pinned posts**.
4. Click **Start**. Rows appear as they are read; the **Status** tab shows each source's progress.

Leave Hashtags, Search keywords and Profiles all empty and the run is a demo: up to 20 posts for `#pilates`, charged as usual (about $0.03) and not counted toward the free plan's 15 runs a month.

### 🧭 When to use it

- **Find content in a niche** — the Reels and posts Instagram shows for a hashtag or a phrase, with views and likes to spot what works
- **Track creators and competitors** — the latest posts of a list of profiles with their numbers, on a schedule
- **Collect posts for research and AI** — captions, hashtags and engagement for analysis or training data
- **Find creators** — each row names the author and their follower count, so a hashtag doubles as a creator list
- **Feed other tools** — export to CSV, JSON or Excel, or read the dataset by API

### 🛠 Input

| Field | What it does |
|---|---|
| **Hashtags** | Tags to read, with or without `#`. Any script. |
| **Search keywords** | Phrases searched like the app's search. Kept whole; any language. Most results are Reels. |
| **Profiles** | Usernames, `@usernames` or profile links. Public profiles only. |
| **Content type** | `all` (default), `reels` (Reels and videos — for a profile, its Reels tab), `posts` (photos and carousels). |
| **Max posts per source** | Rows per hashtag, phrase or profile. 1–5,000; default 50. A source stops earlier when Instagram has no more — measured 21.11: a big hashtag goes to about 1,500 posts, a search phrase to a few hundred, a profile as far back as it posts. |
| **Posted within (days)** | Keep only posts from the last N days. 0 = any date. |
| **Skip pinned posts** | On by default: the posts a profile pinned to the top of its grid or its Reels tab (often old) are skipped. Set it off to get them, marked `isPinned`. |

Up to 100 sources per run.

### 💰 How much does scraping Instagram posts and Reels cost?

You pay **per row saved** — one post or Reel. No start fee. Posts skipped by your filters and duplicates are **not charged**, and a run that saves nothing costs nothing.

| Apify plan | Per row | Per 1,000 rows |
|---|---|---|
| Free | $0.0015 | $1.50 |
| Starter (Bronze) | $0.0014 | $1.40 |
| Scale (Silver) | $0.0012 | $1.20 |
| Business (Gold) and up | $0.0010 | $1.00 |

Examples: 50 Reels for one hashtag ≈ $0.075 on the Free plan; the last 100 posts of 10 profiles (1,000 rows) ≈ $1.40 on Starter, $1.00 on Business. Set a **maximum total charge** in the run options and the run stops there.

### 🆓 Free vs paid plan

| | Free plan | Paid plans |
|---|---|---|
| Rows per run | 100 in total | as many as you ask |
| Runs per month | 15 | no limit |
| Sources, filters, columns | all | all |

The free plan's runs come back on the 1st of each month (UTC). A short free run that finds nothing on Instagram (an unknown hashtag, a missing or private profile) does not count. A free run reads a limited number of pages, enough for its 100 rows; very narrow filters may stop it earlier.

### 🧪 Recipes

**Trending Reels of a niche this week**

```json
{ "hashtags": ["pilates", "wallpilates"], "contentType": "reels", "postedWithinDays": 7, "maxItemsPerSource": 100 }
```

**What people post about a topic, in any language**

```json
{ "keywords": ["skincare routine", "рецепты на ужин"], "maxItemsPerSource": 200 }
```

**Last month of posts from a list of competitors (pinned posts skipped)**

```json
{ "profiles": ["natgeo", "nasa", "bbcearth"], "postedWithinDays": 30, "maxItemsPerSource": 500 }
```

**Only photos and carousels of a profile**

```json
{ "profiles": ["humansofny"], "contentType": "posts", "maxItemsPerSource": 100 }
```

### 📡 Live status & storage records

- **Status** (`status.html`) — live progress, rows saved and charged, and a line per source: how many posts were read, saved, and why it stopped.
- **Run Summary** (`RUN_SUMMARY`) — the same as JSON: per source, posts read, saved, skipped by the date window, by type, as pinned, duplicates.
- **User Message** (`USER_MESSAGE`) — what this run delivered and the next step.
- The run's **status message** says the same in one line — useful when an AI agent runs the Actor.

### 🤖 Programmatic / API use

Run it from the Apify API, the Apify client for JavaScript or Python, Apify integrations, or an AI agent through the Apify MCP server. A minimal call:

```bash
curl -X POST "https://api.apify.com/v2/acts/afanasenko~instagram-hashtag-reels-scraper/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"hashtags":["pilates"],"maxItemsPerSource":50}'
```

### 💡 Tips & Best Practices

- **Want recent posts of a hashtag?** Set Posted within (days). Expect fewer rows than asked for a short window: Instagram ranks hashtag posts by relevance, so most posts it shows are older.
- **Search phrases work best short and specific**: `wall pilates`, not a sentence.
- **A source may end early.** Instagram decides how far a hashtag or a phrase goes — about 1,500 posts for a big hashtag, a few hundred for a phrase. The Status page says when a source ended because Instagram had no more.
- **Schedule it** (Apify Schedules) to follow profiles or hashtags daily; rows carry `postedAt` so you can keep only new ones.
- **Views** exist for Reels and videos only; Instagram does not count views on photos. An author who hides likes gets an empty Likes cell, not 0.

### ❓ FAQ

**Can it get the newest posts of a hashtag?**
Not in date order: Instagram removed the "Recent" tab of hashtags, and what it shows is ranked by relevance. Use Posted within (days) to keep only recent ones.

**Does it need my Instagram login?**
No. It reads public posts only, without any login or cookies.

**Can it read private profiles?**
No. A private profile is reported as such in the run's message and costs nothing.

**Why fewer rows than I asked for?**
The source ran out, or your filters skipped posts. The Status page and the run's message say which, per source.

**Are duplicate posts charged?**
No. A post found by two sources is saved and charged once.

**Which languages work?**
All of them — hashtags and phrases in Cyrillic, Arabic, CJK and other scripts work.

### 🔗 Other Instagram scrapers (same author)

- [Instagram Profile Scraper](https://apify.com/afanasenko/instagram-profile-scraper) — profiles with emails, contacts and engagement
- [Instagram Comments Scraper](https://apify.com/afanasenko/instagram-comments-scraper) — the comments of a post or Reel, with replies
- [Instagram Reel Script Extractor](https://apify.com/afanasenko/instagram-reel-script-extractor) — the spoken script of a Reel as text
- [Instagram Related Profiles Scraper](https://apify.com/afanasenko/instagram-related-profiles-scraper) — accounts similar to yours

### 🛟 Support & feedback

Found a bug or need a field? Open an issue on the **Issues** tab — we read every one.

### ⚖️ Is it legal to scrape Instagram posts?

This Actor reads only public posts that anyone can see without logging in. Scraping public data is generally lawful, but personal data is protected by laws such as the GDPR — collect only what you need and have a legitimate reason to process it. If unsure, ask a lawyer.

# Changelog

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

# Actor input Schema

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

Instagram hashtags to scrape posts and Reels from, with or without #. Examples: pilates, #veganrecipes, кето. Posts come in Instagram's relevance order for the tag (Instagram no longer offers a newest-first tab); use "Posted within (days)" for recent posts only.

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

Keyword search: phrases to search Instagram posts and Reels for, the way the app's search does. Examples: skincare routine, real estate miami, рецепты на ужин. A phrase is kept whole; any language. Results come by relevance, most of them Reels.

## `profiles` (type: `array`):

Public Instagram profiles whose posts or Reels to scrape: usernames, @usernames or profile links. Examples: natgeo, @nasa, https://www.instagram.com/humansofny/. Newest first. Private profiles cannot be read and cost nothing.

## `maxItemsPerSource` (type: `integer`):

Maximum number of posts and Reels saved per hashtag, keyword or profile — a cost ceiling, since each saved row is one paid result. A source stops earlier when Instagram has no more: a big hashtag goes to about 1,500 posts, a search phrase to a few hundred. Free plan: up to 100 rows per run in total.

## `contentType` (type: `string`):

Which posts to keep: all (Reels, videos, photos and carousels), reels (Reels and videos only; for a profile this reads its Reels tab) or posts (photos and carousels only). Skipped posts are not charged.

## `postedWithinDays` (type: `integer`):

Date filter — keep only posts published in the last N days. 0 = any date. Example: 7 for last week's posts. Older posts are skipped and not charged; a hashtag or keyword lists posts by relevance, so a short window may return fewer rows than asked.

## `skipPinned` (type: `boolean`):

When true, skips the posts and Reels a profile pinned to the top of its grid or its Reels tab (they are often old). Set false to include them; they come marked isPinned. Applies to profiles only.

## Actor input object example

```json
{
  "maxItemsPerSource": 50,
  "contentType": "all",
  "postedWithinDays": 0,
  "skipPinned": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `report` (type: `string`):

No description

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

No description

## `message` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("afanasenko/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 = {}

# Run the Actor and wait for it to finish
run = client.actor("afanasenko/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 '{}' |
apify call afanasenko/instagram-hashtag-reels-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,afanasenko/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/o5x7ClHXWvgVibJ9S/builds/sR1h95SzbAfWzQscc/openapi.json
