HTML to Markdown for AI Agents
Pricing
from $1.00 / 1,000 results
HTML to Markdown for AI Agents
Convert HTML or public web pages into clean Markdown for AI agents, RAG pipelines, and automation workflows.
Pricing
from $1.00 / 1,000 results
Rating
0.0
(0)
Developer
Leonardo Freitas
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Share
Convert HTML or a publicly reachable web page into compact, predictable Markdown. This is an API-first building block for AI agents, RAG pipelines, content normalization, and automation workflows—not a human-facing application.
What it does
- Converts supplied HTML without making a network request.
- Fetches one public HTTP(S) URL and converts its returned HTML to Markdown.
- Preserves common headings, links, emphasis, lists, line breaks, and fenced code blocks.
- Removes scripts, styles, comments, and remaining HTML tags.
Input
Provide exactly one of html or url.
| Field | Type | Description |
|---|---|---|
html | string | HTML to convert. Maximum 1,000,000 characters. |
url | string | Public HTTP(S) URL to fetch and convert. Maximum 2,048 characters. |
Convert supplied HTML
{"html": "<h1>Release notes</h1><p>Use <strong>Markdown</strong> downstream.</p><ul><li>Fast</li><li>Portable</li></ul>"}
Convert a public URL
{"url": "https://example.com/"}
Output contract
Each processed run writes one standardized execution envelope to the default Dataset. If a caller's Apify maximum-charge limit cannot cover a paid result, the Actor stops before processing and writes no Dataset item.
{"tool": "html-to-markdown","version": "0.1.0","startedAt": "2026-01-01T00:00:00.000Z","finishedAt": "2026-01-01T00:00:00.000Z","durationMs": 12,"success": true,"data": {"markdown": "# Release notes\n\nUse **Markdown** downstream.\n\n- Fast\n- Portable","sourceUrl": "https://example.com/"}}
sourceUrl is returned only when url was used. Consumers should check success before reading data.
The Actor also declares an Apify Output schema and Dataset schema, so API clients and AI agents can discover the Dataset URL and the meaning of each result field.
Call it from an agent or API
Use the canonical synchronous Apify endpoint when a caller needs the Dataset item as the response. Replace <actor-id-or-name> with the Actor identifier shown in Apify and keep the token in an authorization header.
curl --request POST \"https://api.apify.com/v2/actors/<actor-id-or-name>/run-sync-get-dataset-items" \--header "Authorization: Bearer $APIFY_TOKEN" \--header "Content-Type: application/json" \--data '{"html":"<h1>Hello agent</h1><p>Normalized content.</p>"}'
The response is an array containing the Dataset item. Never place an API token in a URL, log, prompt, or source repository.
Safety and limits
For URL input, the Actor permits only public HTTP(S) destinations. It rejects localhost, private and reserved IP ranges, cloud metadata hosts, credentials in URLs, unsupported ports, and unsafe redirects. DNS resolution is checked before connecting.
The fetch path is bounded to a 1 MB response, three redirects, and a short execution timeout. It does not execute remote JavaScript, use browser rendering, authenticate to websites, or fetch protected pages. Use supplied html when the source is already available to your workflow.
Do not submit credentials, private documents, or personal data unless you have the right to process them in your Apify account.
Errors
Failures are returned as success: false with errorType and a sanitized errorMessage. Common error types include INVALID_INPUT, INVALID_URL, SSRF_BLOCKED, HTTP_ERROR, TIMEOUT, RESPONSE_TOO_LARGE, and TOO_MANY_REDIRECTS.
Product status
Version 0.1.0 is a beta utility. Pricing, public availability, and future MCP or agentic-payment access are configured in Apify; this Actor remains intentionally small and deterministic.