POST
data
csv_deduplicate
1 creditRemove duplicate rows from CSV, keeping the first or last occurrence. Optionally deduplicate by specific columns.
Endpoint
POST /api/v1/tools/data/csv_deduplicate
Body Parameters
keep
string
optional
default: "first"
Options:
first
last
text
string
required
header
boolean
optional
default: true
columns
array | null
optional
default: null
delimiter
string
optional
default: ","
Example
input
Request
{
"text": "name,age\nAlice,30\nBob,25\nAlice,30"
}
output
Response
{
"result": "name,age\nAlice,30\nBob,25\n",
"rows_after": 2,
"rows_before": 3,
"duplicates_removed": 1
}
Response Format
HTTP/1.1 200 OK
SUCCESS
{
"success": true,
"data": {
"result": "name,age\nAlice,30\nBob,25\n",
"rows_after": 2,
"rows_before": 3,
"duplicates_removed": 1
},
"meta": {
"tool": "csv_deduplicate",
"credits_consumed": 1
}
}
HTTP/1.1 422 Unprocessable Entity
ERROR
{
"success": false,
"data": null,
"error": {
"code": "validation_error",
"message": "The given data was invalid."
}
}
Sign in to try this tool directly from the docs.
Code Examples
Request Example
lightbulb
Developer Tip
Credits are deducted before execution. If the upstream tool fails, credits are automatically refunded to your account.