# Apple App Store Reviews Scraper (`imranibrahim/ai-review-insight-extractor`) Actor

Scrapes public Apple App Store reviews and turns them into AI-powered insights. Outputs top complaints, most loved features, feature requests, sentiment score, marketing angles, and improvement ideas. Built for SaaS founders, product managers, marketers, and agencies.

- **URL**: https://apify.com/imranibrahim/ai-review-insight-extractor.md
- **Developed by:** [Imran Ibrahim](https://apify.com/imranibrahim) (community)
- **Categories:** Agents, Integrations, Automation
- **Features:** Limited permissions
- **Stats:** 14 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 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 Review Insight Extractor (App Store)

Apify Actor: paste one or more **App Store** app URLs → get structured insights (liked features, complaints, sentiment, etc.) via **Groq** (Llama). Single-URL and **batch** (multiple URLs) supported; one dataset item per URL; per-URL failures do not stop the run.

**Supported platform:** Apple App Store only. Other URLs return a clear error per URL.

***

### Setup

```bash
npm install
cp .env.example .env
## Edit .env: set GROQ_API_KEY=your_key (required for AI)
```

#### App Store — no API key required

- **Method:** Apple’s public **iTunes RSS feed** for app reviews (no auth).
- **URL must include the app ID:**\
  `https://apps.apple.com/app/app-name/id123456789`\
  or\
  `https://apps.apple.com/us/app/app-name/id123456789`\
  The number after `id` is the app ID; we use it to request the RSS feed.

#### Groq model

The Actor uses **llama-3.1-8b-instant** by default (fast, low cost). To override, set env/secret **`GROQ_MODEL`** (e.g. `llama-3.3-70b-versatile` for higher quality). See [Groq models](https://console.groq.com/docs/models).

**429 / Rate limit:** If you see "Groq rate limit exceeded", check your [Groq rate limits](https://console.groq.com/docs/rate-limits). The Actor retries once after 10s on 429.

***

### Run locally

```bash
## App Store (URL must contain /id123456789/)
node src/main.js "https://apps.apple.com/app/notion/id1232783681"

## Or use env for single URL
INPUT_URL="https://apps.apple.com/app/your-app/id123456789" INPUT_MAX_REVIEWS=40 node src/main.js
```

***

### Deploy to Apify

#### 1. Apify CLI

```bash
npm install -g apify-cli
apify login
apify push
```

#### 2. Set secrets

In [Apify Console](https://console.apify.com/) → your Actor → **Settings** → **Environment variables / Secrets**:

- Add **`GROQ_API_KEY`** (as a **secret** or environment variable) with your [Groq API key](https://console.groq.com/keys). Apify injects it as `process.env.GROQ_API_KEY` at run time.

#### 3. Run on Apify

- **Input:** Single URL: `{ "url": "https://apps.apple.com/app/.../id123456789", "maxReviews": 80 }`.\
  Batch: `{ "urls": ["https://.../id1", "https://.../id2"], "maxReviews": 80 }`.\
  Provide `url` (string) or `urls` (array); invalid URLs are skipped and duplicates removed. `maxReviews` applies per URL (default 80, max 150).
- **Output:** One dataset item per URL (insights or structured error). Failures for one URL do not stop the run.

#### 4. GitHub (optional)

Connect your repo in Apify Console → Actor → **Source** → **Git**. See [Apify deployment docs](https://docs.apify.com/platform/actors/development/deployment).

***

### Monetization (pay per event)

The Actor charges **one event per successful URL** (`insight-generated`). Each output item includes `billingUnits: 1` and `billingEvent: "insight-generated"`. Failed URLs do not trigger a charge.

To enable pricing:

1. In Apify Console → Actor → **Publication** → **Monetization**, choose **Pay per event (PPE)**.
2. Add event **`insight-generated`** and set a price (e.g. $5 per 1,000 events = $0.005 per run).
3. See **[PRICING.md](./PRICING.md)** for full setup and recommended pricing.

***

### Structure

- `src/main.js` — entry, orchestration, Actor.init + logging
- `src/logger.js` — logging (Actor.log on Apify, console locally)
- `src/platforms.js` — App Store URL helpers (app ID, RSS URL)
- `src/reviewScraper.js` — App Store (iTunes RSS)
- `src/ai.js` — Groq (Llama), JSON-only
- `src/utils.js` — chunking (30), merge + dedup (top 5–8 per category)
- `.actor/actor.json` — Actor metadata and input schema path
- `.actor/INPUT_SCHEMA.json` — input: `url` (single) or `urls` (array), `maxReviews` (optional, per URL)

See `prd.md` for full requirements.

# Actor input Schema

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

Single App Store app URL (must contain /id123456789/). Ignored if urls is provided.

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

Array of App Store app URLs. Duplicates and invalid URLs are skipped. One item per URL in the dataset.

## `maxReviews` (type: `integer`):

Maximum review texts to fetch and analyze per URL (default 80, max 150). Applies to each URL in batch.

## Actor input object example

```json
{
  "url": "https://apps.apple.com/app/notion/id1232783681",
  "urls": [
    "https://apps.apple.com/app/notion/id1232783681"
  ],
  "maxReviews": 80
}
```

# Actor output Schema

## `insights` (type: `string`):

Dataset containing the generated insights object for the scraped app.

# 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 = {
    "url": "https://apps.apple.com/app/notion/id1232783681",
    "urls": [
        "https://apps.apple.com/app/notion/id1232783681"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("imranibrahim/ai-review-insight-extractor").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 = {
    "url": "https://apps.apple.com/app/notion/id1232783681",
    "urls": ["https://apps.apple.com/app/notion/id1232783681"],
}

# Run the Actor and wait for it to finish
run = client.actor("imranibrahim/ai-review-insight-extractor").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 '{
  "url": "https://apps.apple.com/app/notion/id1232783681",
  "urls": [
    "https://apps.apple.com/app/notion/id1232783681"
  ]
}' |
apify call imranibrahim/ai-review-insight-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,imranibrahim/ai-review-insight-extractor"
        }
    }
}
```

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/1P7giwMPZNLHaNeU5/builds/J5BFsx97fd4f0tbR0/openapi.json
