# Instagram Keyword Posts Scraper - Search Posts by Keyword (`seemuapps/instagram-keyword-posts-scraper`) Actor

Search Instagram posts, Reels and carousels by any keyword or phrase. Export captions, hashtags, likes, comments, views, dates, locations and author profiles.

- **URL**: https://apify.com/seemuapps/instagram-keyword-posts-scraper.md
- **Developed by:** [Seemu Scraping](https://apify.com/seemuapps) (community)
- **Stats:** 29 total users, 11 monthly users, 99.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 posts

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 Keyword Posts Scraper - Search Posts by Keyword

Search Instagram posts by any keyword or phrase, the same way the Instagram search bar does, and export every matching post with its caption, hashtags, likes, comments, views, posting date, location and author profile. No Instagram login or cookies needed.

You don't have to guess hashtags. Type plain words or whole phrases such as `coffee shop`, `home workout` or `sourdough starter tips` and get the posts Instagram ranks as top results for that search.

### What you get

One row per post, for every keyword you search:

- **Post:** `postId`, `shortcode`, `url`, `type` (`reel`, `photo`, `carousel` or `video`), `caption`, `hashtags`, `mentions`, `takenAt`
- **Engagement:** `likeCount`, `commentCount`, `playCount` (Reels and videos), `videoDuration`, `isPaidPartnership`
- **Media:** `displayUrl` (thumbnail or cover image), `videoUrl`, `carouselImageUrls`, `carouselMediaCount`
- **Location:** `locationName`, `locationCity`, `locationAddress`, `locationId`, `locationLat`, `locationLng` (when the post is tagged with a place)
- **Owner:** `ownerUsername`, `ownerFullName`, `ownerId`, `ownerIsVerified`, `ownerIsPrivate`, `ownerFollowerCount`, `ownerProfilePicUrl`
- **Context:** `keyword` (which search found the post) and `position` (its rank in that keyword's results)

Export to JSON, CSV, Excel or Google Sheets straight from the Apify Console, or pull the data through the Apify API.

### Use cases

- **Content research and trend spotting:** see which Reels and posts rank for a topic and what captions, hooks and hashtags they use
- **Influencer discovery:** find creators posting about your niche, with follower counts and verified status
- **Brand and competitor monitoring:** track who posts about a brand, product or campaign phrase
- **Local business lead generation:** search phrases like `coffee shop`, `nail salon` or `dentist` and collect the tagged locations and accounts
- **Market and audience research:** pull hundreds of posts on a subject for sentiment or topic analysis

### How to use

1. Add one or more **Keywords**. Plain words and multi-word phrases both work, and `#` is not needed.
2. Set **Max posts per keyword** (default 100; set 0 to fetch everything Instagram returns).
3. Optionally narrow the results:
   - **Post type:** Reels, photos, carousels or non-Reel videos only
   - **Minimum likes:** skip low-engagement posts
   - **Posted after / Posted before:** keep posts from a date range (for example `2026-01-01`, or a relative value like `30 days`)
4. Run the Actor. Posts appear in the **Dataset** tab as they're found.

#### Getting more results with Page ID

Each run saves a resume cursor for every keyword. To keep going where a run stopped:

After the run finishes, open the **Key-value store** tab → copy the `NEXT_PAGE_ID` value → paste it into **Page ID** on your next run with the same keywords. If `NEXT_PAGE_ID` is `null`, you've fetched everything for those keywords.

Keywords that were fully fetched are skipped on the next run, and any new keywords you add start from the beginning.

### How many posts can I get per keyword?

Instagram decides how deep keyword results go. In our tests a keyword typically returned **100 to 500+ posts** before Instagram stopped offering more. Broad, popular terms such as brand names go deepest, and narrow phrases end sooner. Results are ranked by relevance, not by date, and Instagram shuffles them slightly between sessions, so two runs of the same keyword won't return exactly the same posts.

Most keyword results are **Reels**. Photo and carousel posts make up roughly 5 to 25 percent depending on the topic, so a "Photos only" filter scans more results to find each match.

### Output example

```json
{
  "recordType": "post",
  "keyword": "coffee shop",
  "position": 1,
  "postId": "3930364806137705633",
  "shortcode": "DaLdfebiPSh",
  "url": "https://www.instagram.com/reel/DaLdfebiPSh/",
  "type": "reel",
  "caption": "POV : Tu passes chez Fripsquare café et t'arrives pas à te décider 😭🥤 #fripsquarecafe #coffeeshop #icedlatte",
  "hashtags": ["fripsquarecafe", "coffeeshop", "icedlatte"],
  "mentions": [],
  "takenAt": "2026-06-29T18:00:59.000Z",
  "likeCount": 177743,
  "commentCount": 385,
  "playCount": 2544932,
  "videoDuration": 10.216,
  "displayUrl": "https://scontent.cdninstagram.com/...jpg",
  "videoUrl": "https://scontent.cdninstagram.com/...mp4",
  "locationName": null,
  "ownerUsername": "fripsquarecafe",
  "ownerFullName": "Fripsquare Café",
  "ownerId": "26576568007",
  "ownerIsVerified": true,
  "ownerFollowerCount": 24749,
  "ownerProfilePicUrl": "https://scontent.cdninstagram.com/...jpg",
  "scrapedAt": "2026-10-06T08:00:00.000Z"
}
```

If a keyword returns no posts, or none of its posts match your filters, the dataset gets one `"recordType": "notice"` row explaining why. Notice rows are never charged.

### Pricing

You pay per post saved to the dataset. When you use a filter (post type, minimum likes or a date range), each page of search results scanned is also billed as a small separate event, because filtering means scanning results that don't end up in your dataset. To protect your budget, a keyword stops after 10 pages in a row with no matches.

Free Apify plans can save up to 50 posts per run, with up to 3 runs per day. Upgrade to a paid Apify plan to remove these limits.

### FAQ

**Do I need an Instagram account?** No. The Actor needs no login, cookies or session.

**Can I search hashtags?** Yes, but you don't have to. A plain keyword returns the posts Instagram's own search shows for it, and those come from captions, hashtags, locations and account names.

**Why are some like counts empty?** Some creators hide like counts. Those posts show `likeCount: null` and are skipped when **Minimum likes** is set.

**Are media URLs permanent?** Instagram's image and video links expire after a few days. Download the files soon after the run if you need to keep them.

# Actor input Schema

## `keywords` (type: `array`):

One or more keywords or phrases to search Instagram posts for, e.g. "coffee shop", "home workout", "nike". Plain words and multi-word phrases both work — no # needed. Each keyword is searched separately and every row records which keyword found it.

## `maxPostsPerKeyword` (type: `integer`):

Maximum number of posts to save for each keyword. Set 0 to fetch everything Instagram returns for the keyword (typically a few hundred posts).

## `postType` (type: `string`):

Only save posts of this type. Instagram's keyword results are mostly Reels, so photo, carousel and video filters return fewer posts per page scanned.

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

Only save posts with at least this many likes. Posts whose like count is hidden are skipped when this is set. Leave at 0 for no filter.

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

Only save posts published on or after this date (YYYY-MM-DD), or a relative value like "30 days". Results are ranked by relevance, not date, so this filters the results rather than reaching further back.

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

Only save posts published on or before this date (YYYY-MM-DD), or a relative value like "7 days".

## `pageId` (type: `string`):

Paste NEXT_PAGE_ID from the previous run's Key-value store to continue each keyword where it stopped. Leave empty to start fresh.

## Actor input object example

```json
{
  "keywords": [
    "coffee shop"
  ],
  "maxPostsPerKeyword": 100,
  "postType": "all",
  "minLikes": 0
}
```

# Actor output Schema

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

One post per record. Fields: keyword, position, postId, shortcode, url, type (photo/video/carousel/reel), caption, hashtags, mentions, takenAt, likeCount, commentCount, playCount, displayUrl, videoUrl, location, and owner username, full name, id, verified flag, follower count and profile picture.

## `nextPageId` (type: `string`):

NEXT_PAGE_ID record in the default key-value store. Paste into Page ID on the next run to resume every keyword; null when all keywords are exhausted.

# 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 = {
    "keywords": [
        "coffee shop"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("seemuapps/instagram-keyword-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 = { "keywords": ["coffee shop"] }

# Run the Actor and wait for it to finish
run = client.actor("seemuapps/instagram-keyword-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 '{
  "keywords": [
    "coffee shop"
  ]
}' |
apify call seemuapps/instagram-keyword-posts-scraper --silent --output-dataset

```

## MCP server setup

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