Data Transform 3 credits COMPUTE

CSV to JSON API

Convert CSV data to a JSON array of objects via REST API. Handles RFC 4180 CSV including quoted fields with embedded commas, escaped quotes, custom delimiters, and optional header rows. Returns structured JSON ready for further processing.

Try it live →

How it works

POST a CSV string. The API parses the first row as column headers (unless you specify noHeader: true), then parses each subsequent row into an object with those keys. Handles quoted fields, escaped quotes (""), and custom delimiters via the delimiter parameter.

Use cases

API Reference

POST https://slopshop.gg/v1/text-csv-to-json
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Input parameters

ParameterTypeRequiredDescription
text / input string required The text or data to process

Example response

{
  "data": {
    "result": "[{\"key\":\"value\"}]",
    "rows": 1
  },
  "meta": {
    "credits_used": 3,
    "engine": "real",
    "ms": 4
  }
}

Examples

Three real-world scenarios showing how developers use CSV to JSON in production.

Example 1
Parse spreadsheet export
Convert a CSV exported from Excel into JSON for an import pipeline.
curl -X POST https://slopshop.gg/v1/text-csv-to-json \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"csv": "name,email,role\nAlice,alice@example.com,admin\nBob,bob@example.com,user"}'
Example 2
Process webhook CSV payload
Parse a CSV body from an incoming webhook before storing records.
curl -X POST https://slopshop.gg/v1/text-csv-to-json \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"csv": "order_id,sku,qty,price\n1001,ABC-123,2,29.99\n1002,XYZ-789,1,49.99"}'
Example 3
Convert data for LLM analysis
Turn a CSV of metrics into JSON objects to feed into a prompt.
curl -X POST https://slopshop.gg/v1/text-csv-to-json \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"csv": "date,sessions,conversions,revenue\n2024-01-01,1200,48,1440.00\n2024-01-02,980,41,1230.00"}'

Code examples

curl

curl -X POST https://slopshop.gg/v1/text-csv-to-json \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "your data here"}'

Python

import requests

response = requests.post(
    "https://slopshop.gg/v1/text-csv-to-json",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"input": "your data here"}
)
result = response.json()
print(result["data"])

Node.js

const response = await fetch("https://slopshop.gg/v1/text-csv-to-json", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ input: "your data here" })
});
const { data } = await response.json();
console.log(data);

CLI

# Install the Slopshop CLI
npm install -g slopshop

# Set your API key
export SLOPSHOP_KEY=your_api_key

# Call text-csv-to-json
slop text-csv-to-json '{"input": "your data here"}'

Pricing

Credits per call
3
credits
Cost per call
$0.003
at Starter tier
Tier
COMPUTE
Pure compute

Credits are purchased in bundles starting at $1 for 1,000 credits. All compute APIs like this one use 3 credits per call — that's $0.003. See all pricing tiers.

Related APIs in Data Transform

View the full API catalog · Try in playground · Documentation