Navigation
POST data

csv_sort

1 credit

Sort CSV rows by one or more columns in ascending or descending order.

Endpoint

POST /api/v1/tools/data/csv_sort

Body Parameters

text string required
order string optional default: "asc"
Options: asc desc
header boolean optional default: true
sort_by array required
delimiter string optional default: ","

Example

input Request
{
    "text": "name,age\nCharlie,35\nAlice,30\nBob,25",
    "sort_by": [
        "name"
    ]
}
output Response
{
    "result": "name,age\nAlice,30\nBob,25\nCharlie,35\n"
}

Response Format

HTTP/1.1 200 OK SUCCESS
{
  "success": true,
  "data": {
    "result": "name,age\nAlice,30\nBob,25\nCharlie,35\n"
},
  "meta": {
    "tool": "csv_sort",
    "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.