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

Effortlessly scrape Instagram hashtag data, including top posts and engagement metrics. Perfect for marketers, researchers, and data analysts looking to gain insights from Instagram trends and content performance. 📊

- **URL**: https://apify.com/easyapi/instagram-hashtag-scraper.md
- **Developed by:** [EasyApi](https://apify.com/easyapi) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 1,629 total users, 4 monthly users, 100.0% runs succeeded, 21 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

from $2.99 / 1,000 results

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?

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 📸🔍

Effortlessly scrape Instagram hashtag data with this powerful Actor! 🚀

### Features ✨

- 🏷️ Scrape multiple hashtags in one run
- 📊 Collect comprehensive hashtag information
- 🖼️ Gather top media posts for each hashtag
- ⚡ High-performance and scalable

### What data can you extract? 📋

- Top media posts for each hashtag, including:
  - Post ID, code, and timestamp
  - Media type (image, video, carousel)
  - Caption text
  - User information (username, full name, profile picture)
  - Engagement metrics (likes, comments, play count for videos)
  - And more!

### Use cases 💡

- 📈 Analyze hashtag popularity and trends
- 🎯 Identify influencers and top content creators
- 🔬 Research content strategies for specific niches
- 📊 Generate reports on hashtag performance
- 🤖 Feed data into AI models for content analysis

### Getting started 🚀

1. **Input**: Provide a list of hashtags to scrape.
2. **Run**: Start the Actor and let it do the work!
3. **Output**: Retrieve your data in JSON format, ready for analysis or integration.

Supercharge your Instagram hashtag research with this Actor today! 💪

#### Input Example

A full explanation of an input example in JSON.

```
{
    "hashtags": [
        "ronaldo"
    ]
}
```

#### Output sample

The results will be wrapped into a dataset which you can always find in the **Storage** tab. Here's an excerpt from the data you'd get if you apply the input parameters above:

And here is the same data but in JSON. You can choose in which format to download your data: JSON, JSONL, Excel spreadsheet, HTML table, CSV, or XML.

```
[
	{
        "id": "3481521103338382271_13329396247",
        "code": "DBQ2P9igqO_",
        "taken_at": "2024-10-18T11:07:59.000Z",
        "media_type": 1,
        "caption": "😮‍💨The aura of Ronaldo and his fans is completely different>>\n\n#goat🐐",
        "user": {
            "pk": "13329396247",
            "username": "crisxfan",
            "full_name": "𓆩𝐜𝐫𝐢𝐬𝐱𝐟𝐚𝐧𓆪",
            "is_private": false,
            "profile_pic_url": "https://scontent-iad3-2.cdninstagram.com/v/t51.2885-19/456354106_483460271110464_3568038459190018888_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent-iad3-2.cdninstagram.com&_nc_cat=100&_nc_ohc=PnGWXDzWuV0Q7kNvgGj91lq&_nc_gid=5bd621661fd342a68b06cc9ad687c6f4&edm=AFlAz-oBAAAA&ccb=7-5&oh=00_AYB_aX_3VhfDiGWPXPM-piDLperK-oDjgp2Oa8St0xH07w&oe=673082AD&_nc_sid=76c0fc"
        },
        "like_count": 179879,
        "has_liked": false,
        "product_type": "feed",
        "is_paid_partnership": false
    },
    {
        "id": "3404279298968605116_47966950636",
        "code": "C8-bfxbPVG8",
        "taken_at": "2024-07-03T21:22:18.000Z",
        "media_type": 8,
        "caption": "The best games for Cristiano Ronaldo 🇵🇹\n.\n.\n.\n.\n.\n.\n.\n#post #cristiano #cr7 #ronaldo #cr7fans #explore #instagram",
        "user": {
            "pk": "47966950636",
            "username": "celio_v7_",
            "full_name": "Celio",
            "is_private": false,
            "profile_pic_url": "https://scontent-iad3-2.cdninstagram.com/v/t51.2885-19/463625880_533124346012296_3554866288787086088_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent-iad3-2.cdninstagram.com&_nc_cat=100&_nc_ohc=IPVjsN_pxZQQ7kNvgGw_pDt&_nc_gid=5bd621661fd342a68b06cc9ad687c6f4&edm=AFlAz-oBAAAA&ccb=7-5&oh=00_AYASPLkAP4n13bm3wSQ6lrjqWpD_tOu-Tv-Sd9BmASUhhQ&oe=67309F77&_nc_sid=76c0fc"
        },
        "like_count": 84384,
        "has_liked": false,
        "product_type": "carousel_container",
        "is_paid_partnership": false
    },
    ...
]
```

### Related Actors

- 📸 [Instagram Profile Scraper](https://apify.com/easyapi/instagram-profile-scraper) - Extract comprehensive Instagram profile data including follower counts, posts stats and public information.
- 📱 [Instagram Posts Scraper](https://apify.com/easyapi/instagram-posts-scraper) - Scrape Instagram posts data with detailed engagement metrics and content information.
- 💬 [Instagram Comments Scraper](https://apify.com/easyapi/instagram-comments-scraper) - Extract comments from Instagram posts with user details and engagement metrics.
- 📥 [Instagram Videos Downloader](https://apify.com/easyapi/instagram-videos-downloader) - Download Instagram videos in high quality with batch processing support.
- 🎥 [Instagram Reels Downloader](https://apify.com/easyapi/instagram-reels-downloader) - Download Instagram Reels videos with high quality and comprehensive video data.
- 📸 [Instagram Photos Downloader](https://apify.com/easyapi/instagram-photos-downloader) - Save high-quality images from Instagram posts effortlessly.
- 📱 [Instagram Tagged Posts Scraper](https://apify.com/easyapi/instagram-tagged-posts-scraper) - Extract tagged posts from Instagram profiles with detailed metrics.
- 📧 [Instagram Email Scraper](https://apify.com/easyapi/instagram-email-scraper) - Find and extract email addresses from Instagram profiles matching specific criteria.
- 🎬 [Instagram Reels Scraper](https://apify.com/easyapi/instagram-reels-scraper) - Scrape Instagram Reels data with comprehensive metadata and engagement metrics.
- 📱 [Instagram Story Downloader](https://apify.com/easyapi/instagram-story-downloader) - Download Instagram stories with original quality preservation.
- 🔍 [Facebook Hashtag Search Scraper](https://apify.com/easyapi/facebook-hashtag-search-scraper) - Extract posts from Facebook hashtag search results with engagement metrics.
- 🎯 [TikTok Hashtag Search Scraper](https://apify.com/easyapi/tiktok-hashtag-search-scraper) - Scrape TikTok content by hashtags with comprehensive video data.
- 🔍 [Twitter Top Hashtags Scraper](https://apify.com/easyapi/twitter-top-hashtags-scraper) - Extract trending hashtags from Twitter across 60+ countries.
- 🎯 [YouTube Hashtag Generator](https://apify.com/easyapi/youtube-hashtag-generator) - Generate relevant hashtags for YouTube content in 65+ languages.
- 🎯 [YouTube Hashtag Extractor](https://apify.com/easyapi/youtube-hashtag-extractor) - Extract hashtags from YouTube videos automatically.
- 🎥 [YouTube Hashtag Video & Shorts Scraper](https://apify.com/easyapi/youtube-hashtag-video-shorts-scraper) - Scrape YouTube videos and Shorts filtered by hashtags.

# Actor input Schema

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

List of Instagram hashtags to scrape (without the # symbol)

## `maxItems` (type: `integer`):

Maximum number of items to scrape (leave empty for unlimited)

## `dateFrom` (type: `string`):

Start date-time for filtering posts (ISO 8601 format, eg. 2024-01-01T08:00:00Z).

## `dateTo` (type: `string`):

End date-time for filtering posts (ISO 8601 format, eg. 2024-05-05T18:00:00Z).

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

Optionally, use Apify Proxy or custom HTTP proxy to avoid IP address-based blocking.

## Actor input object example

```json
{
  "hashtags": [
    "ronaldo"
  ],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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("easyapi/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 = {}

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

```

## MCP server setup

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