A web page as Markdown, for a model to read
Raw HTML is mostly navigation, scripts and markup. Turning a page into clean Markdown gives a language model the content without the noise.
Guides4 min read
By the EnrichedNow team
Hand a language model the HTML of a documentation page and most of what it reads is not the documentation. It is the navigation, the cookie notice, the inline scripts, and several thousand characters of class names. The content is in there, at a poor ratio, and you pay for every token of the rest.
Markdown is the format models read best for a reason. It carries the structure that matters, headings, lists, links, code blocks and tables, in almost no extra characters.
One call
web.markdown takes the address of a public web page and returns it as Markdown:
# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/web.markdown/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"url":"https://docs.widgetlib.org/en/stable/quickstart.html"}}'
# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start a run, wait for it to end, and get its records
result = client.scrape("web.markdown", {
"url": "https://docs.widgetlib.org/en/stable/quickstart.html",
})
print(result.run.id, result.run.status, result.run.record_count)
# Read its records: pages are fetched as you go
for record in result.records:
print(record)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("web.markdown", {
url: "https://docs.widgetlib.org/en/stable/quickstart.html",
});
console.log(run.id, run.status, run.record_count);
// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Start a run, wait for it to end, and get its records
run, records, err := client.Scrape(ctx, "web.markdown", map[string]any{"url": "https://docs.widgetlib.org/en/stable/quickstart.html"})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RecordCount)
// Read its records: pages are fetched as you go
for records.Next() {
fmt.Println(string(records.Current()))
}
if err := records.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
ScrapeResult result = client.scrape("web.markdown", Map.of("url", "https://docs.widgetlib.org/en/stable/quickstart.html"));
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
// Read its records: pages are fetched as you go
for (Map<String, Object> record : result.records()) {
System.out.println(record);
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow run web.markdown --input url=https://docs.widgetlib.org/en/stable/quickstart.htmlInstall it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
What comes back
The record is the page and what is known about it. This sample is from a page built for the scraper's tests:
{
"url": "https://docs.widgetlib.org/en/stable/quickstart.html",
"final_url": "https://docs.widgetlib.org/en/stable/quickstart.html",
"status": 200,
"content_type": "text/html",
"title": "Quickstart — widgetlib 2.4 documentation",
"description": null,
"language": "en",
"canonical_url": null,
"markdown": "# Quickstart\n\nInstall `widgetlib` with pip:\n\n```console\n$ pip install widgetlib\n```\n\n## Your first widget\n\n```python\nfrom widgetlib import Widget\n\nw = Widget(size=3)\nprint(w.render()) # ``<widget size=3>``\n```\n\nNote\n\nSee [the API … [truncated]",
"text_length": 299,
"word_count": 46,
"links": [
{
"url": "https://docs.widgetlib.org/en/stable/api.html",
"text": "API reference",
"same_site": true
},
{
"url": "https://docs.widgetlib.org/en/stable/index.html",
"text": "Home",
"same_site": true
}
],
"metadata": {
"open_graph": {},
"json_ld": []
},
"truncated": false,
"depth": null,
"fetched_at": "2026-11-19T18:07:42.607328Z"
}Beside markdown itself, a few fields earn their place in a pipeline:
final_urlandcanonical_url: where the page ended up after redirects, and the address the page gives as its own. Use them to avoid storing one page twice under two addresses.word_countandtext_length: how much there is, before you spend tokens on it.truncated:truewhen the page was too long and was cut. A summary of part of a page should know it is one.links: the links on the page, once each. They are the next pages to read if you are following a site.language: so you can route or skip a page without reading it.
What people build on it
- Retrieval. Split the Markdown at its headings and each piece is a coherent section with its title attached. That makes better chunks than cutting HTML every thousand characters.
- Question answering over a page. Give the model the Markdown and the question. The answer can quote the page, and the links in it are real.
- Keeping a copy. Markdown differs cleanly: store today's and tomorrow's and a plain text diff shows what the page changed.
The scraper's page lists every field: Web page to Markdown. To let an assistant call it by itself, see web data for AI agents.
Questions
- Why give a language model Markdown instead of HTML?
- Markdown keeps the structure a reader needs (headings, lists, links, code) in far fewer characters, so the model reads the content and not the page's markup.
- How do I know if the page was cut short?
- The record's truncated field is true when the text was shortened.
- Can it read pages that need a login?
- No. It reads public pages as a signed-out visitor is served them.