Text Info
/api/textinfo 1 credit(s) per call
Analyse any text and get detailed statistics including readability scores, word frequency, and pattern detection.
Overview
The Text Info API analyses any text and returns detailed statistics including readability scores (Flesch-Kincaid, Gunning Fog), reading time, vocabulary richness, word frequency, and pattern detection (emails, URLs, phone numbers, emojis, numbers).
Endpoint
POST
/api/textinfo
GET
/api/textinfo/analyze?text=Hello%20World
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | The text to analyse |
| topWordsCount | int | No | Number of top words to return (1-50, default 10) |
Response Fields
The response is wrapped in a standard API envelope:
| Field | Type | Description |
|---|---|---|
| success | boolean | true on success |
| data.characterCount | int | Total characters including whitespace |
| data.characterCountNoSpaces | int | Characters excluding whitespace |
| data.wordCount | int | Number of words |
| data.lineCount | int | Number of lines |
| data.byteCount | int | UTF-8 byte size |
| data.sentenceCount | int | Number of sentences |
| data.averageWordsPerSentence | double | Average words per sentence |
| data.paragraphCount | int | Number of paragraphs |
| data.fleschReadingEase | double | Flesch Reading Ease score (0-100, higher = easier) |
| data.fleschKincaidGradeLevel | double | US school grade level needed to understand |
| data.gunningFogIndex | double | Gunning Fog readability index |
| data.readingLevel | string | Human-readable level: Very Easy, Easy, Fairly Easy, Standard, Fairly Difficult, Difficult, Very Confusing |
| data.estimatedReadingTimeSeconds | int | Estimated reading time in seconds (~200 WPM) |
| data.uniqueWordCount | int | Number of unique words |
| data.vocabularyRichness | double | Ratio of unique words to total words (0-1) |
| data.averageWordLength | double | Average word length in characters |
| data.topWords | array | Most frequent words (excluding stop words), each with word and count |
| data.patterns | object | Detected patterns: emails, urls, phoneNumbers, emojis, numbers (each with count + list) |
Example
Analyse a piece of text:
curl -X POST https://simplewebapis.com/api/textinfo \
-H "Content-Type: application/json" \
-H "X-Api-Key: swa_your_key" \
-d '{"text": "Hello World! This is a test."}'
The response is a JSON object (Content-Type: application/json).
Try it out
Use the Playground to test this API live.