Overview
- Category
- Text Tools
- API mode
execute- Processing
- client-side
- Privacy
- no-data-stored
Public descriptor
The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.
GET /api/v1/tools/word-counter
Execute availability
This tool has an execute route defined by its descriptor. Server-side execution is currently unavailable, so requests return api_not_launched.
POST /api/v1/tools/word-counter/execute
Authentication is not issued during the preview. A bearer API key is planned for execution after launch.
Input schema
object object; additional properties are not accepted.
text· string · required- Text to analyze.
{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text to analyze."
}
},
"required": [
"text"
],
"additionalProperties": false
}
Output schema
On a successful execution, schema values appear in data.result.values.
words· number- Word tokens.
characters· number- Code points including whitespace.
characters_no_spaces· number- Code points excluding whitespace.
sentences· number- Sentence estimate.
paragraphs· number- Paragraph count.
lines· number- Line count.
unique_words· number- Distinct case-insensitive words.
reading_time_minutes· number- Reading estimate.
speaking_time_minutes· number- Speaking estimate.
primary· number- Word count.
{
"type": "object",
"properties": {
"words": {
"type": "number",
"description": "Word tokens."
},
"characters": {
"type": "number",
"description": "Code points including whitespace."
},
"characters_no_spaces": {
"type": "number",
"description": "Code points excluding whitespace."
},
"sentences": {
"type": "number",
"description": "Sentence estimate."
},
"paragraphs": {
"type": "number",
"description": "Paragraph count."
},
"lines": {
"type": "number",
"description": "Line count."
},
"unique_words": {
"type": "number",
"description": "Distinct case-insensitive words."
},
"reading_time_minutes": {
"type": "number",
"description": "Reading estimate."
},
"speaking_time_minutes": {
"type": "number",
"description": "Speaking estimate."
},
"primary": {
"type": "number",
"description": "Word count."
}
},
"additionalProperties": false
}
Two short sentences
The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.
curl -X POST "https://utilitypages.org/api/v1/tools/word-counter/execute" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello world. This is a sample."
}'
{
"ok": true,
"data": {
"slug": "word-counter",
"result": {
"values": {
"words": 6,
"characters": 30,
"characters_no_spaces": 25,
"sentences": 2,
"paragraphs": 1,
"lines": 1,
"unique_words": 6,
"reading_time_minutes": 0.0299999999999999988897769753748434595763683319091796875,
"speaking_time_minutes": 0.05000000000000000277555756156289135105907917022705078125,
"primary": 6
},
"display": {
"display": "6"
},
"warnings": [],
"assumptions": [],
"steps": []
}
},
"meta": [],
"request_id": "req_example_123"
}
Errors
api_not_launched· 503- Returned by the current launch gate for every execute request.
invalid_json· 400- Returned when an enabled execute request does not contain valid JSON.
validation_failed· 422- Returned when a request does not satisfy the input schema.
browser_interaction_required· 422- Returned for browser capability tools instead of inventing a server-side result.
tool_not_found· 404- Returned when a requested descriptor slug does not exist.
execution_failed· 503- Returned when an enabled server-side execution cannot complete.