AI for Every Row
Send a CSV (or a list of rows) and one instruction with {column} placeholders: the AI writes a new column, picks one of your labels, or pulls out fields as their own columns, for up to 5,000 rows a run. Your own columns are kept as they are.
$0.0019 per row answered, minimum charge $0.12 a run
POST /api/v1/scrape/ai-for-every-rowParameters
| Name | Type | Required | Description |
|---|---|---|---|
csv | string | Optional | The CSV file as text, header row first (use csv or rows)Example: "company,website\nAcme Roofing,acmeroofing.com" |
rows | object[] | Optional | The rows as JSON objects, up to 5,000 a runExample: [{"company": "Acme Roofing", "website": "acmeroofing.com"}] |
instruction | string | Required | What to do with each row; {column} is replaced by that row's valueExample: Which industry is {company} ({website}) in? |
mode | string | Optional | write (a new text column), classify (one of your labels) or extract (fields as columns)Default: writeExample: classify |
labels | string[] | Optional | classify: the labels to choose from (at least 2)Example: ["SaaS", "Agency", "Local business", "Other"] |
fields | string[] | Optional | extract: the names of the fields to pull outExample: ["city", "employees", "founded_year"] |
outputColumn | string | Optional | write and classify: the new column's nameDefault: ai_text (write), ai_label (classify)Example: ai_text |
systemPrompt | string | Optional | One system prompt sent with every rowExample: Answer in one short sentence. |
maxTokens | number | Optional | Most tokens in each answer (1 to 4,096)Default: 1024Example: 1024 |
temperature | number | Optional | 0 to 2Default: 0.7 (write), 0 (classify, extract)Example: 0 |
Examples
Label every company in a CSV
curl -X POST https://app.scrapercity.com/api/v1/scrape/ai-for-every-row \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"rows": [{"company": "Acme Roofing", "website": "acmeroofing.com"}, {"company": "Brightsmile Dental", "website": "brightsmile.com"}],
"instruction": "Which kind of business is {company} ({website})?",
"mode": "classify",
"labels": ["Home services", "Healthcare", "SaaS", "Other"]
}'Check status and download
curl -X GET https://app.scrapercity.com/api/v1/scrape/status/{runId} \
-H "Authorization: Bearer YOUR_API_KEY"
# When status is SUCCEEDED, download the CSV
curl -L https://app.scrapercity.com/api/downloads/{runId} -o rows.csvUse Cases
- •Sorting a lead list by industry, company type or fit
- •Pulling city, size or founding year out of company descriptions
- •Writing a personal first line for each lead from its own columns
Best Practices
- •Rows whose columns used by the instruction are all empty are skipped and not charged; so are rows the AI could not answer
- •The file has your columns, then the new column(s), then ai_status and ai_error
Every scrape returns a runId. Poll GET /api/v1/scrape/status/{runId} until it completes, then download via GET /api/downloads/{runId}?format=csv.
Authenticate every request with Authorization: Bearer YOUR_API_KEY. See the full API reference for authentication, rate limits and error codes.