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

Instagram Hashtag Scraper API: Automatically extract public Instagram posts by hashtag. Perfect for trend analysis, campaign monitoring, and real-time content collection.

- **URL**: https://apify.com/scraping_solutions/instagram-hashtag-scraper.md
- **Developed by:** [Scraping Solutions](https://apify.com/scraping_solutions) (community)
- **Categories:** Developer tools, Lead generation, E-commerce
- **Security:** Limited permissions
- **Stats:** 156 total users, 4 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.10 / 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.

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

### 🚀 What is Instagram Hashtag Scraper Pro?

**Instagram Hashtag Scraper Pro** is a fast, flexible, and developer-friendly API designed to extract high-quality data from Instagram posts based on hashtag searches. Whether you're tracking trends, analyzing brand engagement, or researching influencer activity, our API gives you structured and relevant data in seconds.

Unlike other tools, we focus on **precision and customization**: get only the fields you need, with no noise — perfect for data pipelines, dashboards, or direct integration into your apps.

***

### ⚙️ How It Works

1. Send a POST request with your desired hashtags and result limits. Instagram `/explore/tags/<tag>/` URLs are also accepted.
2. Review any input warnings, then receive structured data in JSON format as available.
3. Integrate it seamlessly into your workflows or tools.

#### Hashtag normalization and input warnings

This is a **hashtag search**, not a keyword search. For example, `G Cash` becomes `gcash`, `#Palawan Pay ` becomes `palawanpay`, and `Tonik Digital Bank` becomes `tonikdigitalbank`. An Instagram `/explore/tags/manila/` URL becomes `manila`.

Leading `#`, surrounding whitespace, internal spaces, emoji and symbols are removed; letters are lowercased. Unicode letters, numbers, underscores and attached combining marks are preserved, including Thai and Devanagari vowel marks. Text is normalized to NFC. Only Instagram tag-page URLs are accepted, not profile, post, Reel or third-party URLs. Unsupported punctuation, empty entries, nulls and hashtags longer than 100 characters after normalization are rejected.

**Removing emoji or joining words changes the requested hashtag.** For example, `ランチ🍴` searches for `ランチ`; emoji-only inputs are rejected. Review the normalized value to confirm your intended search. Duplicate hashtags are searched only once after normalization, before existing plan limits are applied.

Each changed, rejected or duplicate entry generates a warning with its original value, normalized value and reason. A summary appears in the run status. Full details are stored under **Storage > Key-value store > INPUT_WARNINGS**, not in billable dataset rows.

Mixed valid/invalid inputs process only the valid hashtags. If none remain valid, the run is **FAILED** with a nonzero exit code and an `INVALID_INPUT` audit record, without provider requests or result charges. The platform's configured Actor-start fee may still apply. A valid hashtag with no available posts can succeed with zero results.

***

### 🧪 Input Example

```json
{
  "hashtags": [
    "WinterWarmer",
    "Pastry",
    "Coffee",
    "coffeeshop"
  ],
  "resultsLimit": 10
}
```

***

### 📦 Output Example

```json
[
  {
    "hashtag": "google",
    "link_post": "https://www.instagram.com/p/DJH9MRHxEEO",
    "code": "DJH9MRHxEEO",
    "comment_count": 0,
    "feed_type": "media",
    "like_count": 0,
    "taken_at_date": "2025-05-01T20:26:41+00:00",
    "thumbnail_url": "https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/494407291_17848826511453359_8642425327652126936_n.jpg?se=7&stp=dst-jpg_e35_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6IkZFRUQuaW1hZ2VfdXJsZ2VuLjEwODB4MTM1MC5zZHIuZjc1NzYxLmRlZmF1bHRfaW1hZ2UifQ&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=111&_nc_oc=Q6cZ2QFNucrirlSZqtV_W0i7jzs4CdduQ4okoWPfKp5iMHbw8WXCYSkFC6LGivVKau3nAdxX9XPJlQUAMY4gIn0laEdq&_nc_ohc=yzxgR6sGbrgQ7kNvwEk6tSG&_nc_gid=-hxmZTQ-LmHa2iAcX43Y3w&edm=AMKDjl4BAAAA&ccb=7-5&ig_cache_key=MzYyMzEzMzU0OTA5NzY2NDc4Mg%3D%3D.3-ccb7-5&oh=00_AfG98j4CfZmDHKpeWE9LlmRWaMdKF5oyKkO7IOSCEYqAPA&oe=6819C6CC&_nc_sid=472314",
    "link_user": "https://www.instagram.com/iafeedoficial",
    "caption.text": "🚨 Escândalo na IA! 🤖 Um novo estudo acusa a popular plataforma de benchmarking Chatbot Arena (LM Arena) de favorecer gigantes da tecnologia como Meta, OpenAI e Google. Pesquisadores alegam que essas empresas puderam testar modelos privadamente e ocultar resultados ruins, manipulando o ranking. 🤯\n\nA LM Arena nega as acusações, mas a controvérsia levanta sérias questões sobre a imparcialidade e transparência na avaliação de IAs. 🤔\n\nQuer saber todos os detalhes dessa polêmica? Confira a matéria completa no link da bio! 🔗\n\n#InteligenciaArtificial #IA #ChatbotArena #LMArena #BenchmarkIA #EticaIA #TransparenciaIA #Tecnologia #NoticiasTech #Cohere #Meta #OpenAI #Google #EscandaloIA",
    "caption.hashtags": [
      "#InteligenciaArtificial",
      "#IA",
      "#ChatbotArena",
      "#LMArena",
      "#BenchmarkIA",
      "#EticaIA",
      "#TransparenciaIA",
      "#Tecnologia",
      "#NoticiasTech",
      "#Cohere",
      "#Meta",
      "#OpenAI",
      "#Google",
      "#EscandaloIA"
    ],
    "user.full_name": "IA Feed",
    "user.id": "73496781358",
    "user.is_private": false,
    "user.is_verified": false,
    "user.profile_pic_url": "https://scontent-vie1-1.cdninstagram.com/v/t51.2885-19/487946963_677674758040850_4215226236238474359_n.jpg?stp=dst-jpg_e0_s150x150_tt6&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=102&_nc_oc=Q6cZ2QFNucrirlSZqtV_W0i7jzs4CdduQ4okoWPfKp5iMHbw8WXCYSkFC6LGivVKau3nAdxX9XPJlQUAMY4gIn0laEdq&_nc_ohc=I0qaTxQIvakQ7kNvwHIqLNN&_nc_gid=-hxmZTQ-LmHa2iAcX43Y3w&edm=AMKDjl4BAAAA&ccb=7-5&oh=00_AfHj-n24Jn9ysHhv2_QXr2nuphMqhfxBLdNsEXSZNE-Ksg&oe=6819B0D0&_nc_sid=472314",
    "user.username": "iafeedoficial"
  }
]
```

> 🔎 *Only the most relevant fields are returned by default — keeping your payloads clean and focused.*

***

### 🎯 Key Features

- 📌 Filtered fields: Only receive attributes you care about (e.g. URL, caption, likes).
- ⚡ Fast & lightweight: Optimized for speed and low latency.
- 🧩 Easy to integrate: Works with Python, JavaScript, or any language that supports HTTP.
- 💾 Multiple formats: Data available in JSON (CSV and Excel coming soon).
- 🔐 Privacy-respecting: Only scrapes publicly available content.

***

### 🛠️ Ideal For

- Social media analytics
- Brand monitoring
- Influencer research
- Trend discovery
- Marketing intelligence

***

### ✅ Why Choose This API?

- No complex setup — start scraping in seconds.
- Designed for automation and scale.
- Transparent pricing with generous free tier.
- Focused output for serious data use cases — no clutter, no fluff.

***

**Get started now** and turn hashtags into insights.

# Actor input Schema

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

Add hashtags without #, one per line. Surrounding whitespace and a leading # are removed; hashtags are lowercased. Internal spaces are joined (G Cash becomes gcash), and emoji/symbols are removed with a warning. Unicode letters, numbers, underscores and attached combining marks are supported. Only Instagram /explore/tags/<tag>/ URLs are accepted. Invalid entries are reported in INPUT_WARNINGS; if none remain valid, the run fails.

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

number of pages for scraping, 1-5000 are the allowed values

## Actor input object example

```json
{
  "hashtags": [
    "google"
  ],
  "resultsLimit": 20
}
```

# Actor output Schema

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

Scrape single page in Python records stored in the default dataset.

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

// Run the Actor and wait for it to finish
const run = await client.actor("scraping_solutions/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": ["google"],
    "resultsLimit": 20,
}

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

```

## MCP server setup

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