Skip to main content
POST
/
api
/
clean
Clean
curl --request POST \
  --url https://whetdata.com/api/clean \
  --header 'Content-Type: application/json' \
  --data '
{
  "action": [
    "clean"
  ],
  "text": "This is a sentance with speling and grammer erors that need to be fixed.",
  "ruleset": "product_review"
}
'
{
  "success": true,
  "action": [
    "clean"
  ],
  "ruleset": "product_review",
  "cleaned_text": "This is a sentence with spelling and grammar errors that need to be fixed."
}

Overview

Automatically fix spelling and grammar errors in your text. This action analyzes your content and returns a corrected version with all spelling and grammar mistakes fixed.

Use This Action To

  • Fix spelling mistakes in product descriptions
  • Correct grammar errors in marketing copy
  • Clean up user-generated content
  • Improve text quality before publishing

Parameters

action
array
required
Must be an array that includes "clean"
text
string
required
Text to fix (max 5,000 characters)
ruleset
string
Ruleset name (optional)

Response

{
  "success": true,
  "action": ["clean"],
  "ruleset": "product_review",
  "cleaned_text": "This is a sentence with spelling and grammar errors that need to be fixed."
}

Example

cURL
curl -X POST https://whetdata.com/api/clean \
  -H "x-api-key: whet_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "action": ["clean"],
    "text": "This is a sentance with speling and grammer erors that need to be fixed.",
    "ruleset": "product_review"
  }'

Tips

The clean endpoint is perfect for preprocessing user-generated content before displaying it on your site.
The maximum text length is 5,000 characters. For longer texts, split them into chunks.

Body

application/json
action
enum<string>[]
required
Available options:
clean
text
string
required
Maximum string length: 5000
ruleset
string

Response

200 - application/json

Success

The response is of type object.