Web Page to Markdown | Character Limit for AI Agents avatar

Web Page to Markdown | Character Limit for AI Agents

Pricing

from $1.00 / 1,000 converted pages

Go to Apify Store
Web Page to Markdown | Character Limit for AI Agents

Web Page to Markdown | Character Limit for AI Agents

Convert one public HTML page into Markdown for an AI prompt or RAG pipeline. Set maxChars to cap the output in Unicode characters. Each result includes the page title, final URL, original length and a flag showing whether the Markdown was truncated. Works with static HTML.

Pricing

from $1.00 / 1,000 converted pages

Rating

0.0

(0)

Developer

Wayturn Hung

Wayturn Hung

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

11 days ago

Last modified

Categories

Features

Limited permissions

Share

Give a research agent the main text of one public, static HTML page. Set a character budget before fetching it. The result includes Markdown, the title and the final URL for citation.

Try a 200-character excerpt

In a test with the page below, the extracted Markdown was 9,349 Unicode characters long. This input returned exactly 200 characters with truncated set to true. The source page can change over time.

{
"url": "https://docs.apify.com/platform/proxy/google-serp-proxy",
"maxChars": 200
}

Input

FieldTypeDefaultDescription
urlstringhttps://example.com/Public http(s) URL. Private, loopback and link-local addresses are blocked, including via DNS and redirects.
maxCharsinteger8000Maximum Unicode characters in markdown (100 to 200000).

Output

One dataset item:

FieldDescription
urlThe URL you requested
finalUrlThe URL after redirects
titlePage title
markdownMain content as Markdown (headings, links and lists preserved)
truncatedtrue if the content was cut to maxChars
originalLengthLength of the full Markdown in Unicode characters

How it works

  1. Validates the URL and the maxChars range.
  2. Resolves the hostname and blocks any private or reserved address. Each redirect hop is re-checked.
  3. Fetches static HTML with a 20 second timeout, a 5 MB body cap and up to 5 redirects.
  4. Removes scripts, styles, navigation, headers, footers, sidebars and forms.
  5. Uses <main>, <article> or [role=main] when present, otherwise <body>.
  6. Converts to Markdown and truncates by Unicode code point.

Failures stop the run with an explicit message, for example an HTTP error, a timeout, a non-HTML content type, or a blocked private address.

Limits

  • Static HTML only. Pages that need JavaScript to render their content return little or no text.
  • No login, cookies or custom headers.

Cost

A converted page costs $0.001. The start fee is $0.00005 per allocated GB (minimum one event). At 1 GB, converting one page costs $0.00105.

Local development

npm install
apify run

Put a test input in storage/key_value_stores/default/INPUT.json, for example {"url": "https://example.com/", "maxChars": 500}.