# Instagram Hashtag Posts (`opspilot.cc/instagram-hashtag-posts`) Actor

🏷️ Instagram Hashtag Posts | Every post under a hashtag, and how crowded that tag is Give it hashtags and get the posts behind them as rows — author, likes, comments, caption, media type and link — plus the tag's own lifetime post count, so you can tell a tag worth entering from one that is alread…

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

## Pricing

$0.005 / actor start

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

## 🏷️ Instagram Hashtag Posts

> Every post under a hashtag — and how crowded that tag already is.

### ✨ What you get

One dataset row per post:

| Field | What it is |
|---|---|
| `hashtag` / `shortcode` / `url` | the tag and the post |
| `username` / `ownerId` / `followers` / `profileUrl` | the posting account — the handle is filled in when `enrichAuthors` is on |
| `caption` / `isVideo` / `takenAt` | content and timing |
| `likeCount` / `commentCount` | engagement, plus `likesMayBeHidden` — see the FAQ, this matters on hashtag listings |
| `displayUrl` / `accessibilityCaption` | media and alt text |

The run summary gives, per hashtag: posts collected, the tag's **lifetime post count** and your `coveragePct` of it, unique authors in the sample, how many rows still miss a handle, median likes, the share of posts that actually exposed a like count, video share, and the top posting accounts.

### 💼 Use cases

- **Deciding whether a tag is winnable before you brief a creator** — `#yoga` carries a 132-million-post lifetime count; a niche tag carries a few thousand. That single comparison in the summary tells you which tag to put in the brief and which one to stay out of.
- **Finding who already owns a tag** — `topAuthors` in the summary plus the enriched `followers` figure per handle tell you whether the accounts ranking under `#sustainablefashion` are large brands or nano creators you could plausibly partner with.
- **Reading how crowded a tag is on content type** — the video share per hashtag tells you whether the tag is dominated by stills or by Reels, which decides the format you commission.
- **Sampling recent posts under a tag to brief a shoot** — the listing returns recent posts first, so one run at `maxPostsPerHashtag: 40` is enough to see the captions, visual treatment and `takenAt` cadence the tag currently rewards.

### ✅ Who this is for

- **Content strategists choosing which hashtags to brief**— who need the tag's real lifetime size before committing a creator's time to it.
- **SEO and social teams tuning a tag mix**— who need to know which tags have real posts and which are effectively empty for a term they care about.
- **Creator marketplaces and agencies scouting accounts by tag**— who need handles and follower counts for accounts already posting under a topic.
- **Brand and consumer brands doing category listening**— who want a current read on what is being published under their category tag, without an enterprise listening contract.

### ❌ Who this is NOT for

- **Ranking posts by engagement** — Instagram does not expose like counts inside hashtag listings; they come back as 0 while comment counts are present. A `likeCount: 0` row with `likesMayBeHidden` set is not a post nobody liked. Use `shareWithLikes` before drawing any conclusion from the median.
- **A full export of a tag** — you get a capped sample (1–200 posts, default 40) against Instagram's own `reportedPostCount`, and `coveragePct` states how small that sample is. A 132-million-post tag is never fully in your dataset.
- **Identifying accounts when `enrichAuthors` is low or 0** — the listing carries author ids but no handles. Past the `enrichAuthors` limit (default 10, max 30) `username` stays empty, and the summary counts those rows as `postsMissingAuthor`.
- **Historical trend lines or volume forecasts** — the listing is ordered by recency and paging deeper walks backwards through the tag's history. One run is one sample, not a growth curve.
- **Comment text or audience data** — this returns post-level rows. For what people wrote under those posts, feed the `shortcode` values to the Instagram Comments Scraper; follower and audience detail is a different Actor again.

### 🚀 Quick start

1. Open the Actor and press **Start** (defaults to `yoga`, 40 posts, 10 authors enriched).
2. Compare `reportedPostCount` across tags: 132 million posts under `#yoga` versus a few thousand under a niche tag is the difference between a tag you can rank in and one you cannot.
3. Use `topAuthors` to find who already posts under a tag.

### 📥 Input parameters

| Parameter | Type | Default | What it does |
|---|---|---|---|
| `hashtags` | list | `yoga` | Tags to pull, one per line, up to 20 per run. Accepts `yoga`, `#yoga` or an `/explore/tags/yoga/` URL. |
| `maxPostsPerHashtag` | number | `40` | Cap per hashtag (1–200). A run-wide request budget (12 free / 40 paid) also caps total upstream calls; see Billing. |
| `enrichAuthors` | number | `10` | How many distinct authors per hashtag get a profile lookup to fill in the handle and follower count (0–30). Set `0` for the cheapest run. |

### 📤 Output

- **Dataset** — one row per post (or a notice when nothing was collected)
- **SUMMARY** — per-hashtag post counts, coverage, author ranking, warnings

### ⚙️ How it works

1. Each input is reduced to a bare tag; invalid tags are rejected up front because Instagram silently returns nothing for them.
2. Posts are paged through Instagram's own cursor and de-duplicated by shortcode.
3. The hashtag listing returns author ids but no handles, so up to `enrichAuthors` distinct authors per hashtag are resolved through the profile lookup and their rows updated.
4. Like counts are reported as returned, and the share of rows that exposed one is stated per hashtag.

### 💰 Billing

**Billed per run.** A single `apify-actor-start` charge applies when the run begins, at the price shown on this Actor's page. A run that returns 300 rows costs the same as one that returns 3. There is no daily run cap.

**Free plan limit.** One run covers **5 hashtags over 3 pages, 60 posts each, with 10 author enrichments**. That is a hard ceiling on the upstream cost, so it cannot be raised from the input form. A capped run still succeeds: it writes a `notice` row to the dataset, sets `appliedLimits.capped: true` in `SUMMARY`, and logs why. Any paid Apify plan lifts the cap to 20 hashtags over 5 pages with the full enrichment budget.

**Run-wide request budget.** On top of the per-item caps, every run has a fixed ceiling on upstream requests in total — **12 on the free plan, 40 on paid Apify plans** — shared by all accounts, keywords, hashtags or posts in that run, and counting retries. A single item can still walk all of its pages; only wide multi-item runs are compressed. Hitting the ceiling is reported, not hidden: the run still succeeds, delivers everything fetched so far, writes a `type: "notice"` row, and sets `SUMMARY.budgetExhausted: true` alongside `SUMMARY.maxRequestsPerRun` and `SUMMARY.upstreamRequests`.

The per-item figures above are upper bounds, not a promise for every run: when a run supplies the maximum number of items, the shared budget is reached first and fewer items are completed. `SUMMARY.upstreamRequests` reports exactly how many upstream requests were used.

### ❓ FAQ

**Why are so many like counts zero?**
Instagram does not expose like counts inside hashtag listings — the counts come back as 0 while comment counts are present. Check `likesMayBeHidden` on a row, and `shareWithLikes` in the summary for the tag as a whole. A real "nobody liked this" and a "likes are hidden here" are not the same thing, and this Actor does not pretend they are.

**Why are some `username` values empty?**
The hashtag listing carries only an author id. `enrichAuthors` fills in a bounded number of handles per hashtag; the summary reports how many rows still lack one (`postsMissingAuthor`).

**Should I judge a tag by `reportedPostCount`?**
Yes — that is Instagram's own lifetime count for the tag. `coveragePct` then shows how little of it you actually pulled, which matters when comparing a 132-million-post tag with a niche one.

**Are the posts recent?**
The hashtag listing returns recent posts first, ordered by Instagram. Paging deeper walks back through the tag's history.

**Can I get the comments on those posts?**
Yes — take the `shortcode` values and use them with the Instagram Comments Scraper.

### 📚 Resources

- Instagram public hashtag data (no login required)
- Apify free plan: monthly credit covers usage, no separate daily cap

# Changelog

This Actor's version history is a separate document: https://apify.com/opspilot.cc/instagram-hashtag-posts/changelog.md

# Actor input Schema

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

One per line, up to 20 per run. Accepts yoga, #yoga or https://www.instagram.com/explore/tags/yoga/.

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

Cap on posts collected per hashtag. A run-wide request budget (12 free / 40 paid) also caps total upstream calls; see Billing.

## `enrichAuthors` (type: `integer`):

The hashtag listing returns author ids but no handles, so this many accounts per hashtag get a profile lookup to fill in the username and follower count. Set 0 for the cheapest run.

## Actor input object example

```json
{
  "hashtags": [
    "yoga"
  ],
  "maxPostsPerHashtag": 40,
  "enrichAuthors": 10
}
```

# Actor output Schema

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

One row per post, or a single notice when nothing was collected.

## `summary` (type: `string`):

Per-hashtag post counts, coverage, top posting accounts and warnings.

# 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("opspilot.cc/instagram-hashtag-posts").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("opspilot.cc/instagram-hashtag-posts").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 opspilot.cc/instagram-hashtag-posts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opspilot.cc/instagram-hashtag-posts"
        }
    }
}
```

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/Jmwm5zmINgfjb7TWV/builds/oipgcsnz1DbSmNrDk/openapi.json
