# Instagram Keyword Search Scraper - Top Posts & Reels (`ryyos/instagram-search-scraper`) Actor

\[$1.5/1000] Search Instagram by keyword or #hashtag and get the top posts in full detail - likes, comments with authors, all carousel media, tagged users, music, location - plus topic descriptions and related searches. No login needed.

- **URL**: https://apify.com/ryyos/instagram-search-scraper.md
- **Developed by:** [Rio Dwi Saputra](https://apify.com/ryyos) (community)
- **Features:** Limited permissions
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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

**Search Instagram by keyword and get the top public posts and reels in full detail - no login, no cookies, no browser.** Type `iced latte`, `street food jakarta` or even a hashtag like `#kopisusu`. For every term you get Instagram's top posts, each opened in full (exact likes, comments with authors, every carousel image and video, tagged users, music, location), plus a **keyword summary** with the topic description and related searches. Optionally, the Actor **searches the related keywords automatically** to widen your research.

### What does Instagram Keyword Search Scraper do?

It uses [Instagram](https://www.instagram.com)'s public keyword search, the same top results anyone sees on Instagram's topic pages without logging in, and turns them into clean, structured JSON. Hashtags are accepted and searched as keywords: popular tags such as `#icedlatte` work as they are, and **glued tags such as `#erinejkt48` or `#streetfoodjakarta` are split into real words automatically** (`erine jkt48`, `streetfood jakarta`), because Instagram's public search understands phrases, not glued tags. It runs over plain HTTP with automatic proxy rotation, so it's quick, inexpensive and needs no Instagram account.

Each run returns:

- **Posts** for each keyword with their search rank: caption, hashtags, mentions, exact likes and comments, video play counts, publish time, all image and video URLs (every carousel item), alt text, tagged users, collaborators, music, location and the latest comments.
- **Keyword summary rows**: Instagram's encyclopedia-style description of the topic with its sources, up to 10 related searches, and how many posts were found and saved.

Because it runs on Apify you get API access, scheduling, webhooks, integrations (Make, Zapier, Google Sheets, Slack...) and monitoring built in.

### Why use this Instagram search scraper?

- **Trend research** - see which posts and creators dominate a topic or hashtag right now.
- **Influencer discovery** - find active creators in a niche from the owners of top posts.
- **Content inspiration** - collect top captions, formats and music for a topic.
- **Brand monitoring** - track what's trending around your product category.
- **Topic expansion** - related-keyword expansion uncovers adjacent niches you didn't think to search.

### How to search Instagram by keyword

1. Click **Try for free**.
2. Enter your search terms in **Keywords**, one per line. Hashtags work too.
3. Pick how many posts per keyword you want and whether to open every post.
4. Optionally set **Also search related keywords**, date range, media types or like thresholds.
5. Click **Start**, then download results from the **Output** tab as JSON, CSV, Excel or HTML, or via the API.

### Input

| Field | What it does | Default |
|---|---|---|
| `searchTerms` | Keywords. `#hashtags` and hashtag links are searched as keywords | - |
| `maxPostsPerTerm` | Top posts per keyword (Instagram serves ~50-60 logged-out) | `36` |
| `scrapePostDetails` | Open every post for full detail | `true` |
| `maxCommentsPerPost` | Latest comments per post | `5` |
| `includeKeywordSummary` | One summary row per keyword | `true` |
| `expandRelatedKeywords` | Also search N related keywords per term | `0` |
| `postedAfter` / `postedBefore` | Date range (`YYYY-MM-DD` or `30 days`) | - |
| `mediaTypes` | `photo`, `video`, `carousel`, `reel` | all |
| `minLikes` / `minComments` | Engagement thresholds | `0` |
| `maxConcurrency` | Parallel requests | `3` |

```json
{
  "searchTerms": ["iced latte", "street food jakarta", "#kopisusu"],
  "maxPostsPerTerm": 36,
  "maxCommentsPerPost": 5,
  "expandRelatedKeywords": 2,
  "mediaTypes": ["reel"]
}
```

### Output

Rows have `resultType` `post` or `keyword`, shown in the **Posts** and **Keyword summaries** views. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```json
{
  "resultType": "post",
  "searchTerm": "iced latte",
  "searchRank": 1,
  "url": "https://www.instagram.com/reel/C4qk8unMr_X/",
  "type": "Video",
  "caption": "...",
  "likesCount": 348433,
  "commentsCount": 209,
  "videoPlayCount": 9571439,
  "ownerUsername": "yourcoffeedude",
  "videoUrl": "https://scontent...mp4",
  "musicInfo": { "title": "Tadow", "artist": "Masego, FKJ", "isOriginalAudio": false },
  "latestComments": [{ "ownerUsername": "...", "text": "..." }],
  "foundViaRelatedKeyword": null
}
```

```json
{
  "resultType": "keyword",
  "searchTerm": "travel",
  "searchedAs": "travel",
  "description": "Travel means to journey from one place to another...",
  "descriptionSources": ["https://prod-celery.merriam-webster.com/dictionary/travel"],
  "relatedKeywords": ["transfer travel", "time travel real", "november travel destinations"],
  "postsFound": 24,
  "postsSaved": 24
}
```

#### Main data fields

| Group | Fields |
|---|---|
| Search | `searchTerm`, `searchedAs`, `searchRank`, `foundViaRelatedKeyword` |
| Post | `shortCode`, `url`, `type`, `isReel`, `caption`, `hashtags`, `mentions`, `timestamp` |
| Engagement | `likesCount`, `commentsCount`, `videoPlayCount`, `latestComments` |
| Media | `displayUrl`, `images`, `videoUrl`, `videoUrls`, `childPosts` |
| Context | `ownerUsername`, `ownerIsVerified`, `taggedUsers`, `coauthors`, `location`, `musicInfo`, `topics` |
| Keyword | `description`, `descriptionSources`, `relatedKeywords`, `postsFound`, `postsSaved` |

### How much does it cost to search Instagram?

**$1.5 per 1,000 results** (each post and each keyword summary counts as one result). Example: 10 keywords x 36 posts + 10 summaries = 370 results, about $0.56. Filtered-out posts are never saved, so they are never charged.

### Tips

- Turn off **Open every post** for the fastest run when owner, caption, image/video and play count are enough. Like and comment thresholds still work, because posts are then opened automatically.
- Use `expandRelatedKeywords` with 2-3 for discovery. Each expansion is a full search, so it multiplies results.
- Hashtags and plain keywords return the same kind of top-post results. `#coffee` and `coffee` are treated as the same term.
- **Joined hashtags are fixed for you.** Instagram's public search understands phrases, not glued-together tags, so `#erinejkt48` alone finds nothing. When a term comes back empty, the Actor automatically tries it as separate words (`erine jkt48`), keeps the version whose posts really mention your tag, and shows it in the `searchedAs` column.
- For profiles, single posts, reels and locations use the companion **Instagram Scraper - Posts, Reels, Profiles & Comments**.

### FAQ, limitations and support

**Do I need to log in?** No. Everything is collected logged-out.

**Is this a hashtag feed scraper?** No. Instagram only shows a hashtag's full feed (all recent posts) to logged-in users. This Actor returns the top posts from Instagram's public keyword search instead. A hashtag is searched as a keyword, which for most tags gives the same top posts you would see under it.

**Why at most ~60 posts per keyword?** That's how many top posts Instagram serves without an account. Searching related keywords is the best way to collect more posts around a topic.

**Why did a keyword return 0 posts?** Instagram simply has no public, logged-out results for some terms (very niche tags, some brand or group names). Joined hashtags are already retried as separate words automatically. If it is still empty, try a broader or differently worded phrase, or scrape the creator's profile with the Instagram Scraper instead.

**Can it search for profiles or places?** Not logged-out. Instagram blocks those search types without an account. Search posts by keyword here, then feed interesting creators into the Instagram Scraper.

**Is it legal?** It collects only publicly visible data. Results can include personal data protected by GDPR and similar laws, so process it only for legitimate purposes and review Instagram's terms for your use case.

**Feedback or custom needs?** Use the **Issues** tab. Custom solutions are available on request.

# Actor input Schema

## `searchTerms` (type: `array`):

One per line, e.g. <code>iced latte</code>, <code>street food jakarta</code>, <code>coffee</code>. Hashtags (<code>#streetfood</code>) and hashtag links also work: they are searched as keywords, the same results Instagram shows logged-out. Glued tags that find nothing (<code>#erinejkt48</code>) are retried as separate words (<code>erine jkt48</code>) automatically.

## `maxPostsPerTerm` (type: `integer`):

Top posts to collect per keyword. Without a login Instagram serves around 50-60 top posts per keyword, so larger values return what is available.

## `scrapePostDetails` (type: `boolean`):

Opens each post for exact likes and comment counts, latest comments with authors, all carousel images and videos, tagged users, collaborators, music and location. Turn off for a faster, cheaper run with search-listing data only (owner, caption, image, video, plays).

## `maxCommentsPerPost` (type: `integer`):

Latest comments to include with each opened post. Without a login Instagram shows about the first 12-15.

## `includeKeywordSummary` (type: `boolean`):

Adds one row per keyword with Instagram's topic description, its sources, related searches and how many posts were found.

## `expandRelatedKeywords` (type: `integer`):

Automatically search this many of Instagram's related keywords for each of your terms (0 = off). Great for discovering adjacent topics and creators.

## `postedAfter` (type: `string`):

Only keep posts published after this date. YYYY-MM-DD or relative such as <code>30 days</code>. UTC.

## `postedBefore` (type: `string`):

Only keep posts published before this date. Same formats as above.

## `mediaTypes` (type: `array`):

Keep only these kinds of posts. Leave empty to keep everything.

## `minLikes` (type: `integer`):

Skip posts with fewer likes than this. 0 keeps all posts. Exact counts need the opened post, so posts are opened automatically when this is set.

## `minComments` (type: `integer`):

Skip posts with fewer comments than this. 0 keeps all posts. Posts are opened automatically when this is set.

## `maxConcurrency` (type: `integer`):

How many requests run in parallel.

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

Apify Proxy is used by default and rotated automatically when Instagram rate-limits a session.

## Actor input object example

```json
{
  "searchTerms": [
    "iced latte",
    "street food jakarta"
  ],
  "maxPostsPerTerm": 36,
  "scrapePostDetails": true,
  "maxCommentsPerPost": 5,
  "includeKeywordSummary": true,
  "expandRelatedKeywords": 0,
  "mediaTypes": [],
  "minLikes": 0,
  "minComments": 0,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

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

No description

## `runInfo` (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 = {
    "searchTerms": [
        "iced latte",
        "street food jakarta"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ryyos/instagram-search-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 = {
    "searchTerms": [
        "iced latte",
        "street food jakarta",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("ryyos/instagram-search-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 '{
  "searchTerms": [
    "iced latte",
    "street food jakarta"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call ryyos/instagram-search-scraper --silent --output-dataset

```

## MCP server setup

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