Skip to content
Markdown API · Use case

Convert bot-protected and blocked pages to Markdown

Convert a blocked page to Markdown with one extra option instead of a proxy subscription and a rotation script. News sites, marketplaces and documentation behind a CDN shield are the pages that agents, RAG crawlers and research tools most want to read, and the ones most likely to answer automated traffic with a challenge. The proxy parameter handles the unblocking inside the same Markdown request.

The problem

A blocked page converts to a challenge screen, not Markdown

Antibot services such as Cloudflare, DataDome and Akamai answer datacenter traffic with a JavaScript challenge, a CAPTCHA or a bare 403. Converted to Markdown, that is a heading that says “Just a moment” and no content. The pipeline records a success, moves on, and your index now has a hole where the article should be.

The usual workaround is a proxy vendor plus your own rotation logic: a list of exits to maintain, retries to tune per target and a second bill. It also splits one job across two systems, so when a conversion fails you have to work out whether the proxy, the browser or the parser was at fault. Scraping a Cloudflare site to Markdown should not need three moving parts.

On Pro plans Microlink includes automatic proxy resolution. Add proxy: true and the request leaves through a managed, rotating proxy pool, after Microlink identifies the antibot provider and picks the resolution path for it. When a target needs the proxy and you did not ask for it, the API fails with the EPROXYNEEDED error code instead of returning junk, so you know exactly which URLs to retry.

How it works

How to convert a blocked page to Markdown through the proxy

Try the direct request first, retry with the proxy only on EPROXYNEEDED, and cache the result so the proxy path runs once per URL. The proxy guide lists the other signals that a target is blocking you, such as empty results on a known-good URL.

1 · Convert through the managed proxy
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const markdown = await microlink.markdown('https://hard-target.com/article', {
  proxy: true,
  selector: 'article'
})

proxy: true routes the request through the managed pool, and the selector scopes the conversion to the article element. The call resolves to the Markdown string.

2 · Use the proxy only when the target needs it
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const convert = async url => {
  try {
    return await microlink.markdown(url)
  } catch (error) {
    if (error.code !== 'EPROXYNEEDED') throw error
    return microlink.markdown(url, { proxy: true, retry: 3, ttl: '1d' })
  }
}

The direct call runs first. Only targets that reject it take the proxy path, with three server-side retries for intermittent challenges and a one-day ttl so repeat reads come from the cache.

3 · The same request as a URL
curl 'https://pro.microlink.io/?url=https%3A%2F%2Fhard-target.com%2Farticle&data.markdown.attr=markdown&meta=false&proxy=true&embed=markdown' \
  -H 'x-api-key: $MICROLINK_API_KEY'

proxy is a Pro option, so the URL targets the pro endpoint and authenticates with your API key in the x-api-key header. embed=markdown returns the Markdown itself with a text/markdown content type.

Parameters used
  • proxy true for automatic proxy resolution, an object with location to pin a country, or your own proxy URL. Pro plans.
  • retry Server-side retries with exponential backoff for intermittent failures. Default 2.
  • ttl Cache lifetime of the converted page: 24 hours by default, 1 minute to 31 days on Pro plans.
  • headers Forward an accept-language or user-agent header when the target expects one. Pro plans.

Confirm the route with the x-fetch-mode response header: any value prefixed with proxy-, such as fetch-proxy or prerender-proxy, means the request went through the proxy. x-cache-status tells you whether the response was a MISS, a HIT or a BYPASS.

Why it works

Why the proxy belongs inside the Markdown API

Reaching the page and reading it are one problem for an agent. Splitting them across vendors doubles the failure modes, and troubleshooting a failed request is much shorter when one request owns the whole path.

01 · Provider-aware routing
Microlink identifies who is blocking and routes accordingly.
Rather than blindly rotating IPs, the resolution path depends on the antibot provider detected. Automatic proxy resolution is tested against the 500 most popular websites worldwide, which is where most agent and crawler traffic goes.

The same option unblocks screenshots of blocked websites and link previews for bot-protected sites, so one fix covers every workflow that touches the same domain.

02 · A signal you can act on
EPROXYNEEDED separates blocked from broken.
A blocked target fails with a specific code instead of returning a challenge page as content. Your pipeline can retry with the proxy, mark the domain or skip it, and nothing unreadable ever reaches the index.

The signal surfaces on every plan, including the free endpoint. Routing through the proxy is a Pro capability, and the pricing page lists the plans.

03 · Composable with cleaning and caching
Proxy, selector and cache in a single request.
The proxy fetches the page, the selector scopes the content and ttl keeps the result. Cache hits do not count against your quota, so the proxy path runs once per URL per cache lifetime.

When not to: the proxy does not sign you in or get you past a paywall. Pages behind authentication need forwarded headers, and content you are not permitted to access should stay out of the pipeline.

FAQ

How do I convert a Cloudflare-protected page to Markdown?

Add proxy: true to the Markdown request on a Pro plan. Microlink detects the antibot provider, routes the request through its managed proxy pool and converts the page it finally reaches. There is no separate proxy subscription to buy and no exit list to rotate.

Why does a blocked page convert to a “Just a moment” screen in Markdown?

The target served its antibot challenge instead of the article, and the conversion ran on that. Retry the same URL with proxy: true and scope the result with a selector such as article. If the content is also client-rendered, see Markdown from JavaScript-rendered pages.

How do I know a Markdown request went through the proxy?

Check the x-fetch-mode response header. A value prefixed with proxy-, such as fetch-proxy or prerender-proxy, means the request was routed through the proxy, and x-pricing-plan reports pro.

Can I use my own proxy for Markdown conversions?

Yes. Pass your proxy server as proxy.url in the form https://username:password@hostname:port, and Microlink routes every sub-request through it while still handling the browser, retries and errors. A custom proxy URL and proxy.location are exclusive.

Does the proxy let a Markdown conversion bypass paywalls or logins?

No. It only avoids the blocks that target automated traffic. Authenticated content still requires your own session forwarded through request headers, and only where you are permitted to access it.
Related use cases

Solve the next problem with the same API

Markdown from JavaScript-rendered pages

Render single-page apps in a real browser, wait for the content, then convert the finished DOM to Markdown.

Bulk Markdown conversion with caching

Convert thousands of URLs in parallel, cached per URL and refreshed in the background for cheap re-indexing.

YouTube transcripts as Markdown

Get the caption transcript of any watch, share or shorts URL as Markdown, with the video title, author and date.

LLM context from any URL

Compose Markdown, links, emails, metadata and tech stack from one URL into a context object for your agent.

Screenshot blocked websites

When a site blocks headless browsers, one option routes the capture through a managed, rotating proxy pool.

Link previews for bot-protected sites

Unfurl links to sites behind Cloudflare or DataDome by routing the metadata request through the built-in proxy.

Ready to read hard targets?

One option, no proxy list, clean Markdown from the pages that block everyone else. Get a Pro key and unblock your pipeline.