apyhub
Back
DATA EXTRACTION · DEVELOPER TOOLS

Extract Readable Content from HTML API

What it does

The Extract Readable Content from HTML API works like reader mode for your code. Send raw HTML and get back the main article content and title, with the navigation, ads, sidebars and other page boilerplate stripped out by readability algorithms.

It is one POST endpoint. The request takes a required html field with the page markup and an optional url field for the page the HTML came from. The response includes content for the readable text, title for the full title, short_title for a shorter version you can use in lists and previews, and length for the size of the extracted content. A very low length is a quick signal that the page had no clear main article.

Because you send the HTML yourself, it works on pages a URL-based extractor cannot reach: pages behind a login that your own code fetches, pages rendered by a headless browser, HTML stored from an earlier crawl, and saved web archives. Common uses include reading apps, knowledge bases, content analysis, and preparing clean text for summarization and AI pipelines.

If you have a public article URL instead of HTML, use Extract Article Text, which fetches the page for you. If you need all the text in the HTML rather than only the main article, use Extract Text from HTML. To get every piece of visible text from a live page, use Extract Text from Website.

You can try it right here in the playground. Start for free with 5 API calls a day, no card required, and test it on your own HTML before you commit.

The API is also available through ApyHub MCP, so AI agents can call it directly to pull the readable content out of a page.

POST
Extract main article content and title from HTML using readability algorithms
https://api.eu.apyhub.com/dosvak/extract-html-readable-content

QUICKSTART

GUIDE

Quickstart

Send the HTML you want to extract readable text from in the request body.

curl -X POST "https://api.eu.apyhub.com/dosvak/extract-html-readable-content" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"html":"<html><body><h1>Example Article</h1><p>This is a short example.</p></body></html>"}'

What you'll get back

Returns a JSON object with optional top-level title, length, content, and short_title fields.

  • title is a string
  • length is an integer
  • content is a string
  • short_title is a string
{
  "title": "Example Article",
  "length": 24,
  "content": "Example Article This is a short example.",
  "short_title": "Example"
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Extracts the main readable content and title from an HTML document using readability algorithms. The request sends HTML content, and the response returns the extracted title and content metadata.

Request Body

ParameterTypeMandatoryDescription
urlStringNoThe source URL for the HTML, if available.
htmlStringYesThe HTML document to analyze.

Response

Returns a JSON object with title, length, content, and short_title fields. title and short_title are strings, length is an integer, and content is the extracted readable content as a string.

ParameterTypeMandatoryDescription
titleStringNoThe extracted page or article title.
lengthIntegerNoThe length of the extracted content.
contentStringNoThe main readable content extracted from the HTML.
short_titleStringNoA shorter version of the extracted title.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.