CSV Import API

Transform and validate your CSV data using our AI-powered API. Automatically clean, standardize, and map your data to a canonical format.

POST/csv-import

Request

Send your CSV data for processing. The API accepts both raw CSV content and JSON-wrapped CSV data.

Headers

Authorization: Bearer your_api_key_here
Content-Type: text/csv
X-Canonical-Fields: product_name,quantity_sold,unit_price
X-Return-Transformed: true # Optional, defaults to false

Request Formats

Content-Type: text/csv
Product Name,Units Sold,Price
Product A,100,29.99
Product B,50,19.99

Response

Returns either the field mapping or the transformed CSV, depending on the X-Return-Transformed header.

{
"mappedFields": {
"Product Name": "product_name",
"Units Sold": "quantity_sold",
"Price": "unit_price"
}
}

Code Examples

# Send raw CSV
curl -X POST https://api.sheetsheep.com/csv-import \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: text/csv" \
-H "X-Canonical-Fields: product_name,quantity_sold,unit_price" \
-H "X-Return-Transformed: true" \
--data-binary @data.csv
# Send JSON-wrapped CSV
curl -X POST https://api.sheetsheep.com/csv-import \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-H "X-Canonical-Fields: product_name,quantity_sold,unit_price" \
-d '{"csvData": "Product,Units,Price\nA,100,29.99"}'