Skip to content
Utilerio
All endpoints

Text Cleaner

POST/api/v1/tools/text-cleaner

Trim whitespace, collapse repeated spaces, remove blank lines and normalize line endings.

Authentication

Requires an API key in the X-API-Key header.

Try it

POST/api/v1/tools/text-cleaner

Parameters

textstringrequired

Text to clean.

trimLinesbooleanoptional

Trim each line. Default true.

collapseSpacesbooleanoptional

Collapse repeated spaces/tabs. Default true.

removeEmptyLinesbooleanoptional

Drop blank lines. Default false.

normalizeLineEndingsbooleanoptional

Normalize CRLF/CR to LF. Default true.

stripControlCharsbooleanoptional

Remove control characters. Default true.

Request body

{
  "text": "  Hello   World  \n\n"
}

Response codes

  • 200Success.
  • 400Invalid request — check your body or parameters.
  • 401Missing or invalid API key.
  • 403The API key is not scoped to this endpoint.
  • 429Rate limit exceeded — retry after a short wait.

Language

cURL

Request

curl -X POST https://utilerio.com/api/v1/tools/text-cleaner \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"  Hello   World  \n\n"}'

Response

{ "output": "Hello World" }