Build with the
CleanText API.
Simple REST endpoints for powerful text cleaning, formatting, and analysis. Built for high-volume automation and seamless AI integration.
Unlock Pro API.
Scale your integration with 5,000 requests per day, advanced exports, and direct support.
⚡ Test API in 10 Seconds
Test the API with this curl command (works in terminal)
# Test the API with curl
curl -X POST https://cleantextlab.com/api/v1/run \
-H "Content-Type: application/json" \
-H "x-api-key: ctl_live_YOUR_KEY" \
-d '{
"input": "hello world",
"steps": ["title-case-converter"]
}'YOUR_KEY with your actual API key from Settingshttps://cleantextlab.com/api/v1All requests must use HTTPS. We aim for 99.9% uptime for Pro endpoints.
x-api-key: YOUR_KEYInclude your key in the custom header. Keep your keys secret and rotate them regularly.
Endpoints.
Focused tools for diverse text challenges.
/run
The most powerful endpoint. Chain multiple tools in a single request. This is the same engine that powers our MCP server.
curl -X POST https://cleantextlab.com/api/v1/run \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": " messy input ",
"steps": ["trim-lines", "upper-case"]
}'Steps can also be objects with toolSlug and an optional config object for advanced options.
{
"input": "a;b;c",
"steps": [
{
"toolSlug": "csv-json-converter",
"config": {
"delimiter": ";",
"hasHeaders": false
}
}
]
}/sanitize
Advanced URL and string sanitization. Strip tracking parameters, normalize encodings, and secure your data.
Rate Limits.
We scale with you. Starting with a free testing tier and moving up to enterprise-grade throughput.
Error Codes.
Standard HTTP status codes for predictable integration.
Missing or invalid API key.
Rate limit has been exceeded.
Invalid parameters in body.
Frequently Asked Questions
What's the difference between the API and the MCP server?
The API is for direct HTTP calls from scripts, n8n, or other automation tools (POST /api/v1/run). The MCP server is for AI agents like Claude Desktop, ChatGPT, or custom AI apps - it provides tools that LLMs can call. Both use the same underlying processing engine. Choose API for automation, MCP for AI agents.
Does the API support batch processing?
Yes! Instead of making 1000 API calls for 1000 rows of text, concatenate your data (e.g., join with newlines), send it as one API call, then split the result. This is 1000x more efficient and stays well within the 5,000/day limit. Example: clean 10,000 email addresses in one call by joining them with \n, running "trim-lines" + "dedupe-sort", then splitting the result.
Can I use the API without an account?
No, all API requests require an API key from a Pro account. However, our browser tools (JSON formatter, word counter, etc.) are 100% free with no sign-up required. They run entirely client-side in your browser.