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

Scrape top or recent Instagram posts for any hashtag without a login. Give a list of tag names and get back each post with its permalink, owner (username, name, verified), media type, like, comment and view counts, caption, and post date. Pagination is walked up to your chosen limit per hashtag.

- **URL**: https://apify.com/goat255/instagram-hashtag-scraper.md
- **Developed by:** [Goutam Soni](https://apify.com/goat255) (community)
- **Categories:** Social media, Marketing, SEO tools
- **Stats:** 2 total users, 2 monthly users, 87.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 post scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Scraper - Top & Recent Posts, Engagement, Owners

Scrape top or recent Instagram posts for any hashtag. Get each post's permalink, the account that published it (username, full name, verified badge), media type, likes, comments, view counts, full caption, and post date, without an Instagram API key, login, or cookies.

### What this Instagram hashtag scraper does

Pass a list of tag names (with or without the `#`, full tag links work too) and the actor returns one clean JSON row per post. Choose **top** posts to surface the highest-engagement content for a tag, or **recent** posts to get the freshest content in reverse-chronological order. Pagination is walked automatically until it hits the cap you set or the tag runs out of posts.

Perfect for **trend research, creator discovery, campaign tracking, competitor analysis, and content dataset building** on Instagram at scale.

### Why use this Instagram hashtag scraper

- **No API key, no login, no cookies.** Works on any public hashtag.
- **Top or recent, your choice.** Top is engagement-ranked, recent is newest first. Same fields either way, only the ordering changes.
- **Creator discovery built in.** Every row carries the posting account's username, display name, numeric ID and verified badge, so a hashtag run doubles as a prospect list.
- **Deep pagination.** Ask for hundreds or thousands of posts per tag and the scraper walks page after page until your cap is reached.
- **Media type on every row.** Photo, video or carousel, plus a play count where the post is a video or reel.
- **Several hashtags at once**, processed in parallel.
- **Residential proxies** built in with rotating IPs.
- **Clean, flat JSON.** Every field is always present, with `null` where a value genuinely does not exist, so CSV exports never shift columns.

### What data you get per post

| Field | Type | Description |
|---|---|---|
| `type` | string | Record type, always `"post"` |
| `hashtag` | string | The tag this post was found under, without the `#` |
| `shortcode` | string | URL slug (`instagram.com/p/{shortcode}`) |
| `url` | string | Permalink to the post |
| `ownerUsername` | string | Username of the account that published the post |
| `ownerFullName` | string | Display name of the publishing account |
| `ownerId` | string | Numeric Instagram user ID of the publishing account |
| `ownerIsVerified` | boolean | Verified badge on the publishing account |
| `mediaType` | string | `"photo"`, `"video"`, or `"carousel"` |
| `isVideo` | boolean | Convenience flag, true for videos and reels |
| `likeCount` | integer | Number of likes |
| `commentCount` | integer | Number of comments |
| `viewCount` | integer | Play count for videos and reels, `null` for photos and carousels |
| `caption` | string | Full caption text, with hashtags, mentions and emojis |
| `takenAt` | string | When the post was published (ISO 8601 UTC) |
| `displayUrl` | string | Full-resolution image URL |
| `scrapedAt` | string | When the row was scraped (ISO 8601 UTC) |

### How to use the Instagram Hashtag Scraper

1. Click **Try for free** on the actor page.
2. Enter tag names in the `hashtags` input, without the `#`. A full tag link works too.
3. Pick `resultType`: `top` (highest engagement) or `recent` (freshest first). Default is `top`.
4. Set `maxPostsPerHashtag` (default 100, up to 5,000) to cap how many posts come back per tag.
5. Tune `concurrency` (default 5, up to 20) if you are scraping many tags at once.
6. Click **Save & start**. Download in JSON, CSV, Excel, XML or HTML, or stream via API.

#### Example input

```json
{
  "hashtags": ["travel", "foodphotography"],
  "resultType": "top",
  "maxPostsPerHashtag": 500,
  "concurrency": 5
}
```

#### Example output

```json
{
  "type": "post",
  "hashtag": "travel",
  "shortcode": "CabcdEFghij",
  "url": "https://www.instagram.com/p/CabcdEFghij/",
  "ownerUsername": "example_user",
  "ownerFullName": "Jane Doe",
  "ownerId": "100000001",
  "ownerIsVerified": false,
  "mediaType": "video",
  "isVideo": true,
  "likeCount": 735,
  "commentCount": 196,
  "viewCount": 72961,
  "caption": "Sunset over the old town #travel",
  "takenAt": "2026-01-18T14:32:00.000Z",
  "displayUrl": "https://example.com/media.jpg",
  "scrapedAt": "2026-01-20T09:00:00.000Z"
}
```

### Top use cases

- **Trend research.** Track how a topic moves over time by scraping the same tag on a schedule and charting engagement.
- **Creator discovery.** Pull the top posts for a niche tag and you have a ranked shortlist of accounts already producing content in that space.
- **Campaign and branded-hashtag tracking.** Measure how much content your campaign tag is generating and who is generating it.
- **Competitor analysis.** See who dominates the tags your brand cares about and what their posts look like.
- **Content strategy.** Compare caption style, media type and posting time against engagement across hundreds of posts.
- **Market research.** Map an interest or product category through the tags people actually use.
- **Content dataset building.** A clean, structured corpus of captions and engagement metrics for analysis or model training.

### Integrations

#### Apify API

```bash
curl "https://api.apify.com/v2/datasets/{DATASET_ID}/items?format=json"
```

#### Python

```python
from apify_client import ApifyClient
from collections import Counter

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("goat255/instagram-hashtag-scraper").call(run_input={
    "hashtags": ["travel", "foodphotography"],
    "resultType": "top",
    "maxPostsPerHashtag": 200,
})

posts = list(client.dataset(run["defaultDatasetId"]).iterate_items())

## Which accounts appear most often across the tag?
top_creators = Counter(p["ownerUsername"] for p in posts if p.get("ownerUsername"))
for username, count in top_creators.most_common(10):
    print(f"@{username}: {count} posts")
```

#### JavaScript / Node.js

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('goat255/instagram-hashtag-scraper').call({
    hashtags: ['travel', 'foodphotography'],
    resultType: 'top',
    maxPostsPerHashtag: 200,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
const videos = items.filter((p) => p.isVideo);
console.log(`${videos.length} of ${items.length} top posts are videos`);
```

#### No-code integrations

Stream results to Google Sheets, Slack, Zapier, Make, Amazon S3, HubSpot, or any webhook via [Apify Integrations](https://docs.apify.com/platform/integrations).

### Pricing

Pay per result. No subscription. No per-run start fee. You only pay for the posts you actually receive.

| Event | Price |
|---|---|
| Post scraped (primary) | $0.0015 |

Apify's $5 platform free credit applies on first use, which is roughly 3,300 free posts to start.

### FAQ

#### Do I need an Instagram account or API key?

No. The scraper works on any public hashtag without a login, cookies, or the Instagram Graph API.

#### What is the difference between top and recent?

`resultType` changes the ordering, not the fields. Top posts are engagement-ranked by Instagram, so they skew toward larger accounts and older high-performing content. Recent posts are newest first and are the right choice for live campaign monitoring.

#### Why did I get fewer posts than I asked for?

The tag ran out. Ask for 500 posts on a small niche tag and you get however many exist, not 500 padded rows. The run log states the count per tag.

#### Why is `viewCount` empty on some rows?

Play counts only exist for videos and reels. Photos and carousels have no play count, so the field is `null` on those rows. Use `isVideo` to filter to rows where a play count is meaningful.

#### Should I include the `#` in my input?

You do not need to. Plain tag names work, and a full tag link is accepted and cleaned automatically.

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

Yes. Pass as many as you like in the `hashtags` array. They are processed in parallel and every row carries a `hashtag` field, so results are easy to group and filter.

#### Can I export to CSV, Google Sheets or Excel?

Yes. JSON, CSV, Excel, XML and HTML are all supported, plus direct integrations to Google Sheets, Zapier, Make, Slack and S3.

#### What happens if a hashtag cannot be reached?

The run does not fail. The actor emits a row with `ok: false` and a generic reason for that tag, then carries on with the rest of your list. A post whose owner has since gone private or been removed simply drops out of the grid, so the actor returns what the tag currently exposes.

### Related Apify actors

- 👤 [Instagram Profile Scraper](https://apify.com/goat255/instagram-profile-scraper) - bios, follower counts, public emails, phone numbers, business info.
- 📝 [Instagram Posts Scraper](https://apify.com/goat255/instagram-posts-scraper) - bulk export posts, captions, likes, comments, media.
- 🎬 [Instagram Reels Scraper](https://apify.com/goat255/instagram-reels-scraper) - reels with play counts, duration and direct video URLs.
- 💬 [Instagram Comments Scraper](https://apify.com/goat255/instagram-comments-scraper) - full comment threads from any post or reel.

### Support

Found a bug or a missing field? Open an issue on the actor page. Reviews are read and replied to.

### Privacy

To improve our actors we collect anonymized usage telemetry (run stats and input patterns). No personal account data is collected.

# Actor input Schema

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

Hashtags to scrape, without the # prefix. A full tag link works too. Examples: travel, foodphotography, https://www.instagram.com/explore/tags/travel/.

## `resultType` (type: `string`):

Top posts (highest engagement for the hashtag) or Recent posts (freshest, in reverse-chronological order).

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

Cap on posts returned per hashtag. Pagination is walked across multiple pages until this is reached or the hashtag is exhausted.

## `concurrency` (type: `integer`):

How many hashtags to process in parallel.

## Actor input object example

```json
{
  "hashtags": [
    "travel"
  ],
  "resultType": "top",
  "maxPostsPerHashtag": 100,
  "concurrency": 5
}
```

# 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"
    ]
};

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

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

```

## MCP server setup

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

```

## OpenAPI specification

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