# Market Gap Analyzer ($0.79/analysis) (`openfrontier_ai/market-gap-analyzer`) Actor

An AI agent that uncovers growth opportunities by mining competitor weaknesses. It crawls Reddit and Trustpilot to find real user complaints, then uses agentic reasoning to turn that "negative sentiment" into a prioritized product roadmap and sales battlecards.

- **URL**: https://apify.com/openfrontier\_ai/market-gap-analyzer.md
- **Developed by:** [OpenFrontier AI](https://apify.com/openfrontier_ai) (community)
- **Categories:** AI, Lead generation, Automation
- **Stats:** 5 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per event

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?

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

## 🚀 Market Gap Analyzer: AI Strategic Intelligence Agent

The **Market Gap Analyzer** is a high-performance AI Agent built on the [Apify platform](https://apify.com). It doesn't just scrape data; it **investigates** your competition. By combining real-time web crawling with "Negative Sentiment Mining" on Reddit and Trustpilot, it identifies exactly where your competitors are failing and tells you what to build next.

***

### 🧠 The Agentic Philosophy

Unlike standard scrapers that return raw JSON, this agent uses a **ToolLoopAgent** (Vercel AI SDK) to reason through the data. It autonomously:

1. **Audits your product** to establish a baseline.
2. **Generates aggressive search queries** (e.g., "why I stopped using \[Competitor]") to find high-churn discussions.
3. **Outsources heavy lifting** to specialized Apify Actors for Reddit and Trustpilot to bypass anti-bot walls.
4. **Prunes and Ranks** results to ensure only the most impactful community feedback is processed by the LLM.

***

### ✨ Key Features

- **Negative Sentiment Mining:** Specifically targets "Real Talk" on Reddit to find complaints that don't appear in polished marketing materials.
- **Hybrid Scraping Logic:** Uses a stealth `PlaywrightCrawler` for landing pages and specialized Sub-Actors for high-security sites (G2/Trustpilot).
- **Context-Aware Pruning:** Automatically filters and sorts hundreds of reviews by upvotes/impact to prevent `context_length_exceeded` errors while maintaining high-quality output.
- **Actionable Roadmaps:** Outputs a prioritized P0/P1/P2 feature list and a "Sales Kill-Shot" to help you win more deals.

***

### 📥 Input Configuration

| Field | Type | Description |
| --- | --- | --- |
| `myProductUrl` | String | Your SaaS/Product landing page or review profile. |
| `competitorUrls` | Array | List of competitor domains or review pages. |
| `modelProvider` | String | `openai` or `google`. |

Here are the added sections for your **README.md**. These provide the technical transparency users need for the output and the "secret sauce" tips to get the highest ROI from the agent.

***

### 📤 Output Configuration

The agent stores its findings in the **Apify Dataset**. Each run generates a structured JSON object containing the strategic report. You can export this as a **JSON, CSV, or Excel** file, or view the formatted Markdown directly in the Apify UI.

| Field | Type | Description |
| --- | --- | --- |
| `marketIntelligenceReport` | String (Markdown) | The primary output. Includes Internal Audit, Competitor Comparison, Gaps, P0-P2 Roadmap, and Sales Kill-Shot. |
| `timestamp` | String | ISO 8601 timestamp of when the analysis was performed. |
| `sources` | Array | List of platforms successfully mined (e.g., `["Reddit", "Trustpilot", "Web"]`). |

***

### 💡 Pro-Tips for Maximum Intelligence

To get the most out of the **Market Gap Analyzer**, follow these strategic guidelines:

#### 1. Target the "Churn Clusters"

When providing `competitorUrls`, prioritize competitors that have a large, vocal user base. The more "Reddit noise" there is, the better the agent can identify high-impact feature gaps.

#### 2. Use "Vibe-Check" URLS

Instead of just providing a homepage (e.g., `https://competitor.com`), try providing their **Trustpilot profile URL** or a specific **pricing page**. This helps the internal `scrapeProduct` tool focus immediately on where users feel the most "pain" (the wallet).

#### 3. Lean on `gpt-4o-mini` for Speed, `gpt-4o` for Depth

- **For quick daily monitoring:** Use `gpt-4o-mini`. It is incredibly fast and handles the "pruned" data perfectly.
- **For board-level strategy:** Switch to `gpt-4o` (or `claude-3-5-sonnet`). The reasoning capabilities are superior when connecting dots between complex technical complaints on Reddit.

#### 4. Mind the "Product Name" Input

If your product is new or has a generic name (e.g., "Flow"), make sure to include the `productName` in the input if available. This prevents the Reddit scraper from bringing in irrelevant data about "water flow" or "yoga flow" and keeps the focus on your SaaS.

#### 5. Review the "Pruned" Dataset

If you notice the agent missed a specific complaint, check the logs. The agent sorts by **Upvotes/Impact**. If a complaint is valid but has zero engagement on Reddit, the agent may prune it to save context window space.

# Actor input Schema

## `myProductUrl` (type: `string`):

The URL of your own product page or review profile (G2, Trustpilot, etc.) to establish a baseline.

## `competitorUrls` (type: `array`):

List of competitor review pages or websites you want the agent to audit.

## `modelProvider` (type: `string`):

Gemini 2.0 Flash is ultra-fast for quick scans. OpenAI GPT-4o is superior for nuanced 'Feature Arbitrage' reasoning.

## Actor input object example

```json
{
  "myProductUrl": "https://www.g2.com/products/your-saas-name/reviews",
  "competitorUrls": [
    "https://www.g2.com/products/competitor-one/reviews"
  ],
  "modelProvider": "google"
}
```

# 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 = {
    "myProductUrl": "https://www.g2.com/products/your-saas-name/reviews",
    "competitorUrls": [
        "https://www.g2.com/products/competitor-one/reviews"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("openfrontier_ai/market-gap-analyzer").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 = {
    "myProductUrl": "https://www.g2.com/products/your-saas-name/reviews",
    "competitorUrls": ["https://www.g2.com/products/competitor-one/reviews"],
}

# Run the Actor and wait for it to finish
run = client.actor("openfrontier_ai/market-gap-analyzer").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 '{
  "myProductUrl": "https://www.g2.com/products/your-saas-name/reviews",
  "competitorUrls": [
    "https://www.g2.com/products/competitor-one/reviews"
  ]
}' |
apify call openfrontier_ai/market-gap-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,openfrontier_ai/market-gap-analyzer"
        }
    }
}

```

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/Btc5fnWgMNRTuMH8F/builds/o9T6ej8fWS0XrCTWQ/openapi.json
