A website-to-Markdown API should return readable main content, not a mechanical dump of every DOM node. Good output preserves headings, lists, links, tables, and code while removing navigation, cookie banners, scripts, and repeated footers.
Use an API when pages need JavaScript rendering, anti-bot handling, or conversion at scale. A local HTML converter remains useful for static, already-downloaded pages.
Validate Markdown with content checks, not HTTP status alone. Require a title, meaningful text length, expected phrases, final URL, and source metadata before accepting a result.
Nstproxy Crawl provides URL-to-Markdown extraction through a managed crawl API. The examples below use the live authentication route verified on September 3, 2026.
Markdown is a compact bridge between the web and AI systems. It preserves the hierarchy that helps a model understand an article while discarding much of the layout machinery that inflates raw HTML. That makes it useful for RAG ingestion, summarization, search indexing, content monitoring, and agent context.
Conversion is not merely an HTML-to-text operation. Modern pages may render their body after JavaScript executes, vary by region, redirect through consent flows, or hide the article behind navigation-heavy templates. A reliable website-to-Markdown API must first retrieve the right page state, then extract and normalize its meaningful content.
Use Nstproxy Crawl when you want one managed request to handle page retrieval and structured output. It is especially useful for batches that mix static and JavaScript-rendered pages or need proxy-backed access without operating browser workers yourself.
Nstproxy Crawl documentation describes scrape and crawl workflows plus formats such as Markdown, JSON, screenshots, and PDF. Pay-per-use and optional credit plans let teams choose between irregular and predictable workloads; proxy traffic is accounted for separately. Confirm current behavior and billing before a large run.
A local converter can be better when you already possess trusted HTML, the page is static, and no browser or network orchestration is required. Tools such as Turndown transform HTML into Markdown, but they do not solve page access, rendering, redirects, or main-content selection by themselves.
Why Markdown Is Better Than Raw HTML for LLM Workflows
Raw HTML contains valuable semantics, but it also contains CSS classes, tracking attributes, scripts, accessibility controls, navigation, and repeated components. Feeding it directly to a model consumes context on tokens that rarely help answer a question.
Clean Markdown offers several advantages:
headings expose document structure;
lists and tables retain relationships;
links keep source references visible;
fenced code can remain distinct from prose;
text is easy to diff, hash, chunk, search, and audit;
humans can inspect the same representation sent downstream.
Markdown is not universally smaller or more accurate. Complex interactive widgets, merged table cells, charts, and spatial layouts can lose meaning. For such pages, store the original HTML or a screenshot beside the Markdown. Treat Markdown as the primary text view, not the only evidence artifact.
Consistency also matters. CommonMark provides a widely implemented baseline, but tables and task lists often rely on extensions. Decide which dialect your downstream parser accepts and test fenced code, nested lists, link escaping, and tables.
Convert One URL to Markdown With the API
The current Nstproxy scrape route below was probed without credentials and returned an authentication response, confirming that the route exists. A successful crawl could not be verified without a real API key, so treat the request body as a documentation-aligned starting point and confirm fields in your account.
Do not paste a key directly into source control or a notebook. Load it from a secret manager or environment variable. Log a request ID and target URL, but redact authorization headers and sensitive page data.
Because the example uses asynchronous mode, your integration may receive a job identifier rather than the final document immediately. Follow the status/result flow documented for the current API version. Add a bounded timeout and exponential backoff; do not poll indefinitely.
Nstproxy’s Firecrawl Scrape endpoint guide provides a useful comparison point for teams migrating an existing scraper integration.
What a Useful Markdown Response Must Contain
Exact response envelopes can change, but your application contract should not. Normalize the provider response into an internal record with these fields:
Field
Acceptance check
requested_url
Matches the queued target
final_url
Captures redirects and canonical destination
status
Indicates completed retrieval
title
Nonempty and plausible
markdown
Contains meaningful main content
retrieved_at
Allows freshness decisions
content_hash
Enables deduplication and change detection
language
Matches the expected corpus when required
Set quality thresholds by content class. A product page, API reference, and short announcement should not share one minimum length. Pair generic rules with domain-specific checks—for example, require an API reference page to contain at least one expected endpoint or heading.
Do not assume status 200 means success. The returned Markdown could be a login wall, bot challenge, cookie dialog, or region notice. Search for known failure signatures and retain a screenshot for ambiguous cases.
Batch-Convert Websites to Markdown Safely
Batch conversion needs concurrency control, retry policy, idempotency, and per-host politeness. Start with low concurrency, respect site rules, and separate transient errors from permanent failures.
This Python example reads one URL per line, submits jobs with the standard library, and writes the raw JSON responses as JSON Lines. It was syntax-checked with Python 3. A full run requires NSTPROXY_API_KEY, network access, and current account-specific response handling, so it is a prerequisite-gapped example rather than a claimed live success.
import json
import os
import time
import urllib.error
import urllib.request
API_URL ="https://api.nstproxy.com/api/v1/crawl/scrape?async=true"API_KEY = os.environ["NSTPROXY_API_KEY"]defsubmit(url:str, attempts:int=3)->dict: payload = json.dumps({"url": url,"formats":["markdown"]}).encode() request = urllib.request.Request( API_URL, data=payload, method="POST", headers={"Authorization":f"Bearer {API_KEY}","Content-Type":"application/json",},)for attempt inrange(attempts):try:with urllib.request.urlopen(request, timeout=60)as response:return json.load(response)except urllib.error.HTTPError as exc:if exc.code notin{429,500,502,503,504}or attempt == attempts -1:raiseexcept urllib.error.URLError:if attempt == attempts -1:raise time.sleep(2** attempt)raise RuntimeError("unreachable")withopen("urls.txt", encoding="utf-8")as source,open("jobs.jsonl","w", encoding="utf-8")as output:for line in source: url = line.strip()ifnot url or url.startswith("#"):continue result = submit(url) output.write(json.dumps({"url": url,"result": result})+"\n") output.flush()
This intentionally submits sequentially. Add a small worker pool only after measuring per-host limits and account quotas. Preserve the input URL with each result so an out-of-order response can never be attached to the wrong source.
For a full-site crawl, begin with discovery and filtering rather than feeding every link back into a single-page endpoint. Nstproxy’s explanation of scraping versus crawling helps choose the correct workflow.
Clean Markdown for LLM-Ready Output
Provider extraction removes much noise, but downstream cleanup still needs explicit rules. Normalize line endings and whitespace, remove repeated boilerplate, resolve relative links against the final URL, and preserve heading levels. Avoid regex-only parsing of arbitrary Markdown when a proper parser is available.
Then derive two versions:
Display Markdown: faithful content used for citations and human review.
Embedding text: title and heading breadcrumbs prepended to clean body text, possibly with links simplified.
Never overwrite the display artifact with model-generated “cleanup.” A language model can silently paraphrase facts or omit caveats. If AI-assisted normalization is necessary, retain the exact extracted version and record the transform and model version.
For RAG, split Markdown after normalization. Keep tables and code blocks together, attach the source URL to every chunk, and use a content hash to avoid re-embedding unchanged pages. For live agent workflows, the web search MCP server guide shows a complementary pattern for gathering current evidence.
Reliability, Security, and Compliance
Follow redirects only to approved schemes and hosts. If users can supply URLs, defend against server-side request forgery: block localhost, private network ranges, cloud metadata endpoints, non-HTTP schemes, and DNS rebinding. Revalidate the resolved address after redirects.
Apply response size and time limits. A page can be technically valid but too large for your processing budget. Use idempotency or content hashes so retries do not create duplicate records.
Respect robots instructions, terms, authentication boundaries, copyright, privacy, and applicable law. The robots.txt standard explains crawler directives, while HTTP Semantics defines status and request behavior your retry logic relies on.
Treat extracted Markdown as untrusted content. It may contain prompt injection or malicious links intended for an AI agent. Retrieval text should never be able to override system instructions or grant tools new permissions.
When to Use Nstproxy, Firecrawl, or a Local Converter
Use Nstproxy Crawl for managed retrieval with pay-as-you-go flexibility, multiple output formats, and proxy-backed web access. Use Firecrawl when its developer workflow or specific extraction features fit your existing stack; compare its current converter and API on representative pages. Nstproxy’s Claude Web Fetch vs Firecrawl comparison adds context for model-centric workflows.
Use a local converter when HTML is already available and trusted. This is the simplest, most reproducible choice for static archives or test fixtures. A hybrid design is common: a managed API fetches and renders pages, while local code applies organization-specific normalization and storage.
Evaluate providers on accepted Markdown, not raw request success. Score main-content completeness, heading accuracy, table/code preservation, redirect handling, latency, and cost per accepted document.
Before launch, confirm API secrets are managed securely; URL inputs are validated; robots and access policies are enforced; retries are bounded; output has canonical URL and timestamps; raw responses are retained where appropriate; Markdown quality gates reject challenges and login walls; deleted or changed pages propagate downstream; and monitoring tracks accepted documents rather than HTTP responses alone.
The simplest useful architecture is also the most auditable: retrieve once, preserve the raw result, normalize deterministically, validate, version, and only then send Markdown to an LLM or index.
A URL-to-Markdown API retrieves a web page, renders it when necessary, extracts meaningful content, and returns a Markdown representation suitable for search, RAG, summarization, or storage.
Q: Is Markdown better than HTML for LLMs?
Clean Markdown is often more token-efficient and easier to chunk because it removes page chrome while preserving structure. Retain HTML or screenshots when layout fidelity, reprocessing, or evidence preservation matters.
Q: Can a website-to-Markdown API handle JavaScript pages?
A browser-capable API can render JavaScript pages, but results still depend on timing, access conditions, consent flows, and extraction rules. Validate the extracted body instead of relying on HTTP status alone.
Q: How do I convert many URLs to Markdown?
Use a bounded queue, low per-host concurrency, retries only for transient errors, content-quality checks, and a stable mapping between every input URL and result. Respect site policies and provider quotas.
Marcus Chen
Sep. 3rd 2026
110M+ real IPs with 99.9% access success
Blazing-fast average response ~0.5s for high-concurrency tasks
From only $0.1/GB
Get immediate access to premium residential, datacenter, IPv6 and ISP proxy pools.