Mozilla Readability: the library API, and a hosted option
Mozilla Readability is a JavaScript library (the engine behind Firefox Reader View), not a hosted web API: you give it a DOM document and parse() returns the main article's title, byline, HTML content, plain text and excerpt. In Node you supply the DOM with jsdom. If you want a hosted call instead, our HTML to Markdown API fetches a page and returns the main content as Markdown for $0.003 per call.
Try it free HTML to Markdown API — clean main content, $0.003 · $0.003 / call
Using the library in Node
Pass the page URL to JSDOM so relative links become absolute. Keep jsdom's script running off (the default) when the HTML comes from strangers.
npm install @mozilla/readability jsdom
import { JSDOM } from "jsdom";
import { Readability } from "@mozilla/readability";
const url = "https://example.com/article";
const html = await (await fetch(url)).text();
const dom = new JSDOM(html, { url });
const article = new Readability(dom.window.document).parse();
console.log(article?.title, article?.byline, article?.textContent.slice(0, 300));
What parse() gives you
isProbablyReaderable(document) is a quick pre-check that tells you whether parse() is likely to find an article. Mozilla warns it gives both false positives and false negatives.
- title, byline, siteName, lang and publishedTime when the page states them.
- content: the cleaned article as an HTML string.
- textContent: the same article as plain text.
- excerpt and length (characters).
When you want an HTTP call instead
Running jsdom means a Node server and some memory per page. Our HTML to Markdown API does the fetch and the extraction for you. It isn't Readability: it uses its own rules, keeping article and main content and dropping navigation, sidebars, footers, forms, cookie banners, comment blocks and hidden parts. You get Markdown (headings, lists, links, code blocks, images) plus the title, description and language. Send a URL or your own HTML.
curl -i -X POST https://iamai.markets/api/x402/services/xB9SA29ULP8G \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
# result: source, title, description, language, markdown, characters, truncated
Compared honestly
For pages that build their text in the browser, both come back short. Our page reader ($0.02) opens a real browser for those.
| Readability + jsdom | Our HTML to Markdown API | |
|---|---|---|
| Runs where | Your Node process | Our servers, one POST |
| Output | HTML and plain text | Markdown |
| Byline and date | Yes, when found | No; title, description and language only |
| JavaScript-built pages | Only the HTML you fetched | Only the HTML the server sends |
| Cost | Free, plus your hosting | $0.003 per call, x402 in USDC on Base |
The product
Questions
Is there an official Mozilla Readability REST API?
No. Mozilla publishes the library; any hosted endpoint you find is a third party running it.
Can I use Readability in Python?
There are Python ports such as readability-lxml, but they're separate projects that behave differently from Mozilla's.
Is this the same as a readability score?
No. Text readability scores (Flesch) measure how easy text is to read; see our readability API page.
Related
Updated 2026-12-02
