# Instagram Hashtag Posts Scraper (`data_direct/instagram-hashtag-posts-scraper`) Actor

Get posts and reels for a hashtag

- **URL**: https://apify.com/data\_direct/instagram-hashtag-posts-scraper.md
- **Developed by:** [Data Direct](https://apify.com/data_direct) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 pages

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/actors/running/actors-in-store.md#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 Posts Scraper

Get posts and reels for any Instagram hashtag. Returns the same post objects as post search (captions, engagement metrics, media URLs, author metadata) plus the hashtag's total post count. Choose the top, recent, or reels tab, and fetch multiple pages in a single call.

### Features

- Real-time Instagram data — results are fetched live at run time, never cached or stale
- No login, cookies, or proxy configuration needed — just provide the input and run
- Each result is pushed as a separate dataset item, exportable as JSON, CSV, or Excel
- Fast: a typical run finishes in seconds

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `hashtag` | string | yes | Hashtag, with or without the leading # (max 100 characters) |
| `pages` | integer | no | Number of pages to fetch, 1-10 (default: 1). Each page adds up to about 30 posts; repeats across pages are removed. |
| `sort_by` | string | no | Hashtag tab: top, recent, or reels (default: top) One of: top, recent, reels. |

### Pricing

This Actor is billed **per page of results** — **$0.006 per page**.

- Results come in pages. Use the `pages` input to choose how many pages to fetch (1–10); more pages means more results.
- You pay $0.006 for each page you fetch, so `pages: 3` costs **$0.018** and `pages: 1` costs **$0.006**.
- You’re only charged when a run succeeds. Failed runs are free.

### Example output

```json
{
  "posts": [
    {
      "title": "@chloeaustenn19 on Instagram",
      "url": "https://instagram.com/p/DcvNO0YDqxz",
      "date": "2026-09-01 08:14:01",
      "author": "chloeaustenn19",
      "source": "Instagram",
      "domain": "instagram.com",
      "snippet": "am i cute? #chicago #style #summer",
      "likes": 6009,
      "comments": 107,
      "shares": 228,
      "reposts": 0,
      "views": 372196,
      "is_video": true,
      "media_type": "clips",
      "author_verified": false,
      "author_name": "Chloe",
      "hashtags": [
        "#chicago",
        "#style",
        "#summer"
      ],
      "mentions": [],
      "media_id": "3976455188906945651",
      "thumbnail_url": "https://scontent.cdninstagram.com/v/t51.71878-15/cover.jpg",
      "video_url": "https://scontent.cdninstagram.com/o1/v/t2/clip.mp4",
      "video_duration": 10.1,
      "width": 1080,
      "height": 1920,
      "carousel_media_count": 0,
      "is_paid_partnership": false,
      "location": null,
      "tagged_users": [],
      "coauthors": [],
      "carousel_media": [],
      "audio": {
        "type": "original",
        "title": "Original audio",
        "artist": "chloeaustenn19",
        "audio_id": "38320043790943785",
        "duration_ms": 10076
      }
    }
  ],
  "hashtag": "summer",
  "total": 578259801,
  "pages": 2,
  "count": 64
}
```

### About

Maintained by **Data Direct** — a small suite of fast, reliable Instagram and web-data scrapers. Each actor returns clean, structured results with no login, cookies, or proxy setup required. Have a question or a custom data need? Open an issue on this actor.

# Actor input Schema

## `hashtag` (type: `string`):

Hashtag, with or without the leading # (max 100 characters)

## `pages` (type: `integer`):

Number of pages to fetch, 1-10 (default: 1). Each page adds up to about 30 posts; repeats across pages are removed.

## `sort_by` (type: `string`):

Hashtag tab: top, recent, or reels (default: top)

## Actor input object example

```json
{
  "hashtag": "summer",
  "pages": 1,
  "sort_by": "top"
}
```

# 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 = {
    "hashtag": "summer"
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data_direct/instagram-hashtag-posts-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/Bu576H1bzqQBXbXWx/builds/1ZI8hV6M58miZULwY/openapi.json
