# AI Data Enricher — Add AI Columns to Any Dataset (`istmobot/ai-data-enricher`) Actor

Add AI columns to any Apify dataset, CSV or JSON file: classify, extract, score, summarize or translate every row. Input: a dataset ID, a file URL or inline rows, one instruction and the output fields you define. Output: each row plus your new fields, with fixed names and types.

- **URL**: https://apify.com/istmobot/ai-data-enricher.md
- **Developed by:** [Istmobot](https://apify.com/istmobot) (community)
- **Categories:** AI, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 row enricheds

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?

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 Data Enricher — Add AI Columns to Any Dataset

Give it rows and one instruction, and get the same rows back with **new AI columns that you define**: a sentiment, a category, a score, a yes/no flag, a short summary, a list of things mentioned. It reads an **Apify dataset** (for example the output of a scraper), a **CSV, JSON or JSONL file**, or rows you paste. No scraping, no prompt engineering, no API key.

### What is AI Data Enricher?

It runs your instruction over every row, one row at a time, and adds the fields you asked for. Each field has a fixed name and type, so the result is a clean table and not free text you have to parse again.

Typical uses:

- **Classify**: sentiment of reviews, topic of support tickets, industry of a company description, intent of a search query.
- **Extract**: order numbers, product names, prices or complaints buried in free text.
- **Score**: lead quality from 1 to 10, how urgent a ticket is, how relevant an article is to your topic.
- **Summarize and normalize**: a one-line summary of a long description, a job title mapped to a seniority level, messy categories mapped to your own list.
- **Translate short texts**: titles, short reviews, product names.

What it does **not** do:

- It does not browse the web or look anything up. The AI sees only the row you send.
- It does not compare rows with each other (no deduplication, clustering or totals). Each row is answered on its own.
- It does not write long texts. The answer for one row is limited to about 200 words in total (see the FAQ).
- It does not read Excel, Google Sheets or PDF files. Export them as CSV first.
- You cannot choose the AI model. It uses Anthropic's Claude Haiku.

### What data can I get?

Every output row has your original fields plus the fields you defined in `outputFields`.

| Field type | What you get | When the row does not contain it |
|---|---|---|
| `text` | A short text | `null` |
| `number` | A number | `null` |
| `boolean` | `true` or `false` | `null` |
| `category` | One of the `options` you listed | `null` |
| `list` | An array of short texts | `[]` (empty list) |

The AI is told to answer `null` (or an empty list) instead of guessing when the row gives no basis for a field. All your fields are present in every enriched row.

Other fields:

| Field | Meaning |
|---|---|
| your original fields | Kept as they are when `keepOriginalFields` is on (the default) |
| `ai_<name>` | Your field, when the row already had a field with that name. Nothing is overwritten |
| `rowIndex` | Only when `keepOriginalFields` is off: the row's position in the data, starting at 0 |
| `aiError` | Only on rows the AI did not answer. These rows are free |

Rows come back in the same order as the input.

### How much does it cost?

Pay-per-event pricing. The AI is included: you need no OpenAI or Anthropic key and there is no separate bill for the model.

| Event | Price |
|---|---|
| Actor start | $0.005 per run |
| `row-enriched` | $0.003 per row returned with its AI fields |

That is **$3 per 1,000 rows** on the Free and Bronze plans, $2.70 on Silver and $2.40 on Gold and above. Example: 10,000 reviews classified and summarized cost about **$30**.

Rows that come back with `aiError` are **never charged**. A run that stops on an input mistake (no data source, a bad field name) makes no AI call and is charged only the start event. Set a **maximum cost per run** and the Actor stops cleanly when it is reached.

On the Apify free plan, the AI enriches the first 5 rows of each run as a sample. The other rows are not processed.

### How to use AI Data Enricher

1. Click **Try for free**. The input comes pre-filled with five sample reviews, an instruction and two output fields, so the first run works as it is.
2. Choose your data: pick an **Apify dataset**, paste a **file URL**, or paste **rows as JSON**. Use exactly one, and clear the sample rows when you use a dataset or a file.
3. Write the **instruction**: what the AI should do with each row.
4. Define the **output fields**: a name, a type and, if it helps, a short description.
5. Try it on a few rows first (`maxItems` 10), check the answers, then run the whole set.
6. Download the dataset as JSON, CSV or Excel, or read it through the API.

Tips for good answers:

- Say exactly what you want in the field `description`: "from 1 (calm) to 5 (furious)", "in at most 8 words", "as YYYY-MM-DD".
- Send only the fields the task needs with `inputFields`. Less noise, better answers, and long rows stay under the character limit.
- For a `category`, list every option you accept. Add an option such as `other` if not every row will fit your list.

#### Enrich every new scraper run

The usual recurring setup is a scraper on a schedule, followed by this Actor on the scraper's dataset. Each scraper run has its own dataset, so there is nothing to skip:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")

## 1. Any Actor that produces rows, on your schedule
scrape = client.actor("username/some-reviews-scraper").call(run_input={"startUrls": [{"url": "https://example.com/product/123"}]})

## 2. Add AI columns to what it found
enrich = client.actor("istmobot/ai-data-enricher").call(run_input={
    "datasetId": scrape["defaultDatasetId"],
    "inputFields": ["text", "stars"],
    "instruction": "Classify the sentiment of the review and name the main complaint in at most 8 words.",
    "outputFields": [
        {"name": "sentiment", "type": "category", "options": ["positive", "neutral", "negative"]},
        {"name": "mainComplaint", "type": "text"},
    ],
    "maxItems": 1000,
})
for row in client.dataset(enrich["defaultDatasetId"]).iterate_items():
    print(row["sentiment"], row["mainComplaint"])
```

Run this script from your own scheduler, as often as you scrape.

### ⬇️ Input

```json
{
    "datasetId": "aBcD1234efGH5678ij",
    "inputFields": ["subject", "message"],
    "instruction": "Triage this customer support ticket.",
    "outputFields": [
        { "name": "topic", "type": "category", "options": ["billing", "shipping", "product_defect", "account", "other"], "description": "What the ticket is about" },
        { "name": "urgent", "type": "boolean", "description": "true when the customer needs an answer today" },
        { "name": "frustration", "type": "number", "description": "How upset the customer sounds, from 1 (calm) to 5 (furious)" },
        { "name": "orderNumber", "type": "text", "description": "The order number the customer mentions" },
        { "name": "productsMentioned", "type": "list", "description": "Products named in the ticket" }
    ],
    "maxItems": 500
}
```

| Field | Default | Description |
|---|---|---|
| `datasetId` | | An Apify dataset: its ID, or `username~dataset-name`. The Actor only reads it |
| `fileUrl` | | Public link to a CSV, JSON or JSONL file, UTF-8, up to 10 MB |
| `items` | | Rows as a JSON array of objects. A list of plain texts also works: each becomes `{ "value": "…" }` |
| `instruction` | required | What the AI should do with each row. Up to 1,500 characters |
| `outputFields` | required | 1 to 12 fields: `name`, `type` (`text`, `number`, `boolean`, `list`, `category`), optional `description`, and `options` for a category. Up to 3,000 characters as JSON |
| `inputFields` | all fields | Names of the row fields the AI reads, in the order you list them |
| `maxItems` | `100` | Stop after this many rows |
| `offset` | `0` | Skip this many rows at the start |
| `maxInputCharsPerRow` | `6000` | The AI reads each row as compact JSON. Longer rows are cut to this length. Maximum 12,000. Chinese, Japanese and Korean characters count as 3.5 each |
| `keepOriginalFields` | `true` | Off: the output has only `rowIndex` and your fields |

Use **exactly one** of `datasetId`, `fileUrl` and `items`. None or several is an input error, and the run stops before any AI call.

File formats, detected from the content:

- **CSV**: a header row is required. Comma, semicolon or tab separated; quoted cells may contain separators and line breaks. Every value is read as text. A column with no header is named `column_3`, a repeated header `name_2`.
- **JSON**: an array of objects. A single object is read as one row.
- **JSONL**: one JSON object per line.

Two small sample files to try: [sample-reviews.csv](https://api.apify.com/v2/key-value-stores/OziBEHUUZ9zWdDSHY/records/sample-reviews.csv) and [sample-tickets.jsonl](https://api.apify.com/v2/key-value-stores/OziBEHUUZ9zWdDSHY/records/sample-tickets.jsonl).

Field names must be simple identifiers: letters, digits and `_`, not starting with a digit, at most 40 characters. The name `aiError` is reserved.

### ⬆️ Output

One row from a real run with the instruction and the five output fields above:

```json
{
    "ticketId": "T-2005",
    "subject": "Broken screen",
    "message": "The tablet arrived with a cracked screen, order 51877. I want a replacement or my money back.",
    "topic": "product_defect",
    "urgent": false,
    "frustration": 3,
    "orderNumber": "51877",
    "productsMentioned": ["tablet"]
}
```

A ticket with no order number and no product, from the same run:

```json
{
    "ticketId": "T-2004",
    "subject": "Cannot log in",
    "message": "The password reset email never arrives. This is the third time I write. I need to get in today to download an invoice.",
    "topic": "account",
    "urgent": true,
    "frustration": 4,
    "orderNumber": null,
    "productsMentioned": []
}
```

The pre-filled example (five product reviews, two fields) returned:

| review | sentiment | mainComplaint |
|---|---|---|
| Great sound for the price and the battery lasts two full days. Pairing took seconds. | positive | `null` |
| The left earbud stopped charging after three weeks. Support has not answered my emails. | negative | Left earbud stopped charging after three weeks |
| Sturdy and easy to assemble. The motor is a bit loud when the desk goes up. | positive | Motor is a bit loud when rising |
| Arrived with a scratched top and two screws missing. I am sending it back. | negative | Arrived scratched with two screws missing |
| Grinds evenly, but cleaning it is a chore and the lid feels flimsy. | neutral | Difficult to clean and flimsy lid |

With `keepOriginalFields` off, a row looks like this:

```json
{ "rowIndex": 1, "topic": "shipping", "urgent": true }
```

### Error items

A row the AI did not answer keeps its place in the output and gets an `aiError` field instead of your fields. It is not charged.

```json
{
    "id": 1,
    "review": "",
    "aiError": "No data to send: the row is empty or has none of the input fields. Not charged."
}
```

| `aiError` starts with | Meaning |
|---|---|
| `No data to send` | The row is empty, or none of your `inputFields` has a value in it. No AI call was made |
| `The AI could not answer this row` | The AI call failed. Most often the answer was longer than the output limit: ask for shorter or fewer fields |

If the AI answers none of three or more rows in a row, the run stops early instead of working through the rest, and the status message says why.

Input mistakes do not produce rows. The run fails at once with a message such as:

- `No data source. Set exactly one of: "datasetId" (an Apify dataset), "fileUrl" (a link to a CSV, JSON or JSONL file) or "items" (rows as a JSON array).`
- `2 data sources are set (datasetId, items), but the Actor reads exactly one.`
- `outputFields[0]: "name" is "main complaint", but it must be a simple identifier …`

### Integrations & API

```bash
curl -X POST "https://api.apify.com/v2/acts/istmobot~ai-data-enricher/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [{"review": "The left earbud stopped charging after three weeks."}],
    "instruction": "Classify the sentiment of the review.",
    "outputFields": [{"name": "sentiment", "type": "category", "options": ["positive", "neutral", "negative"]}]
  }'
```

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('istmobot/ai-data-enricher').call({
    fileUrl: 'https://api.apify.com/v2/key-value-stores/OziBEHUUZ9zWdDSHY/records/sample-reviews.csv',
    instruction: 'Classify the sentiment of the review and name the main complaint in at most 8 words.',
    outputFields: [
        { name: 'sentiment', type: 'category', options: ['positive', 'neutral', 'negative'] },
        { name: 'mainComplaint', type: 'text' },
    ],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

A Python example is in "Enrich every new scraper run" above. The Actor also works with Make, Zapier and n8n through the Apify apps: start it with a dataset ID or a file link, and read the enriched rows from its dataset.

### 🤖 Use with AI agents (MCP)

Add the Actor to any MCP client with `https://mcp.apify.com?tools=istmobot/ai-data-enricher`. Example prompt: "Take dataset aBcD1234efGH5678ij, classify each review as positive, neutral or negative, and add the main complaint in a few words."

### Want data to enrich?

These Actors from the same author produce rows that are worth enriching:

- [App Store & Google Play Reviews Scraper](https://apify.com/istmobot/app-reviews-scraper): app reviews to classify by topic and sentiment.
- [Tripadvisor Reviews Scraper](https://apify.com/istmobot/tripadvisor-reviews-cheap) and [Booking.com Reviews Scraper](https://apify.com/istmobot/booking-reviews-cheap): hotel and restaurant reviews.
- [Reddit Scraper](https://apify.com/istmobot/reddit-scraper-cheap): posts and comments to tag, score or summarize.
- [Google News Scraper](https://apify.com/istmobot/google-news-scraper): articles to rate for relevance to your topic.
- [Document to JSON](https://apify.com/istmobot/document-to-json): turn PDFs and scans into rows first.
- [Bulk Text Translator](https://apify.com/istmobot/bulk-text-translator): translates texts and whole datasets, for when a translation is longer than this Actor's answer limit.

### ❓ FAQ

**Which AI does it use? Do I need a key?** Anthropic's Claude Haiku. The model is fixed and its cost is included in the price, so you need no key and no account with an AI provider.

**Is the output really the same shape for every row?** Yes. The answer is generated against a JSON schema built from your `outputFields`: every field is present, with the type you chose, and a `category` is one of your options or `null`. The content is still an AI's judgement and can be wrong, so check a sample before you act on thousands of rows.

**How long can a row be?** The AI reads each row as compact JSON, cut to `maxInputCharsPerRow` (6,000 characters by default, 12,000 at most). In a test, a 31,668-character row was cut to 6,000 characters and still answered from its first part; the log lists the positions of the rows that were cut. Chinese, Japanese and Korean characters count as 3.5 characters each toward the limit, because they cost that much more to read: the default reads about 1,700 of them per row. Use `inputFields` to send the important fields first.

**How long can the answers be?** About 200 words for all fields of one row together (400 output tokens). Labels, numbers, flags, short lists and one-line summaries fit easily. Long outputs do not: in a test, translating a 1,200-character review into two languages did not fit, and the row came back with `aiError` (not charged).

**Can it look things up, or use other rows?** No. It has no web access and sees one row at a time.

**What happens when the maximum cost per run is reached?** The run stops cleanly and its status message tells you the offset of the next unread row. Raise the limit and resurrect the run (it continues after the rows already saved), or start a new run with that `offset`.

**Can I run it again on its own output?** Yes. Point `datasetId` at the output dataset of an earlier run to add more fields. Rows keep the fields they have, and an old `aiError` is dropped before the row is tried again.

**What does the free plan get?** The first 5 rows of each run, as a sample. A paid Apify plan processes every row up to `maxItems`.

**Is my data stored?** The Actor sends each row's selected fields to Anthropic's Claude API to get the answer and keeps nothing itself. Results stay in your own Apify dataset under your retention settings. Do not send data you are not allowed to share with a third-party processor.

**Which formats can I export?** The output is a normal Apify dataset: JSON, CSV, Excel, XML and more from the Console or the API.

### Your feedback

Found rows it handles badly, or need a field type or file format that is missing? Open an issue on the Actor's **Issues** tab with a sample row and your instruction.

# Actor input Schema

## `datasetId` (type: `string`):

A dataset from your account, for example the output of a scraper run. Pick it from the list or paste its ID, e.g. "aBcD1234efGH5678ij"; "username~dataset-name" works too. The Actor only reads it. Use exactly one data source: a dataset, a file URL or inline rows.

## `fileUrl` (type: `string`):

Public link to a UTF-8 text file of up to 10 MB, e.g. https://example.com/reviews.csv. CSV needs a header row (comma, semicolon or tab separated). JSON must be an array of objects. JSONL has one object per line. The format is detected from the content.

## `items` (type: `array`):

Rows pasted as a JSON array of objects, e.g. \[{"review":"Great sound"},{"review":"Broke in a week"}]. A list of plain texts also works: each text becomes a row with one field named "value".

## `instruction` (type: `string`):

What the AI should do with each row, in plain words, up to 1,500 characters. E.g. "Classify the sentiment of the review and name the main complaint in at most 8 words." The AI reads one row at a time and answers only from that row.

## `outputFields` (type: `array`):

1 to 12 new fields as a JSON array. Each one has a "name" (letters, digits and \_), a "type" (text, number, boolean, list or category), an optional "description", and "options" when the type is category. E.g. \[{"name":"sentiment","type":"category","options":\["positive","neutral","negative"]},{"name":"score","type":"number","description":"1 to 5"}]. A value the row does not contain comes back as null (an empty list for a list field). The whole answer for a row is limited to about 200 words, so ask for short texts.

## `inputFields` (type: `array`):

Names of the row fields to send to the AI, one per line, e.g. "title" and "text". Leave empty to send every field. Sending only what the task needs gives better answers and keeps long rows under the character limit. Nested objects are sent as compact JSON.

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

Stop after this many rows, e.g. 100. You pay per enriched row.

## `offset` (type: `integer`):

Skip this many rows at the start of the data, e.g. 100 to continue after a first run of 100 rows.

## `maxInputCharsPerRow` (type: `integer`):

The AI reads each row as compact JSON. A row longer than this many characters is cut and the AI reads only the start, e.g. 6000. The hard maximum is 12000. Chinese, Japanese and Korean characters count as 3.5 characters each, because they cost that much more to read. Put the important fields first with "Fields the AI reads".

## `keepOriginalFields` (type: `boolean`):

On: each output row has its original fields plus the new ones, e.g. {"review":"…","sentiment":"negative"}. A new field whose name the row already uses is written as ai\_<name>. Off: only rowIndex (the row's position in the data, starting at 0) and the new fields.

## Actor input object example

```json
{
  "items": [
    {
      "id": 1,
      "product": "Wireless earbuds",
      "rating": 5,
      "review": "Great sound for the price and the battery lasts two full days. Pairing took seconds."
    },
    {
      "id": 2,
      "product": "Wireless earbuds",
      "rating": 2,
      "review": "The left earbud stopped charging after three weeks. Support has not answered my emails."
    },
    {
      "id": 3,
      "product": "Standing desk",
      "rating": 4,
      "review": "Sturdy and easy to assemble. The motor is a bit loud when the desk goes up."
    },
    {
      "id": 4,
      "product": "Standing desk",
      "rating": 1,
      "review": "Arrived with a scratched top and two screws missing. I am sending it back."
    },
    {
      "id": 5,
      "product": "Coffee grinder",
      "rating": 3,
      "review": "Grinds evenly, but cleaning it is a chore and the lid feels flimsy."
    }
  ],
  "instruction": "Classify the sentiment of the review and name the main complaint in at most 8 words.",
  "outputFields": [
    {
      "name": "sentiment",
      "type": "category",
      "options": [
        "positive",
        "neutral",
        "negative"
      ],
      "description": "Overall tone of the review"
    },
    {
      "name": "mainComplaint",
      "type": "text",
      "description": "The main complaint in at most 8 words"
    }
  ],
  "maxItems": 100,
  "offset": 0,
  "maxInputCharsPerRow": 6000,
  "keepOriginalFields": true
}
```

# Actor output Schema

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

No description

# 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 = {
    "items": [
        {
            "id": 1,
            "product": "Wireless earbuds",
            "rating": 5,
            "review": "Great sound for the price and the battery lasts two full days. Pairing took seconds."
        },
        {
            "id": 2,
            "product": "Wireless earbuds",
            "rating": 2,
            "review": "The left earbud stopped charging after three weeks. Support has not answered my emails."
        },
        {
            "id": 3,
            "product": "Standing desk",
            "rating": 4,
            "review": "Sturdy and easy to assemble. The motor is a bit loud when the desk goes up."
        },
        {
            "id": 4,
            "product": "Standing desk",
            "rating": 1,
            "review": "Arrived with a scratched top and two screws missing. I am sending it back."
        },
        {
            "id": 5,
            "product": "Coffee grinder",
            "rating": 3,
            "review": "Grinds evenly, but cleaning it is a chore and the lid feels flimsy."
        }
    ],
    "instruction": "Classify the sentiment of the review and name the main complaint in at most 8 words.",
    "outputFields": [
        {
            "name": "sentiment",
            "type": "category",
            "options": [
                "positive",
                "neutral",
                "negative"
            ],
            "description": "Overall tone of the review"
        },
        {
            "name": "mainComplaint",
            "type": "text",
            "description": "The main complaint in at most 8 words"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("istmobot/ai-data-enricher").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 = {
    "items": [
        {
            "id": 1,
            "product": "Wireless earbuds",
            "rating": 5,
            "review": "Great sound for the price and the battery lasts two full days. Pairing took seconds.",
        },
        {
            "id": 2,
            "product": "Wireless earbuds",
            "rating": 2,
            "review": "The left earbud stopped charging after three weeks. Support has not answered my emails.",
        },
        {
            "id": 3,
            "product": "Standing desk",
            "rating": 4,
            "review": "Sturdy and easy to assemble. The motor is a bit loud when the desk goes up.",
        },
        {
            "id": 4,
            "product": "Standing desk",
            "rating": 1,
            "review": "Arrived with a scratched top and two screws missing. I am sending it back.",
        },
        {
            "id": 5,
            "product": "Coffee grinder",
            "rating": 3,
            "review": "Grinds evenly, but cleaning it is a chore and the lid feels flimsy.",
        },
    ],
    "instruction": "Classify the sentiment of the review and name the main complaint in at most 8 words.",
    "outputFields": [
        {
            "name": "sentiment",
            "type": "category",
            "options": [
                "positive",
                "neutral",
                "negative",
            ],
            "description": "Overall tone of the review",
        },
        {
            "name": "mainComplaint",
            "type": "text",
            "description": "The main complaint in at most 8 words",
        },
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("istmobot/ai-data-enricher").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 '{
  "items": [
    {
      "id": 1,
      "product": "Wireless earbuds",
      "rating": 5,
      "review": "Great sound for the price and the battery lasts two full days. Pairing took seconds."
    },
    {
      "id": 2,
      "product": "Wireless earbuds",
      "rating": 2,
      "review": "The left earbud stopped charging after three weeks. Support has not answered my emails."
    },
    {
      "id": 3,
      "product": "Standing desk",
      "rating": 4,
      "review": "Sturdy and easy to assemble. The motor is a bit loud when the desk goes up."
    },
    {
      "id": 4,
      "product": "Standing desk",
      "rating": 1,
      "review": "Arrived with a scratched top and two screws missing. I am sending it back."
    },
    {
      "id": 5,
      "product": "Coffee grinder",
      "rating": 3,
      "review": "Grinds evenly, but cleaning it is a chore and the lid feels flimsy."
    }
  ],
  "instruction": "Classify the sentiment of the review and name the main complaint in at most 8 words.",
  "outputFields": [
    {
      "name": "sentiment",
      "type": "category",
      "options": [
        "positive",
        "neutral",
        "negative"
      ],
      "description": "Overall tone of the review"
    },
    {
      "name": "mainComplaint",
      "type": "text",
      "description": "The main complaint in at most 8 words"
    }
  ]
}' |
apify call istmobot/ai-data-enricher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,istmobot/ai-data-enricher"
        }
    }
}
```

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/04Xf2ee5Cv0JSMZbL/builds/vpUnrDe0Pnj5LCSbe/openapi.json
