Analysis API
NewAnalyze Text
Analyze any English passage up to 50,000 characters for readability indices, reading & speaking time, structural counts, lexical diversity, frequency-band breakdown, rare words, and top keywords.
POST/api/v1/analyze/text
Requires API key
Accepts a JSON body with text and returns readability scores (Flesch Reading Ease, Flesch-Kincaid Grade, Gunning Fog, Coleman-Liau), timing estimates, and vocabulary analytics.
Request Body
| Name | Description |
|---|---|
textrequired | stringNon-empty text passage to analyze (up to 50,000 characters). |
includeWordDetails | booleanWhen true, includes per-word syllables, frequencyBand, and dictionary validity for up to 100 unique words. Defaults to false. |
Request
bash
curl -X POST "https://api.playanagrama.com/api/v1/analyze/text" \
-H "Authorization: Bearer ak_your_key_here" \
-H "Content-Type: application/json" \
-d '{"text":"Serendipity guides curious explorers across bright horizons. Clear writing invites every reader forward."}'Response Fields
| Name | Description |
|---|---|
counts | objectcharacters, charactersNoSpaces, words, uniqueWords, sentences, paragraphs, syllables. |
averages | objectwordsPerSentence, syllablesPerWord, wordLength. |
timing | objectreadingTimeSeconds (at 238 WPM) and speakingTimeSeconds (at 150 WPM). |
readability | objectfleschReadingEase (0–100), fleschKincaidGrade, gunningFog, colemanLiau, and level (Elementary, Middle School, High School, College, Graduate). |
vocabulary | objectlexicalDiversity (unique/total ratio), frequencyBands (basic/common/known/rare counts & percentages), topKeywords[], and rareWords[]. |
wordDetails | object[]?Present only when includeWordDetails=true. Up to 100 unique words with syllables, frequencyBand, and valid flag. |
Response 200
JSON
{
"counts": {
"characters": 103,
"charactersNoSpaces": 91,
"words": 13,
"uniqueWords": 13,
"sentences": 2,
"paragraphs": 1,
"syllables": 28
},
"averages": {
"wordsPerSentence": 6.5,
"syllablesPerWord": 2.15,
"wordLength": 6.85
},
"timing": {
"readingTimeSeconds": 4,
"speakingTimeSeconds": 6
},
"readability": {
"fleschReadingEase": 18.02,
"fleschKincaidGrade": 12.36,
"gunningFog": 11.83,
"colemanLiau": 19.91,
"level": "High School"
},
"vocabulary": {
"lexicalDiversity": 1,
"frequencyBands": {
"basic": {
"count": 7,
"percent": 53.85
},
"common": {
"count": 4,
"percent": 30.77
},
"known": {
"count": 1,
"percent": 7.69
},
"rare": {
"count": 1,
"percent": 7.69
}
},
"topKeywords": [
{
"word": "across",
"count": 1,
"frequencyBand": "basic"
},
{
"word": "bright",
"count": 1,
"frequencyBand": "basic"
},
{
"word": "clear",
"count": 1,
"frequencyBand": "basic"
}
],
"rareWords": [
"serendipity"
]
}
}Response 400 — Empty or oversized text
JSON
{
"error": {
"code": "INVALID_PARAMS",
"message": "JSON body must include a non-empty 'text' string."
}
}Was this page helpful?