Skip to main content
Reader’s whole point is LLM-ready content. This guide shows the simplest possible pipeline from a URL to an LLM response, plus the pitfalls that show up as you scale.

The minimal pipeline

That’s the whole shape: scrape → markdown → prompt. Reader handles every step before the LLM.

Keep onlyMainContent: true

Reader’s default extraction strips navigation, sidebars, cookie banners, and footer boilerplate. Your LLM doesn’t need those tokens, and they confuse questions like “what’s the author’s main argument?”.
Only turn it off if you specifically need the page’s non-article chrome (links, navigation structure, etc.) for your prompt.

Tokens and truncation

Long articles can blow through your model’s context window. Two strategies: Truncate the content if you just want a summary and don’t need every word:
Chunk and iterate if you need to reason across the whole document. See RAG for the deeper pattern.

Prompt shape

Reader returns clean markdown with headings, lists, and code blocks preserved. Let your LLM see that structure; don’t flatten it to plain text:
Models that trained on markdown (most recent ones) benefit from seeing the structural cues.

Citing sources back to the user

Reader’s response includes url (canonical, after redirects) and metadata.title. Keep those around so your LLM output can cite:

Caching is your friend

Reader caches every successful scrape for 24 hours. If you’re iterating on a prompt against the same URL, every request after the first is free. Leave cache: true on (it’s the default).

Error handling

A failed scrape means your LLM has no content to reason about. Decide what to do:
  • Fail loudly. Propagate the error to the user; better than an LLM hallucinating an answer to an empty prompt.
  • Fall back to search. If scrape fails, the user at least gets a “I couldn’t read this, here’s what I could find” response.
  • Retry once with a different mode. If standard failed, force premium and try again.

Next