Black Friday: double credits on your first month, any plan · ends Sunday, Nov 29Cyber Monday extension: double credits on your first month, any plan · ends tonightBlack Friday: 2x creditsCyber Monday: 2x creditsSee plans
ScraperCity logo

AI for Every Row API Documentation

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 runPOST /api/v1/scrape/ai-for-every-row

Parameters

NameTypeRequiredDescription
csvstringOptionalThe CSV file as text, header row first (use csv or rows)Example: "company,website\nAcme Roofing,acmeroofing.com"
rowsobject[]OptionalThe rows as JSON objects, up to 5,000 a runExample: [{"company": "Acme Roofing", "website": "acmeroofing.com"}]
instructionstringRequiredWhat to do with each row; {column} is replaced by that row's valueExample: Which industry is {company} ({website}) in?
modestringOptionalwrite (a new text column), classify (one of your labels) or extract (fields as columns)Default: writeExample: classify
labelsstring[]Optionalclassify: the labels to choose from (at least 2)Example: ["SaaS", "Agency", "Local business", "Other"]
fieldsstring[]Optionalextract: the names of the fields to pull outExample: ["city", "employees", "founded_year"]
outputColumnstringOptionalwrite and classify: the new column's nameDefault: ai_text (write), ai_label (classify)Example: ai_text
systemPromptstringOptionalOne system prompt sent with every rowExample: Answer in one short sentence.
maxTokensnumberOptionalMost tokens in each answer (1 to 4,096)Default: 1024Example: 1024
temperaturenumberOptional0 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.csv

Use 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.