Skip to content

Count

Analyze text and return character, word, sentence, line, byte, and estimated token counts.

FieldTypeRequiredDescription
textstringYesText to analyze
FieldTypeDescription
charactersintegerTotal characters
characters_no_spacesintegerCharacters excluding spaces
wordsintegerWord count
sentencesintegerSentence count
linesintegerLine count
bytesintegerByte size
token_estimateintegerEstimated token count (bytes / 4)
Terminal window
curl -X POST https://morso.dev/api/count \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hello world. This is a test."}'
{
"characters": 28,
"characters_no_spaces": 23,
"words": 6,
"sentences": 2,
"lines": 1,
"bytes": 28,
"token_estimate": 7
}