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

Scrape public Instagram posts and reels for any hashtag without login. Hundreds of posts per hashtag with captions, likes, comments, plays, author, music, location, tagged users, AI labels and first comments. Export JSON, CSV or Excel.

- **URL**: https://apify.com/deepmine/instagram-hashtag-scraper.md
- **Developed by:** [Preternix](https://apify.com/deepmine) (community)
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.29 / 1,000 saved 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/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

Scrape public Instagram posts and reels by hashtag **without logging in or providing cookies**. Enter `coffee`, `#coffee` or a hashtag link to get matching posts with captions, engagement, authors, music, places, tagged users and comments when Instagram makes them public. Export to JSON, CSV, Excel or through the Apify API.

### Why this Instagram hashtag scraper

- **Search across related topics.** The scraper reads multiple pages and related topics, while keeping only posts that carry the requested hashtag.
- **Only posts that really carry your hashtag.** Every row's caption contains the exact hashtag you asked for (`#coffee`, not `#coffeelover`), so the dataset stays clean.
- **No duplicates.** Each post appears once, even when it shows up on several pages or under several of your hashtags.
- **Rich data per post.** Engagement counts, video and audio links, music, location, tagged users, coauthors, Instagram's AI label and the latest comments.
- **Runs on 512 MB.** Results arrive as Instagram makes them available.
- **Safe to stop and resume.** If a run is stopped or migrated, it continues where it left off and never charges twice for a post.

### What Instagram shows for a hashtag

Without a login, Instagram shows a hashtag's **top posts**, not a complete feed of every new post. Two things follow from that:

- **Most results are reels.** Instagram's public hashtag search is mostly reels, with some photos, carousels and videos. **Posts** and **All** runs keep everything Instagram shows, so most of their rows are reels too.
- **Popular posts come before new ones.** Instagram favors posts that are already getting attention. With **Only posts newer than**, you get fewer rows than the hashtag really has, and a very short period such as `1 day` can return only a handful.

### What data you get

| Field | Example |
|---|---|
| `url`, `shortCode`, `id` | Post link and identifiers |
| `caption`, `hashtags`, `mentions` | Full caption with its hashtags and @mentions |
| `likesCount`, `commentsCount`, `videoPlayCount` | Engagement counts (null when the author hides them) |
| `timestamp` | When the post was published (UTC) |
| `ownerUsername`, `ownerFullName`, `ownerId`, `ownerIsVerified` | The author |
| `displayUrl`, `videoUrl`, `audioUrl`, `videoDuration` | Cover image, MP4 video, separate audio track and length |
| `aiLabel` | Instagram's AI info label, when the post has one |
| `musicInfo` | Song, artist and audio ID, or original audio |
| `locationName`, `locationId`, `location` | Tagged place |
| `taggedUsers`, `coauthorProducers` | People tagged in the post and collab authors |
| `firstComment`, `latestComments` | The first page of comments with author, likes and time |
| `type`, `productType`, `isReel`, `childPosts` | Media type, reel flag and carousel items |
| `searchHashtag`, `inputUrl` | Which of your hashtags found the post |

### How to use it

1. Click **Try for free** and open the **Input** tab.
2. Add one or more hashtags, for example `coffee`, `#veganrecipes` or `https://www.instagram.com/explore/tags/travel/`.
3. Choose **Posts**, **Reels** or **All**, and how many results you want per hashtag (0 means as many as Instagram shows).
4. Optionally keep only recent posts with **Only posts newer than**, such as `7 days` or `2026-01-01`.
5. Click **Start** and download the results as JSON, CSV, Excel or HTML, or read them through the API.

#### Input example

```json
{
  "hashtags": ["coffee", "#latteart", "https://www.instagram.com/explore/tags/barista/"],
  "resultsType": "posts",
  "resultsLimit": 500,
  "onlyPostsNewerThan": "30 days",
  "proxyConfiguration": { "useApifyProxy": true }
}
```

#### Output example

```json
{
  "id": "3991856675261058611",
  "shortCode": "Ddl7H8TNQ4z",
  "type": "Video",
  "productType": "clips",
  "isReel": true,
  "url": "https://www.instagram.com/p/Ddl7H8TNQ4z/",
  "inputUrl": "https://www.instagram.com/explore/tags/coffee/",
  "searchHashtag": "coffee",
  "caption": "Coffee time ☕ #coffee #coffeelover #latteart",
  "hashtags": ["coffee", "coffeelover", "latteart"],
  "mentions": [],
  "likesCount": 78402,
  "commentsCount": 105,
  "videoPlayCount": 1811327,
  "videoViewCount": null,
  "shares": null,
  "saves": null,
  "reposts": null,
  "timestamp": "2026-09-22T14:14:37.000Z",
  "ownerUsername": "example.cafe",
  "ownerFullName": "Example Cafe",
  "ownerId": "59018525640",
  "ownerIsVerified": false,
  "displayUrl": "https://scontent.cdninstagram.com/v/t51.82787-15/cover.jpg",
  "videoUrl": "https://scontent.cdninstagram.com/o1/v/t16/video.mp4",
  "videoDuration": 25.68,
  "audioUrl": "https://scontent.cdninstagram.com/o1/v/t2/audio.mp4",
  "subtitlesUrl": null,
  "dimensionsWidth": 1440,
  "dimensionsHeight": 2560,
  "firstComment": "🔥",
  "latestComments": [
    { "id": "18124311133985913", "text": "🔥", "ownerUsername": "coffee.fan", "timestamp": "2026-09-22T15:02:11.000Z", "likesCount": 0, "repliesCount": null }
  ],
  "locationName": null,
  "taggedUsers": [],
  "coauthorProducers": [],
  "sponsors": [],
  "isPaidPartnership": null,
  "isSponsored": null,
  "aiLabel": null,
  "musicInfo": { "artistName": "Fairouz", "songName": "Fe Kahwa Ala El Mafrak", "usesOriginalAudio": false, "audioId": "1523221354491277", "shouldMuteAudio": false },
  "isCommentsDisabled": null,
  "likesHidden": false,
  "scrapedAt": "2026-11-24T17:52:06.430Z"
}
```

The run's **Output** tab links to the full dataset and a summary. The summary shows posts saved, pages and topics read, and why each hashtag finished (`complete`, `limitReached`, `stopped` or `blocked`). It also counts completed, refused and failed Instagram requests.

### Example tasks

- **Hashtag research:** scrape 500 posts for `#skincare` and rank creators by likes and plays.
- **Reels trend tracking:** choose **Reels only** for `#fitnessmotivation` and sort by `videoPlayCount` to find what goes viral.
- **Brand and campaign monitoring:** schedule a daily run for `#yourbrand` with **Only posts newer than** `7 days` and keep the rows whose `id` you have not seen before. Instagram shows popular posts first, so a one-week window catches posts that a `1 day` window would miss while they are still gaining views.
- **Influencer discovery:** scrape `#veganrecipes`, `#plantbased` and `#veganfood` together and group rows by `ownerUsername`.
- **Content and music insights:** export `musicInfo` and `hashtags` to see which sounds and tags travel together.

### FAQ

#### How do I scrape Instagram hashtags without logging in?

Add your hashtags to the input and start the run. The scraper reads the same public pages that Instagram shows to logged-out visitors, so you never share an Instagram account, password or cookies.

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

Set **Max results per hashtag** to the number you need, or to 0 to keep all posts the scraper can find. The total depends on what Instagram makes available without a login.

#### Why did I get zero posts or reels?

Check the run summary. A completed hashtag can return no rows when Instagram has no public matches or your date or reels filter excludes them. Try a broader date range, **All** results, or another hashtag. A blocked run tells you when Instagram refused the requests, so you can retry later.

#### Why do other Instagram hashtag scrapers return only 10 to 30 posts?

Instagram's public hashtag feed ends after a few pages for each search. This scraper keeps going through the hashtag's related topics (for example `coffeelover` and `iced coffee` for `#coffee`) and keeps only posts whose caption contains your exact hashtag, so you get many more relevant posts without duplicates.

#### Can I scrape only Instagram Reels for a hashtag?

Yes. Set **What to scrape** to **Reels only**. Reel rows have `/reel/` links, play counts, video and audio links, duration and music.

#### Can I get only recent posts?

Yes. Use **Only posts newer than** with a date (`2026-01-31`) or a period (`7 days`, `2 weeks`, `3 months`). The scraper skips older posts without charging for them.

Instagram's public hashtag search shows popular posts first rather than the newest ones, so a date filter returns fewer rows than the hashtag really has. A short period such as `1 day` may return only a few posts or none. For daily monitoring, use a period of a week or more and keep only the post IDs you have not seen before.

#### How does pricing work?

The start fee is $0. You pay $0.49 per 1,000 results on Free, $0.42 on Bronze, $0.36 on Silver and $0.29 on Gold. The Actor charges only for posts or reels saved to your results. Empty, duplicate or invalid hashtags and duplicate results do not add charges.

#### Why are most results reels?

Instagram's public hashtag search, the one people see without logging in, is mostly reels. The scraper keeps every photo, carousel and video Instagram shows when you choose **Posts** or **All**, but most rows will still be reels. Choose **Reels only** to drop the rest.

#### Does it get likes, comments, views, shares and saves?

It returns likes, comment counts, plays and the latest comments for every post where the author has not hidden them. It does not return share, save or repost counts: Instagram does not show them to visitors who are not logged in.

#### Why are some fields null?

`null` means Instagram did not publish that value for the post, for example hidden like counts, no tagged location or no music. A real zero is always shown as `0`.

#### Can I scrape several hashtags in one run?

Yes. Add as many hashtags as you like. Each post is saved once: if a post carries two of your hashtags, it is saved under the first one, and `searchHashtag` tells you which.

#### How do I export Instagram hashtag data to CSV or Excel?

When the run finishes, open the **Output** or **Storage** tab and download the dataset as CSV, Excel, JSON, XML or HTML. You can also fetch it from the Apify API or connect it to Google Sheets, Make, Zapier or n8n.

#### Can I schedule the scraper or call it from the API?

Yes. Create a task with your hashtags and add a schedule, or start runs from the Apify API, the Apify clients for JavaScript and Python, or any integration platform.

#### Is it legal to scrape Instagram hashtags?

The scraper only reads public data that anyone can see without logging in. You are responsible for how you use the data, including personal data rules such as the GDPR. If you are unsure, ask a lawyer about your use case.

#### What happens if a run is stopped or migrated?

The run resumes from where it left off. Posts already saved are kept and are not read or charged again.

# Actor input Schema

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

Hashtags to scrape. Write them as <code>coffee</code>, <code>#coffee</code> or a hashtag link such as <code>https://www.instagram.com/explore/tags/coffee/</code>. Spaces are not allowed inside a hashtag.

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

<b>Posts</b> returns every public post with the hashtag (photos, carousels, videos and reels) with <code>/p/</code> links. <b>Reels</b> keeps reels only, with <code>/reel/</code> links. <b>All</b> returns everything, each with its own link type. Instagram's public hashtag search is mostly reels, so expect most rows to be reels in every mode.

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

How many posts to save for each hashtag. Set 0 or leave empty to save every public post Instagram shows for the hashtag. There is no upper limit.

## `onlyPostsNewerThan` (type: `string`):

Skip older posts. Use a date such as <code>2026-01-31</code>, a UTC time such as <code>2026-01-31T12:00:00Z</code>, or a period such as <code>7 days</code>, <code>2 weeks</code> or <code>3 months</code>. Instagram's public hashtag search shows popular posts first rather than the newest ones, so a recent date returns fewer posts than the hashtag really has.

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

Apify Proxy is included and works well for most runs. You can also use your own proxies.

## Actor input object example

```json
{
  "hashtags": [
    "coffee"
  ],
  "resultsType": "posts",
  "resultsLimit": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `posts` (type: `string`):

No description

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

No description

## `summary` (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": [
        "coffee"
    ],
    "resultsLimit": 100,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("deepmine/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": ["coffee"],
    "resultsLimit": 100,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("deepmine/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": [
    "coffee"
  ],
  "resultsLimit": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call deepmine/instagram-hashtag-scraper --silent --output-dataset

```

## MCP server setup

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