PlainGrade

API docs

Base URL: https://plaingrade-api.mike-tusa.workers.dev. JSON in, JSON out. English only.

POST /v1/score

Request body (JSON, at most 49,152 bytes):

FieldTypeNotes
textstring, requiredAt most 20,480 bytes (UTF-8), measured after JSON decoding. The body cap leaves room for JSON escaping (quotes, newlines, backslashes), so any normal 20 KB text fits.
langstring, default "en"Only English is supported (en, en-US, en-GB, …). Any other value returns 422 unsupported_language.
long_sentence_wordsinteger, default 25A sentence with more words than this is listed in long_sentences (5–200).
curl -s https://plaingrade-api.mike-tusa.workers.dev/v1/score -H 'content-type: application/json' -H 'x-api-key: pg_…' \
  -d '{"text":"The Australian platypus is seemingly a hybrid of a mammal and reptilian creature.","lang":"en"}'

Response (the real response is compact JSON):

{
  "ok": true,
  "lang": "en",
  "scores": {
    "flesch_reading_ease": 24.4, "flesch_kincaid_grade": 13.1, "gunning_fog": 14.4, "smog": 14.6,
    "coleman_liau": 12.7, "ari": 9.7, "consensus_grade": 12.9
  },
  "interpretation": { "flesch_reading_ease": "Very difficult", "audience": "College graduate", "consensus_grade": "College" },
  "stats": {
    "characters": 81, "characters_no_spaces": 69, "letters": 68, "words": 13, "sentences": 1, "paragraphs": 1,
    "syllables": 26, "polysyllable_words": 4, "complex_words": 3, "avg_words_per_sentence": 13,
    "avg_syllables_per_word": 2, "avg_letters_per_word": 5.23, "reading_time_seconds": 3, "reading_time": "3 s",
    "speaking_time_seconds": 5
  },
  "long_sentences": { "threshold_words": 25, "count": 0, "items": [], "truncated": false },
  "notes": ["short_text: …", "smog_under_30_sentences: …"],
  "text_bytes": 81,
  "engine": "syllable@5.0.1 (+ small correction list) with in-house formulas and sentence splitter",
  "version": "0.5.1"
}

long_sentences.items holds up to 50 entries { index, start, end, words, text }: index is the sentence number (0-based), start/end are JavaScript string (UTF-16) offsets into your text (end exclusive), and text is the sentence, cut to 300 characters. scores and interpretation are null when the text has no words. notes can include short_text, smog_under_30_sentences, no_words and likely_not_english (most letters are not Latin script).

POST /v1/keys

Issues a free API key: 100 requests/day, 30/min, commercial use allowed. No email or sign-up needed. The key is shown once; we store only its SHA-256 hash. Up to 3 keys per IP per day (at most 2 per minute). Lost a key or need it revoked? Email digitalpromohub.support@gmail.com

curl -s -X POST https://plaingrade-api.mike-tusa.workers.dev/v1/keys -H 'content-type: application/json' -d '{}'

Send it as X-API-Key. GET /v1/usage with the header shows today's usage.

Limits and headers

Errors

Errors look like {"ok":false,"error":{"code":"…","message":"…"}}. Codes: invalid_json, missing_text, invalid_lang, invalid_long_sentence_words (400); invalid_api_key, missing_api_key (401); cross_origin_forbidden (403); not_found (404); method_not_allowed (405); body_too_large, text_too_large (413); unsupported_media_type (415); unsupported_language (422); rate_limited, ip_daily_quota, key_quota_exceeded, issuer_quota_exceeded, key_issue_limit, daily_cap_reached (429); internal_error (500); not_configured, unavailable (503).

Other endpoints

GET /health returns the service status and version. GET /privacy is the privacy note.

How the scores are computed

Support

Questions, key revocation or abuse reports: digitalpromohub.support@gmail.com.

Pricing

Free

$0

100 requests/day with a free API key (30/min), texts up to 20 KB. Commercial use allowed. No card, no sign-up form.

Without a key: 50/day and 10/min per IP (the paste tool uses this).

Pro

$5/month

5,000 requests/day per license (30/min), texts up to 20 KB, with its own capacity separate from the free pool. Send your Pro license key in the X-API-Key header (MCP: Authorization: Bearer). Cancel any time.

Get PlainGrade Pro (secure checkout by Polar)

Payments are handled by Polar (polar.sh), our merchant of record. See Privacy for what that means for your data. Manage or cancel a subscription in the Polar customer portal.