---
title: "Text Cleaner"
method: POST
path: "/api/v1/tools/text-cleaner"
tags: ["tools"]
---

# Text Cleaner

`POST /api/v1/tools/text-cleaner`

## Request

- Base URL: `https://toolforte.com`
- URL: `https://toolforte.com/api/v1/tools/text-cleaner`
- Auth: HTTP bearer

Clean up messy text: collapse extra spaces, trim lines, drop empty lines, strip HTML tags, remove punctuation, digits, emojis or control characters, and straighten smart quotes. Returns the cleaned text and how many characters each step removed.

## Request body

- object
  - `text` string
  - `extraSpaces` boolean
  - `trimLines` boolean
  - `emptyLines` boolean
  - `lineBreaks` boolean
  - `htmlTags` boolean
  - `punctuation` boolean
  - `numbers` boolean
  - `emojis` boolean
  - `plainQuotes` boolean
  - `controlChars` boolean

## Response `200`

Successful result

- object
  - `ok` boolean
  - `data` object
    - `result` string
    - `charactersBefore` integer
    - `charactersAfter` integer
    - `charactersRemoved` integer
    - `steps` object[]
      - `option` string
      - `charactersRemoved` integer
    - `changed` string[]

## Other responses

- `400`: Missing or invalid request fields
- `401`: Invalid or missing API key
- `429`: Monthly plan limit reached

---

[API](https://skmtc.dev/toolforte/apis/toolforte-api.md) · [All operations](https://skmtc.dev/toolforte/apis/toolforte-api/llms.txt) · [OpenAPI document](https://skmtc.dev/toolforte/apis/toolforte-api/revisions/4d814d484dfc?raw)
