# Instagram Keyword Scout (`skcho/instagram-insight-actor`) Actor

Find public Instagram post/reel candidates from keywords first, with optional aliases for better coverage and explicit shortage diagnostics.

- **URL**: https://apify.com/skcho/instagram-insight-actor.md
- **Developed by:** [seungkyu cho](https://apify.com/skcho) (community)
- **Categories:** Social media, Developer tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 83.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 result items

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Instagram Keyword Scout

Low-cost Apify Actor for finding public Instagram post/reel candidates from niche keywords, influencers, brands, UGC research, and optional alias testing.

This Actor is not a broad Instagram scraper replacement. It is a focused discovery tool: start with keywords only, inspect public candidate pages, resolve a controlled number of post/reel rows, and explain what worked, what was duplicated, and why a target was short. Add aliases later when you want better coverage or cleaner results.

### Who It Is For

- K-pop, creator, model, cosplay, local trend, and niche keyword scouting
- brand and UGC candidate discovery before manual review or AI enrichment
- optional alias testing across names, romanized names, usernames, and hashtag variants
- small repeatable research batches where cost, duration, and shortages must be visible

### Product Ladder

| Preset | Goal | Internal settings |
| --- | --- | --- |
| Scout 25 | Cheap proof that keyword-only discovery works | target 5 per keyword, total cap 15 media rows |
| Scout 100 | Standard validation batch | target 25 per keyword, total cap 100 media rows |
| Advanced 300 | Slower, higher-cost research batch | target 50 per keyword, total cap 300 media rows, checkpoint on |

Keep the customer promise modest: public candidate discovery with diagnostics. Do not promise full Instagram coverage, private data, login bypass, comments at scale, or complete metadata for every row.

### Validated Smoke Run

The current Scout 25 alias-assisted flow was validated on Apify Cloud on 2026-07-06.

```text
Run: zgSx3r5DrlXppu5jr
Build: 1.1.45
Dataset: ObazFo7lWpER7yKrf
Duration: 141.105s wall time
Cost: $0.01637
Run options: 2048 MB memory, 1800s timeout
Rows: 19 total, 3 search rows, 15 media rows, 1 runSummary row
Quality: 15/15 usable media rows, 0 failed rows, 0 target shortages
Top candidates: #aespakarina, #kimchaeyeon, #seoulfood
````

Use this as a smoke-test expectation, not a guarantee. Instagram public-page availability changes, keyword-only runs can be blocked, and some niches benefit from adding aliases after the first run.

### Quick Start

```bash
npm install
npm run build
npm run dev
```

For a deployable release build:

```bash
npm run build:release
```

Plain `npm run build` only compiles TypeScript. `build:release` updates `package.json`, `package-lock.json`, and `.actor/actor.json` together. Apify Actor source versions use `MAJOR.MINOR`, while npm package versions keep semver patch numbers.

### Basic Apify Input

The Apify form has only three fields.

```text
Keywords
karina
kim chaeyeon
seoul food

Result size
Scout 25 - cheapest first run

Aliases
Leave empty for the first run.
```

The Actor automatically tries exact, compact hashtag, underscore hashtag, profile guess, and Instagram keyword-search candidates. For example, `kim chaeyeon` can produce `#kimchaeyeon`, `#kim_chaeyeon`, `@kimchaeyeon`, and `@kim_chaeyeon` candidates.

Aliases are optional. Add them after the first run when a niche needs better coverage:

```text
karina: aespakarina, karinaaespa, katarinabluu, yujimin
kim chaeyeon: kimchaeyeon, chaeyeon, tripleschaeyeon, kim chae yeon
seoul food: seoulfood, seoul cafe, korean food, seoul eats
```

The Store form intentionally hides crawler settings. `Result size` chooses the internal budget, concurrency, checkpoint, and discovery settings for you.

#### Mobile Run Flow

When running from a phone, keep the first pass small:

1. Paste 1-3 keywords into `Keywords`, one per line.
2. Keep `Result size` at `Scout 25 - first low-cost check`.
3. Leave `Aliases` empty, run once, then inspect the `runSummary` row.
4. Add aliases only for weak keywords or noisy candidates, then rerun.

The fastest mobile decision is the final `runSummary`: check total rows, usable media rows, failed rows, target shortages, and top candidates before opening the full JSON export.

```json
{
  "keywords": "karina\nkim chaeyeon\nseoul food",
  "resultSize": "scout25",
  "keywordAliases": ""
}
```

For reusable starting points, see:

- `examples/scout-25-input.json`
- `examples/with-aliases-input.json`
- `examples/scout-100-input.json`
- `examples/debug-aliases-input.json` for internal troubleshooting
- `docs/LAUNCH_CHECKLIST.ko.md`
- `docs/STORE_LISTING_DRAFT.md`
- `docs/CLEAN_DEPLOY.md`

### Interpreting Results

The Actor writes normalized records to the default Apify dataset:

- `search`: keyword discovery summary
- `searchCandidate`: individual candidate URL when `outputSearchCandidates` is enabled
- `post` or `reel`: resolved public media row
- `profile`: direct profile or fallback profile row
- `runSummary`: final counts, shortages, duplicate counts, and keyword quality
- `failed`: unsupported, blocked, or unresolved URL

Important diagnostics:

- `collection.shortage` and `collection.shortageReason`
- `collection.zeroLinkCandidates`
- `collection.failedCandidates`
- `quality.loginWallDetected`
- `usability.usable`
- `keywordRelevance.score`
- `runSummary.searchQuality.successPatterns`

Runs fail intentionally when a target-bearing keyword run produces zero usable media rows. Smaller target shortages stay as partial results. The dataset still includes `search` and `runSummary` rows so the operator can see whether the cause was `NO_DISCOVERED_LINKS`, login-wall blocking, filtering, or another shortage reason.

### Operational Checks

After an Apify run, export the dataset as JSON or JSONL and summarize it locally:

```bash
npm run summarize:dataset -- path\to\dataset-items.json
```

The summary reports row counts, usable media rate, shortage reasons, top scout candidates, and weak keywords. For machine-readable output:

```bash
npm run summarize:dataset -- path\to\dataset-items.json --json
```

Before release:

```bash
npm run verify
npm run check
npm test
npm run build
```

The public Store input intentionally exposes only `keywords`, `resultSize`, and `keywordAliases`. The runtime still accepts advanced JSON fields for internal troubleshooting and backwards compatibility.

Recommended Apify default run options:

- memory: `2048 MB`
- timeout: `1800 seconds`

The last Scout 25 cloud validation peaked near 1 GB of memory, so `1024 MB` is too close for stable Playwright runs. `2048 MB` keeps roughly 2x headroom while avoiding the avoidable compute cost of `4096 MB`. Keep `4096 MB` as the maximum for manual recovery runs, not the default.

### Advanced Batch Guidance

For 300+ item batches, use `resultSize: "advanced300"`. The Actor turns checkpointing on by default for that preset. Treat these as advanced operations, not the default customer path.

```json
{
  "keywords": "karina\nkim chaeyeon\nkian84\nbeauty\nfood\nfashion\nseoul\nkpop\ncafe\nhotel",
  "resultSize": "advanced300",
  "keywordAliases": ""
}
```

### Architecture

```text
src/main.ts
  -> reads Actor input
  -> coordinates keyword discovery, direct targets, checkpointing, and runSummary

src/router.ts
  -> routes profile, post, reel, and generic page requests
  -> writes normalized records to the default dataset

src/extractors/
  -> page extraction only

src/resolvers/
  -> merges meta, embedded payload, visible signals, search discovery, and relevance

src/state/
  -> budget, dedupe, and checkpoint helpers

src/local/
  -> local web UI for manual URL testing
```

### Cost Strategy

The first version uses Apify Dataset and KeyValueStore only. Add external databases, queues, paid proxies, or AI enrichment only after there is evidence that the Actor needs them.

Deferred until demand is proven:

- automatic login/session operation
- private content access
- deep comment collection
- media file downloads
- AI enrichment
- external databases or queues

### Compliance Notes

Use this Actor only for collection that is permitted by applicable law, platform terms, and account permissions. Keep rate limits conservative and avoid collecting private or sensitive personal information unless you have a lawful basis and explicit permission.

# Actor input Schema

## `keywords` (type: `string`):

Use plain names, topics, brands, or places. No JSON is needed for a normal run.

## `resultSize` (type: `string`):

Start with Scout 25 on mobile. Increase only after the first result summary looks useful.

## `keywordAliases` (type: `string`):

Optional. Format: keyword: alias1, alias2. Use stage names, usernames, romanized names, and hashtag variants.

## Actor input object example

```json
{
  "keywords": "karina\nkim chaeyeon\nseoul food",
  "resultSize": "scout25",
  "keywordAliases": ""
}
```

# Actor output Schema

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

Public Instagram search summaries, candidate rows, resolved media rows, run summary rows, and failures.

## `runFiles` (type: `string`):

Default key-value store records such as INPUT and optional run summary files.

# 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": `karina
kim chaeyeon
seoul food`,
    "keywordAliases": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("skcho/instagram-insight-actor").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": """karina
kim chaeyeon
seoul food""",
    "keywordAliases": "",
}

# Run the Actor and wait for it to finish
run = client.actor("skcho/instagram-insight-actor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": "karina\\nkim chaeyeon\\nseoul food",
  "keywordAliases": ""
}' |
apify call skcho/instagram-insight-actor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=skcho/instagram-insight-actor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Keyword Scout",
        "description": "Find public Instagram post/reel candidates from keywords first, with optional aliases for better coverage and explicit shortage diagnostics.",
        "version": "1.1",
        "x-build-id": "IbX6jxx4OPuIAkGXp"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/skcho~instagram-insight-actor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-skcho-instagram-insight-actor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/skcho~instagram-insight-actor/runs": {
            "post": {
                "operationId": "runs-sync-skcho-instagram-insight-actor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/skcho~instagram-insight-actor/run-sync": {
            "post": {
                "operationId": "run-sync-skcho-instagram-insight-actor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "keywords": {
                        "title": "Keywords",
                        "type": "string",
                        "description": "Use plain names, topics, brands, or places. No JSON is needed for a normal run.",
                        "default": "karina\nkim chaeyeon\nseoul food"
                    },
                    "resultSize": {
                        "title": "Result size",
                        "enum": [
                            "scout25",
                            "scout100",
                            "advanced300"
                        ],
                        "type": "string",
                        "description": "Start with Scout 25 on mobile. Increase only after the first result summary looks useful.",
                        "default": "scout25"
                    },
                    "keywordAliases": {
                        "title": "Aliases (optional)",
                        "type": "string",
                        "description": "Optional. Format: keyword: alias1, alias2. Use stage names, usernames, romanized names, and hashtag variants.",
                        "default": ""
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
