# Bulk ChatGPT Alternative for CSV Rows: AI Classify, Tag, Enrich (`bulkleads/ai-for-every-row-csv`) Actor

Run one AI instruction on every row of a CSV, Google Sheet or Apify dataset and get each row back with its own columns plus the AI's: a label from your list, named fields pulled out, or written text. Use {column} names in the instruction. $0.0019 per row; failed and skipped rows are free.

- **URL**: https://apify.com/bulkleads/ai-for-every-row-csv.md
- **Developed by:** [bulkleads](https://apify.com/bulkleads) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.43 / 1,000 rows processed

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/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

**Bulk ChatGPT Alternative for CSV Rows** runs one AI instruction on every row of your table and gives each row back with all its own columns plus what the AI added: a **label from your list** (classify), **named fields pulled out** (extract), or **written text** (write). Give it a CSV file, a Google Sheet, the results of another Apify run, or a JSON list of rows; write the instruction once with `{column}` names where each row's values go; click Start. The model is **gpt-oss-20b**, OpenAI's open-weight model, on our own GPUs, and all of a run's rows are sent at once, so 1,000 rows take about as long as a few. It costs **$0.0019 per row answered**; rows that fail or are skipped are free.

### What can I use AI on every row for?

- **Tag leads and companies**: industry, company type, B2B or B2C, fit for your offer, one label per row from your own list.
- **Clean and enrich a sheet**: pull the city, job title or company out of messy text, split full names, normalize titles, into their own columns.
- **Personalize outreach**: a one-line opener or subject line per lead, from that lead's own columns.
- **Sort text at scale**: reviews by sentiment, support tickets by topic, replies by intent, job posts by seniority.
- **Enrich scraper results**: run it on the dataset of any Apify scraper (Google Maps places, LinkedIn profiles, job posts) and get the AI's columns next to the scraped ones.

### How to run AI on every row

1. Add your rows: a **CSV or Google Sheets link** (shared as "Anyone with the link"), the **rows of another run** (a dataset), or **Rows** as a JSON list such as `[{"company": "Figma", "website": "figma.com"}]`.
2. Write the **Instruction for each row** with column names in curly brackets, for example *Which industry is {company} ({website}) in?* Column names match whatever the case or spacing (`{First Name}` finds `first_name`), and `{address.city}` reads a nested value. With no `{column}` at all, the whole row is added under the instruction.
3. Pick **What comes back**:
   - **Classify**: list the **Labels**, at least two (add *Other* so every row fits). The answer is always exactly one of them.
   - **Extract**: list the **Fields**; each becomes its own column, `null` when the row does not say.
   - **Write**: free text in the **Output column**, for example an opener, a summary or a translation.
4. Click **Start**. Optional: a **System prompt** for every row, **Reasoning effort**, **Temperature** and **Max rows**.

A run takes up to 100,000 rows. A filled-in instruction can be up to 24,000 characters; a row and its answer together must fit the model's 8,192-token window (about 6,000 words).

### What does each row include?

- every column of your row, as it was
- the AI's column: the label or text in the **Output column** (`ai_label` or `ai_text` by default), or one column per extract field
- `ai_status`: `answered` (charged), `failed` (the model gave no answer, or one that was not one of your labels or not valid JSON; free) or `skipped` (every column the instruction uses was empty, or the row was too long; free), with `ai_error` saying why

Rows come back in the same order as your table.

### Output example

```json
{
  "company": "Brex",
  "website": "brex.com",
  "city": "San Francisco",
  "industry": "Fintech",
  "ai_status": "answered"
}
```

### How much does it cost?

**$0.0019 per row answered**, plus a $0.107 start fee per run (it pays for starting the model's GPU server when it is idle), with Store discounts on the higher plans. Failed and skipped rows are free. 1,000 rows cost about $1.90 plus the start fee, so put a whole sheet in one run rather than one row per run. There is no OpenAI or OpenRouter key to bring and no per-token bill on top. Set a maximum cost per run in Apify and the run stops there.

### Which model is it?

**gpt-oss-20b**, OpenAI's open-weight model, served on our own GPUs. It classifies, extracts and writes well, and its reasoning effort can be set per run. It is not ChatGPT itself and has no web access: it answers from the row and what it learned in training, so put the facts it needs (a description, a job post, a website's text) in a column the instruction uses.

### FAQ

**Can I use a Google Sheet?** Yes. Share it as "Anyone with the link can view" and paste its link; the tab in the link is the one read.

**What if a column name in my instruction is wrong?** The run stops before anything is charged and lists your columns.

**Why is the first row of a run sometimes slow?** When nobody has used the model for a while, it loads first (up to a few minutes). After that, all of a run's rows run together.

**Is classify the same every time?** Classify and extract run at temperature 0 unless you set another, so the same row gets the same answer.

**Can I chain it after a scraper?** Yes: pick that run's dataset in **Or the rows of another run**, or call this actor from an Apify integration when the scraper finishes.

### Related actors

Rows to enrich: [B2B Leads Finder](https://apify.com/bulkleads/leads-finder) and [Local Business Leads](https://apify.com/bulkleads/local-business-leads). Prompts without a table, charged per token: [OpenRouter Alternative: Bulk LLM](https://apify.com/bulkleads/openrouter-alternative-bulk-llm). Text of any website for a column: [Website Content Crawler](https://apify.com/bulkleads/website-to-markdown).

# Actor input Schema

## `rows` (type: `array`):

Your table as a JSON list of rows, e.g. \[{"company": "Figma", "website": "figma.com"}]. A plain text line becomes a row with one column, text. Or use a CSV / Google Sheets link or an Apify dataset below (all given are used, in this order).

## `csvUrl` (type: `string`):

A CSV file or a Google Sheet anyone with the link can open (the tab in the link is the one read). The header row names the columns.

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

A dataset from one of your runs, for example leads from Leads Finder or places from a Google Maps scraper.

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

What the AI does with each row. Put a column name in curly brackets where its value goes, e.g. "Write a one-line opener for {first_name} at {company}". With no {column}, the whole row is added under the instruction.

## `mode` (type: `string`):

Classify: one label from your list per row. Extract: the fields you name, each as its own column (JSON). Write: free text, e.g. an opener, a summary or a translation.

## `labels` (type: `array`):

The labels to choose from, one per line, at least two. Add "Other" so every row has one that fits. A row whose answer is not one of them comes back failed, free.

## `fields` (type: `array`):

The fields to pull out of each row, one per line, e.g. city, employees, founded_year. Each becomes its own column; anything the row does not say comes back null.

## `outputColumn` (type: `string`):

The column the label or text goes in (classify and write). Empty: ai_label for classify, ai_text for write.

## `systemPrompt` (type: `string`):

Instructions sent with every row (optional), e.g. "You are a B2B researcher. Never invent facts."

## `reasoning` (type: `string`):

How much the model thinks before answering. Low is fastest and cheapest; high is best for hard rows.

## `temperature` (type: `number`):

Empty: 0 for classify and extract (the same answer each time), 0.7 for write. Higher gives more varied text.

## `maxTokens` (type: `integer`):

The longest answer, in tokens (about 0.75 words each), reasoning included.

## `maxRows` (type: `integer`):

Work on at most this many rows (optional).

## Actor input object example

```json
{
  "rows": [
    {
      "company": "Figma",
      "website": "figma.com",
      "city": "San Francisco"
    },
    {
      "company": "Brex",
      "website": "brex.com",
      "city": "San Francisco"
    },
    {
      "company": "Kith",
      "website": "kithnyc.com",
      "city": "New York"
    },
    {
      "company": "Austin Dental Works",
      "website": "austindentalworks.com",
      "city": "Austin"
    },
    {
      "company": "Ogilvy",
      "website": "ogilvy.com",
      "city": "New York"
    },
    {
      "company": "Warby Parker",
      "website": "warbyparker.com",
      "city": "New York"
    }
  ],
  "instruction": "Which industry is {company} ({website}, based in {city}) in?",
  "mode": "classify",
  "labels": [
    "SaaS",
    "Fintech",
    "E-commerce",
    "Local services",
    "Agency",
    "Other"
  ],
  "outputColumn": "industry",
  "reasoning": "low",
  "maxTokens": 1024
}
```

# 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 = {
    "rows": [
        {
            "company": "Figma",
            "website": "figma.com",
            "city": "San Francisco"
        },
        {
            "company": "Brex",
            "website": "brex.com",
            "city": "San Francisco"
        },
        {
            "company": "Kith",
            "website": "kithnyc.com",
            "city": "New York"
        },
        {
            "company": "Austin Dental Works",
            "website": "austindentalworks.com",
            "city": "Austin"
        },
        {
            "company": "Ogilvy",
            "website": "ogilvy.com",
            "city": "New York"
        },
        {
            "company": "Warby Parker",
            "website": "warbyparker.com",
            "city": "New York"
        }
    ],
    "instruction": "Which industry is {company} ({website}, based in {city}) in?",
    "mode": "classify",
    "labels": [
        "SaaS",
        "Fintech",
        "E-commerce",
        "Local services",
        "Agency",
        "Other"
    ],
    "outputColumn": "industry"
};

// Run the Actor and wait for it to finish
const run = await client.actor("bulkleads/ai-for-every-row-csv").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 = {
    "rows": [
        {
            "company": "Figma",
            "website": "figma.com",
            "city": "San Francisco",
        },
        {
            "company": "Brex",
            "website": "brex.com",
            "city": "San Francisco",
        },
        {
            "company": "Kith",
            "website": "kithnyc.com",
            "city": "New York",
        },
        {
            "company": "Austin Dental Works",
            "website": "austindentalworks.com",
            "city": "Austin",
        },
        {
            "company": "Ogilvy",
            "website": "ogilvy.com",
            "city": "New York",
        },
        {
            "company": "Warby Parker",
            "website": "warbyparker.com",
            "city": "New York",
        },
    ],
    "instruction": "Which industry is {company} ({website}, based in {city}) in?",
    "mode": "classify",
    "labels": [
        "SaaS",
        "Fintech",
        "E-commerce",
        "Local services",
        "Agency",
        "Other",
    ],
    "outputColumn": "industry",
}

# Run the Actor and wait for it to finish
run = client.actor("bulkleads/ai-for-every-row-csv").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 '{
  "rows": [
    {
      "company": "Figma",
      "website": "figma.com",
      "city": "San Francisco"
    },
    {
      "company": "Brex",
      "website": "brex.com",
      "city": "San Francisco"
    },
    {
      "company": "Kith",
      "website": "kithnyc.com",
      "city": "New York"
    },
    {
      "company": "Austin Dental Works",
      "website": "austindentalworks.com",
      "city": "Austin"
    },
    {
      "company": "Ogilvy",
      "website": "ogilvy.com",
      "city": "New York"
    },
    {
      "company": "Warby Parker",
      "website": "warbyparker.com",
      "city": "New York"
    }
  ],
  "instruction": "Which industry is {company} ({website}, based in {city}) in?",
  "mode": "classify",
  "labels": [
    "SaaS",
    "Fintech",
    "E-commerce",
    "Local services",
    "Agency",
    "Other"
  ],
  "outputColumn": "industry"
}' |
apify call bulkleads/ai-for-every-row-csv --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bulkleads/ai-for-every-row-csv"
        }
    }
}
```

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/JxnlYaymPC4sZj5w8/builds/fBDQp1KMpXVu0cKz7/openapi.json
