Turn any web page into clean text or Markdown

Three APIs turn HTML into words, and they disagree about what to keep. Learn which one to reach for when the text is headed for search, an LLM prompt or a database, and what each one quietly throws away.

Every content pipeline starts with the same unglamorous step: get the words off the page. A search index, a summariser, a retrieval-augmented chatbot and a change monitor all want the same thing, which is the text a human would read, without the navigation bar, the cookie banner, the footer links and the forty <div> wrappers around each paragraph.

There is no single correct answer to "what is the text of this page". A news article's text is the story. A Wikipedia article's text arguably includes the infobox table but not the 300 category links at the bottom. A pricing page's text is mostly in lists and tables that a pure article extractor will mangle. So instead of one tool you get three, and the skill is knowing what each one keeps.

Three converters, three inputs

APIYou sendYou get backCredits per call
Website to TextA URLOne flat string of text, plus title, date, language25
URL to MarkdownA URLMarkdown with headings, lists and tables preserved, plus counts10
HTML to TextRaw HTML you already haveThe main article text, or nothing2

Two things stand out before you write any code. First, the URL-based APIs fetch the page for you, which is why they cost more: they do the network work, follow redirects and parse whatever comes back. Second, the cheapest one does not fetch anything. If your system already holds the HTML (a crawler you run, an email body, a CMS export, a page a user pasted), sending that HTML to HTML to Text costs a fraction of asking another service to fetch the page again.

All three are POST endpoints that take a JSON body. Here is one helper used for the rest of this lesson.

// Node 18+, ESM. Run with: node yourfile.mjs
const KEY = process.env.APIVERVE_API_KEY;

export async function apiverve(id, body) {
  const res = await fetch(`https://api.apiverve.com/v1/${id}`, {
    method: 'POST',
    headers: { 'x-api-key': KEY, 'content-type': 'application/json' },
    body: JSON.stringify(body),
    signal: AbortSignal.timeout(30_000),
  });
  const json = await res.json();
  if (!res.ok || json.status !== 'ok') {
    throw new Error(`${id} ${res.status}: ${json.error ?? 'unknown error'}`);
  }
  return json.data;
}

The 30-second timeout is deliberate. These calls wait on someone else's web server, and a slow origin is the most common reason one of them takes longer than a typical lookup API.

Website to Text: everything, flattened

Website to Text returns the page's readable text as a single string, along with title, title_alt, description, date, language and publisher.

Try it liveWebsite to Text25 credits
POSThttps://api.apiverve.com/v1/websitetotext
curl -X POST "https://api.apiverve.com/v1/websitetotext" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'
Sign in or create a free account to run this with your own key.

Small page, so the text is one sentence. Notice the language code and the null date.

On a tiny page that looks perfect. On a real article it shows its character. Converting the Wikipedia article on RSS returned roughly the whole page as one paragraph-less line: the intro, then every section heading followed by a literal [edit], the example XML from the article body, the full reference list with ↑ markers, the navigation boxes at the bottom, and finally the hidden maintenance categories. Nothing was lost, and nothing was organised.

Three details from that response are worth remembering because they will bite you in production:

  • No paragraph breaks. The string has no newlines. You cannot split it into paragraphs afterwards, because the information is gone. If structure matters downstream, this is the wrong tool.
  • date is a guess. For that article it returned 1999-03-15, which is the date RSS was first released, lifted from the body text. It is not when the page was published or edited. Treat date as a hint for articles that declare a publication date, and never as a crawl timestamp or a freshness signal.
  • title may be the site, not the page. The same call returned "Wikipedia" as the title. When you need the page's own title, cross-check with the Markdown converter's title or the metadata API in the next lesson.

Where Website to Text is the right tool: full-text search, keyword and entity extraction, language detection, spam and content classification, and "did this page mention X" checks. All of those treat text as a bag of words and do not care about paragraphs.

Check yourself

You store `data.date` from Website to Text as the article's publish date and use it to hide stale content. What is the risk?

Answer the check above to continue.

Run every example on your own key. Free plan, no card.

Scaling up?

Volume pricing, custom SLAs, and dedicated support for high-traffic teams.

Contact sales