# AI Agent Product Intelligence & Web Cleaner (`maybad/ai-agent-product-intelligence`) Actor

Extracts customer complaints, sentiments, and reviews for any product. Cleans web pages into token-optimized Markdown for AI agents.

- **URL**: https://apify.com/maybad/ai-agent-product-intelligence.md
- **Developed by:** [Meshal ALBELADI](https://apify.com/maybad) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## ⚡ AI Agent Product Intelligence & Token-Optimized Web Cleaner

A dual-purpose, high-performance toolkit designed specifically for **AI Agents, LLM pipelines, and automated market research**.

Empower your Autonomous Agents (LangChain, AutoGPT, CrewAI, Claude Desktop, Cursor) with structured product feedback and ultra-compact web data.

***

### 🌟 Core Capabilities

#### 1. Product Mentions & Customer Complaints Intelligence

- **Autonomous Market & Feedback Mining**: Scrapes and aggregates live discussions from multiple verified sources (**Reddit, Hacker News, Tech Publications, GitHub Discussions, Google News**).
- **AI-Ready Sentiment & Urgency Breakdown**: Delivers an overall sentiment score (-1.0 to +1.0) along with positive/negative ratios.
- **Categorized Complaints & Real Quotes**: Extracts concrete pain points with verified user quotes across categories (Performance, Pricing, UX/UI, Features, Reliability).
- **Anti-Hallucination & Zero False Positives**: Built-in negation handling and context disambiguation (e.g. distinguishing praises like "zero bugs" from negative complaints).

#### 2. Token-Optimized Web Cleaner

- **70%–90% Token Reduction**: Strips out cookie banners, navigation menus, ads, headers, footers, tracking scripts, and HTML clutter.
- **Table & Structure Preservation**: Retains tables formatted cleanly in Markdown, preserves relevant hyperlinked context `[text](url)`, and tags code blocks with syntax highlighting.
- **SSRF & Security Protected**: Built-in IP filtering preventing SSRF against private subnets, streaming size limits, and safe parsing.

***

### 🚀 How to Run

#### Example 1: Extract Product Complaints & Mentions (Default)

```json
{
  "action": "mentions",
  "product": "Cursor IDE",
  "timeframe": "90d",
  "max_results": 25
}
```

#### Example 2: Clean a Web Page for AI Agent Context

```json
{
  "action": "clean_url",
  "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
  "preserve_links": true,
  "max_tokens": 4000
}
```

***

### 📊 Output Schema

The actor produces structured JSON saved directly to Apify Dataset:

```json
{
  "product": "Linear",
  "status": "ok",
  "timeframe": "90d",
  "total_mentions_scanned": 21,
  "sources_breakdown": {
    "Hacker News": 5,
    "Reddit": 9,
    "Tech Press": 7
  },
  "sentiment": {
    "score": 0.03,
    "label": "Mixed / Neutral",
    "positive_ratio": "14%",
    "negative_ratio": "5%",
    "neutral_ratio": "81%"
  },
  "top_complaints": [
    {
      "category": "Performance & Stability",
      "frequency": 2,
      "urgency": "medium",
      "quotes": [
        "linear feels slightly heavier after recent updates"
      ]
    }
  ]
}
```

***

### 💳 Pricing (Pay-Per-Event)

- **Pay-Per-Event**: **$0.005** per successful result ($5.00 per 1,000 queries).
- Only charged when data is successfully extracted.

***

### 🤖 Integrate with Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "action": "mentions",
    "product": "Notion",
    "timeframe": "30d"
}

run = client.actor("maybad/ai-agent-product-intelligence").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

# Actor input Schema

## `action` (type: `string`):

Choose which tool to execute

## `product` (type: `string`):

Name of the product or brand (required if action is 'mentions')

## `timeframe` (type: `string`):

Historical range for mentions search

## `max_results` (type: `integer`):

Number of public discussions to scan

## `url` (type: `string`):

Target website URL (required if action is 'clean\_url')

## `raw_html` (type: `string`):

Raw HTML string to clean into Markdown (required if action is 'clean\_html')

## `preserve_links` (type: `boolean`):

Whether to retain markdown links in the cleaned output

## `max_tokens` (type: `integer`):

Maximum token budget for output markdown (optional)

## Actor input object example

```json
{
  "action": "mentions",
  "product": "Cursor IDE",
  "timeframe": "90d",
  "max_results": 25,
  "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
  "preserve_links": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

Primary dataset containing the extracted product mentions, complaints analysis, or cleaned Markdown content.

## `jsonView` (type: `string`):

Direct JSON feed for AI agents and automated pipelines.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("maybad/ai-agent-product-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("maybad/ai-agent-product-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 '{}' |
apify call maybad/ai-agent-product-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,maybad/ai-agent-product-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/j1J03YxLUfTswcK1C/builds/aOArVj6T5bZ5vBupQ/openapi.json
