# Instagram Content Gap & Creative Momentum Intelligence (`quanmatrix/instagram-content-competitive-gap-intelligence`) Actor

Analyze Instagram posts and Reels for creative momentum, hook themes, engagement velocity, content gaps and competitor changes instead of stopping at raw extraction.

- **URL**: https://apify.com/quanmatrix/instagram-content-competitive-gap-intelligence.md
- **Developed by:** [Rafael Barreto Haddad](https://apify.com/quanmatrix) (community)
- **Categories:** Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.45 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Content Gap & Creative Momentum Intelligence

Analyze Instagram posts and Reels for creative momentum, hook themes, engagement velocity, content gaps and competitor changes instead of stopping at raw extraction.

### Why use this Actor

Content exports contain metrics but marketing teams still have to determine which formats and themes are accelerating and what competitors are leaving uncovered. This Actor converts structured source data into a decision-ready result so recurring workflows do not need a separate manual analysis step. It supports repeatable monitoring, scheduled execution, dashboards, and agent workflows. Scores are deterministic and traceable to observable input fields.

### Key features

- Unified post/Reel input from JSON, Dataset or public URLs when available.
- Creative momentum score combining reach, engagement and recency signals.
- Deterministic theme and keyword extraction for content-gap discovery.
- Current-vs-previous snapshot deltas for rising and decaying creatives.
- Agent-ready SCALE/TEST/REFRESH/RETIRE recommendations.
- Structured Dataset output for API, Task, schedule, and agent use.
- Current-versus-previous snapshot analysis when prior records are supplied.
- Limited-permission, data-first execution design.

### Input

The JSON input schema includes explicit fields and prefilled examples. Important fields include `currentItems`, `currentDatasetId`, `previousItems`, `previousDatasetId`, `queries`, `urls`, `directFetch`, `language`, `countryCode`, `maxResults`, `maxItems`. Inline records are convenient for small tests. Dataset identifiers are better for recurring pipelines because one Actor can consume the structured output of another without copying rows manually. Stable entity identifiers improve snapshot comparison.

### Output

Results are written to the default Apify Dataset as structured JSON. Output fields include `ok`, `sourceType`, `analysisKind`, `entityId`, `signalScore`, `changeScore`, `agentAction`, `agentReason`, `metrics`, `changes`, `observedAt`, `source`. These fields are designed for dashboards, databases, automation tools, and downstream Actors. Decision fields summarize observable evidence instead of returning only a large unranked export.

### Example

Run the prefilled example once in the Apify Console. For a recurring workflow, save the current Dataset or upstream Dataset ID and provide a later snapshot on the next run. Compare the emitted scores, changes, and action fields. Through API or public Tasks, keep the same field mapping between runs so time-series comparisons remain meaningful.

### Use cases

- recurring competitive monitoring.
- AI-agent and automation workflows.
- market research and prospect prioritization.
- period-over-period change detection.
- Scheduled daily or weekly monitoring with repeatable decision logic.
- Agent workflows that need compact actions rather than raw rows.
- Research pipelines that need stable JSON and traceable signals.

### Pricing

The Actor uses pay-per-event pricing with one primary measurable result. The base design price is USD 0.0035 per primary result before Apify tier discounts. There is no mandatory external AI subscription in the deterministic scoring path. Platform usage varies with run duration, memory, and data volume. The release gate checks margin from real validation costs before publication.

### Limitations

- Only public or appropriately licensed data should be supplied or fetched.
- Instagram and TikTok direct public-URL mode is best-effort; Dataset input is the stable mode when those sites block anonymous requests.
- Signals are deterministic decision support, not guarantees.
- Public-source availability and upstream schemas can change over time.
- Missing source fields can reduce the strength of a score or comparison.
- Decision scores are prioritization signals, not promises of commercial or operational outcomes.
- Users remain responsible for source access rules and platform terms.

### Operational notes

For production use, prefer scheduled runs with stable input definitions. Review the Dataset after the first production run before connecting downstream systems. Preserve raw snapshots when a source changes schema so transformations remain auditable. Market evidence and competitor capabilities are rechecked before publication because Store conditions can change.

### Gen2 decision intelligence

This Actor preserves its original analysis and adds a decision layer with baseline awareness, regression detection, confidence, GO/WARN/BLOCK executive output, and an optional economic-impact estimate. Economic estimates are produced only when the user supplies `valuePerImpactUnitUsd`; the result states the calculation basis instead of inventing monetary value.

# Actor input Schema

## `currentItems` (type: `array`):

Optional current source rows. If supplied, these are analyzed directly and no source fetch is required.

## `currentDatasetId` (type: `string`):

Optional current Dataset from an upstream extraction workflow.

## `previousItems` (type: `array`):

Optional previous rows for deterministic change intelligence.

## `previousDatasetId` (type: `string`):

Optional prior Dataset for recurring comparisons.

## `queries` (type: `array`):

Direct-source queries for Google Maps or Google Search modes.

## `urls` (type: `array`):

Direct public URLs for web or social best-effort modes.

## `directFetch` (type: `boolean`):

Enable direct-source retrieval only when inline rows and Dataset input are not supplied.

## `language` (type: `string`):

Language code used by supported direct-source retrieval modes.

## `countryCode` (type: `string`):

Two-letter country code used to localize supported search-source modes.

## `maxResults` (type: `integer`):

Maximum number of direct-source results requested per query or URL batch.

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

Maximum number of records analyzed and written to the output Dataset.

## `valuePerImpactUnitUsd` (type: `number`):

Optional user-supplied USD value per detected impact unit. Used only for transparent economic impact estimates.

## `monthlyRuns` (type: `integer`):

Optional number of comparable monthly runs used with value per impact unit for the economic estimate.

## `previousAnalysis` (type: `object`):

Optional previous Gen2 output used to compare decision metrics and detect regression between analyses.

## Actor input object example

```json
{
  "currentItems": [
    {
      "id": "p1",
      "username": "brandA",
      "caption": "5 quick running recovery tips",
      "likesCount": 9200,
      "commentsCount": 430,
      "videoViewCount": 182000,
      "timestamp": "2026-09-09T12:00:00Z",
      "type": "Reel"
    },
    {
      "id": "p2",
      "username": "brandB",
      "caption": "new trail shoe launch review",
      "likesCount": 4100,
      "commentsCount": 190,
      "videoViewCount": 65000,
      "timestamp": "2026-09-08T12:00:00Z",
      "type": "Reel"
    }
  ],
  "previousItems": [
    {
      "id": "p1",
      "username": "brandA",
      "caption": "5 quick running recovery tips",
      "likesCount": 6100,
      "commentsCount": 270,
      "videoViewCount": 105000,
      "timestamp": "2026-09-09T12:00:00Z",
      "type": "Reel"
    }
  ],
  "queries": [],
  "urls": [],
  "directFetch": true,
  "language": "en",
  "countryCode": "us",
  "maxResults": 20,
  "maxItems": 20000,
  "monthlyRuns": 1,
  "previousAnalysis": {}
}
```

# Actor output Schema

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

Normalized and scored result rows.

## `report` (type: `string`):

Aggregate report.

# 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 = {
    "currentItems": [
        {
            "id": "p1",
            "username": "brandA",
            "caption": "5 quick running recovery tips",
            "likesCount": 9200,
            "commentsCount": 430,
            "videoViewCount": 182000,
            "timestamp": "2026-09-09T12:00:00Z",
            "type": "Reel"
        },
        {
            "id": "p2",
            "username": "brandB",
            "caption": "new trail shoe launch review",
            "likesCount": 4100,
            "commentsCount": 190,
            "videoViewCount": 65000,
            "timestamp": "2026-09-08T12:00:00Z",
            "type": "Reel"
        }
    ],
    "previousItems": [
        {
            "id": "p1",
            "username": "brandA",
            "caption": "5 quick running recovery tips",
            "likesCount": 6100,
            "commentsCount": 270,
            "videoViewCount": 105000,
            "timestamp": "2026-09-09T12:00:00Z",
            "type": "Reel"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("quanmatrix/instagram-content-competitive-gap-intelligence").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 = {
    "currentItems": [
        {
            "id": "p1",
            "username": "brandA",
            "caption": "5 quick running recovery tips",
            "likesCount": 9200,
            "commentsCount": 430,
            "videoViewCount": 182000,
            "timestamp": "2026-09-09T12:00:00Z",
            "type": "Reel",
        },
        {
            "id": "p2",
            "username": "brandB",
            "caption": "new trail shoe launch review",
            "likesCount": 4100,
            "commentsCount": 190,
            "videoViewCount": 65000,
            "timestamp": "2026-09-08T12:00:00Z",
            "type": "Reel",
        },
    ],
    "previousItems": [{
            "id": "p1",
            "username": "brandA",
            "caption": "5 quick running recovery tips",
            "likesCount": 6100,
            "commentsCount": 270,
            "videoViewCount": 105000,
            "timestamp": "2026-09-09T12:00:00Z",
            "type": "Reel",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("quanmatrix/instagram-content-competitive-gap-intelligence").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 '{
  "currentItems": [
    {
      "id": "p1",
      "username": "brandA",
      "caption": "5 quick running recovery tips",
      "likesCount": 9200,
      "commentsCount": 430,
      "videoViewCount": 182000,
      "timestamp": "2026-09-09T12:00:00Z",
      "type": "Reel"
    },
    {
      "id": "p2",
      "username": "brandB",
      "caption": "new trail shoe launch review",
      "likesCount": 4100,
      "commentsCount": 190,
      "videoViewCount": 65000,
      "timestamp": "2026-09-08T12:00:00Z",
      "type": "Reel"
    }
  ],
  "previousItems": [
    {
      "id": "p1",
      "username": "brandA",
      "caption": "5 quick running recovery tips",
      "likesCount": 6100,
      "commentsCount": 270,
      "videoViewCount": 105000,
      "timestamp": "2026-09-09T12:00:00Z",
      "type": "Reel"
    }
  ]
}' |
apify call quanmatrix/instagram-content-competitive-gap-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,quanmatrix/instagram-content-competitive-gap-intelligence"
        }
    }
}
```

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/AiiuglgSuA04u9AQ2/builds/P5iNJnTIc05YzdJXc/openapi.json
