Single endpoint, instant results
Word Count API - Count Words, Characters, and Sentences
Count words, characters, sentences, and paragraphs in any text. Perfect for content validation, form limits, and analytics. Free: 1,000 requests/day, no API key required.
POST https://textforge.co/v1/run
{
"input": "Hello World!",
"pipeline": [
"countwords"
]
}Response:
{
"success": true,
"input": "Hello World!",
"pipeline": [
"countwords"
],
"result": "hello-world",
"steps": [
{
"step": 1,
"action": "countwords",
"result": "hello-world",
"execution_time_ms": 1
}
],
"execution_time_ms": 4
}Use Case: Content Length Validation
Validate user-generated content against character limits before saving to database.
Example: Count words, characters, sentences, and paragraphs in any text. Perfect for content validation, form limits, and analytics. Free: 1,000 requests/day, no API key required.
Quick Start
cURL
curl -X POST https://textforge.co/transform -H "Content-Type: application/json" -d '{"text":"Hello World!","action":"countwords"}'Node.js
fetch("https://textforge.co/transform", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: "Hello World!", action: "countwords" })
}).then(r => r.json()).then(console.log);Python
import requests
payload = { "text": "Hello World!", "action": "countwords" }
response = requests.post("https://textforge.co/transform", json=payload)
print(response.json())PHP
<?php
$payload = json_encode([ "text" => "Hello World!", "action" => "countwords" ]);
$ch = curl_init("https://textforge.co/transform");
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
$response = curl_exec($ch);
echo $response;
?>Why use the API?
⚡
Sub-5ms latency
p95 response time, no cold starts
🔗
Composable pipelines
Chain transforms in one request
🛡️
Fair free tier
1,000 requests/day, no credit card
🌐
Works everywhere
curl, Python, JS, PHP - no SDK needed
📊
Built-in analytics
Usage tracking, rate limit headers
🔒
HTTPS only
CORS enabled, production ready