DEV Community

miccho27
miccho27

Posted on

I Built a Readability Score API on Cloudflare Workers (Free Tier)

Building text analysis tools is surprisingly complex. Readability scoring alone involves multiple formulas — Flesch-Kincaid, Coleman-Liau, SMOG, ARI — each with different use cases.

I built a Readability Score API on Cloudflare Workers that handles all of them in a single request. Here's how and why.

The Problem

Most readability tools are web-based. You paste text, click a button, get a score. That doesn't work when you need to:

  • Analyze 1,000 blog posts programmatically
  • Add readability checks to a CMS pipeline
  • Build a writing assistant that scores in real-time

You need an API.

What It Does

Send any text, get back a comprehensive readability analysis:

{
  "text": "Your text here..."
}
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "flesch_reading_ease": 65.2,
  "flesch_kincaid_grade": 8.1,
  "coleman_liau_index": 9.3,
  "smog_index": 7.8,
  "ari": 8.5,
  "word_count": 342,
  "sentence_count": 18,
  "avg_words_per_sentence": 19.0,
  "reading_time_minutes": 1.4,
  "difficulty": "Standard"
}
Enter fullscreen mode Exit fullscreen mode

One API call. Six readability metrics. Plus word stats and reading time.

The Tech Stack

Cloudflare Workers — zero hosting cost, global edge deployment, sub-50ms response times.

The entire API is a single JavaScript file:

function fleschReadingEase(words, sentences, syllables) {
  return 206.835 - 1.015 * (words / sentences) - 84.6 * (syllables / words);
}

function fleschKincaidGrade(words, sentences, syllables) {
  return 0.39 * (words / sentences) + 11.8 * (syllables / words) - 15.59;
}
Enter fullscreen mode Exit fullscreen mode

No dependencies. No framework. Just math.

Why Cloudflare Workers?

I run 25+ APIs on Workers. Total monthly cost: $0.

The free tier gives you:

  • 100,000 requests/day
  • 10ms CPU time per request
  • Global edge deployment (300+ locations)

For utility APIs that do computation (not database queries), Workers are perfect.

Use Cases

  1. Content teams: Score articles before publishing. Target grade 6-8 for general audiences.
  2. SEO tools: Readability is a ranking factor. Automate checks across your entire site.
  3. Education platforms: Match content difficulty to student reading levels.
  4. Writing apps: Real-time feedback as users type.

Try It

The API is available on RapidAPI:
Readability Score API on RapidAPI

Free tier available. No auth complexity — just subscribe and start making requests.

What I Learned

Building utility APIs taught me that the simplest APIs get the most usage. Nobody wants a 50-endpoint API with complex auth flows. They want:

  1. One endpoint
  2. Send data in, get results out
  3. Fast response
  4. Predictable pricing

If you can solve a common developer problem in under 100ms with a single API call, you have a product.


What readability tools do you use in your workflow? I'm curious how others handle content quality checks at scale.

Top comments (0)