Introducing web search monitors

URL to Markdown API

Convert any website to LLM-ready Markdown with one call.

Convert rendered page content to GitHub Flavored Markdown for LLMs and RAG. Set sharedParams.mainContentOnly=true when you want best-effort removal of navigation and surrounding chrome.

Tune markdownParams for links and images, sharedParams for page filtering, and maxAgeMs for freshness.

Daydream logo
Kovai logo
Passionfroot logo
Orange logo
SendX logo
Klarna logo
Super.com logo
Daydream logo
Kovai logo
Passionfroot logo
Orange logo
SendX logo
Klarna logo
Super.com logo
Daydream logo
Kovai logo
Passionfroot logo
Orange logo
SendX logo
Klarna logo
Super.com logo
Daydream logo
Kovai logo
Passionfroot logo
Orange logo
SendX logo
Klarna logo
Super.com logo

Convert a URL to Markdown

Send an authenticated request, check the output status, and read markdown.data.

Create an API key and set CONTEXT_DEV_API_KEY in your shell for cURL. For the Node.js SDK, run npm install context.dev and replace YOUR_API_KEY with your server-side key. Keep the key on your server.

cURL

Shell
curl --request POST 'https://api.context.dev/v1/web/scrape' \
  --header "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com",
  "formats": {
    "markdown": true
  },
  "sharedParams": {
    "mainContentOnly": true
  },
  "maxAgeMs": 0
}'

Node.js SDK (TypeScript)

TypeScript
import ContextDev from 'context.dev';

type ScrapeResult = {
  markdown: { success: boolean | null; data: string | null };
};

const client = new ContextDev({ apiKey: 'YOUR_API_KEY' });
const page = await client.post<ScrapeResult>('/web/scrape', {
  body: {
    url: 'https://example.com',
    formats: { markdown: true },
    sharedParams: { mainContentOnly: true },
    maxAgeMs: 0,
  },
});

if (!page.markdown.success || page.markdown.data === null) {
  throw new Error('Markdown extraction failed');
}

console.log(page.markdown.data);

Successful response

Illustrative excerpt; other output envelopes and request metadata are omitted.

JSON
{
  "url": "https://example.com/",
  "markdown": {
    "requested": true,
    "success": true,
    "data": "# Example Domain\n\nThis domain is for use in documentation examples without needing permission. Avoid use in operations.\n\n[Learn more](https://iana.org/domains/example)"
  }
}

Content filtering. sharedParams.mainContentOnly: true attempts to remove navigation, headers, footers, and sidebars. Review the output for your target pages; filtering is best effort. Omit it when you need the full page.

Freshness. These examples set maxAgeMs: 0 to request a fresh fetch. The default cache age limit is three days (259,200,000 milliseconds). Set a larger acceptable age when cached content fits your workflow.

Partial failures. An HTTP 200 does not mean every requested format succeeded. Check markdown.success before using markdown.data, and check each output separately when requesting multiple formats. Read key_metadata.credits_consumed for the actual charge.

Try a page in the free URL to Markdown converter, or see all options in the Scrape API reference.

What You Get

Each request converts a webpage into structured Markdown, subject to the requested cache age.

GitHub Flavored Markdown

Tables, headings, lists, and code blocks fully converted

Configurable links & images

Control whether hyperlinks and image references are preserved

Base64 image shortening

Prevent token bloat from inline image data in AI pipelines

Automatic proxy escalation

Retries with proxies when a page blocks the initial fetch

How it works

We fetch the page, handle proxy escalation, and convert HTML to Markdown for you.

  1. Send a URL with preferences

    Send url and formats.markdown with optional markdownParams in the JSON body

  2. Page is fetched

    Automatic proxy escalation retries blocked fetches

  3. HTML converted to GFM

    Page content is converted with your filtering preferences

  4. Markdown returned

    Ready to pass directly to any LLM, vector store, or content pipeline

Frequently asked questions

Common questions about the Context.dev HTML to Markdown API, part of the web scraping API.

Am I billed for failed requests?
Most failed requests are not billed. Not-found responses (404) are billed at the request’s base price. Scrape can return a 200 with failed outputs: it charges when at least one output succeeds or the target page is missing. Check key_metadata.credits_consumed for the amount charged.
How do I convert HTML to Markdown from a URL?
Send a POST request to /v1/web/scrape with url and formats: { markdown: true }. Read GitHub Flavored Markdown from markdown.data. Set sharedParams.mainContentOnly to true for best-effort removal of headers, footers, sidebars, and navigation.
Why convert HTML to Markdown for LLMs and RAG?
Markdown removes HTML tags and styling while retaining headings, lists, links, and code blocks. This can reduce the text you send to an LLM; token savings depend on the page, filtering options, and tokenizer.
What Markdown format does the API return?
GitHub Flavored Markdown (GFM). It's the de facto standard for LLM-readable text, supports tables and code blocks, and renders correctly in Claude, ChatGPT, Gemini, Cursor, and most documentation systems out of the box.
Can I include or exclude links and images?
Yes. Set markdownParams.includeLinks (default true) and markdownParams.includeImages (default false). Use markdownParams.inlineImages with placeholder or preserve to control inline image data in Markdown.
How is this different from Jina Reader or Firecrawl?
Markdown is one output format of the Scrape API. Request it alongside HTML, images, screenshots, bytes, or parsed fields in one call. The same API key also works with brand retrieval, styleguides, search, and Answers.
Does it work on JavaScript-heavy sites?
Yes. The fetcher renders JavaScript when the target is a single-page app, then converts the post-render DOM to Markdown. You don't pick a mode. The API picks the right strategy based on the URL.
Is it free for AI agent use?
Yes. The free tier includes 1,000 API credits every month with 2 concurrent requests, enough for 1,000 one-credit Markdown conversions. Production volume scales linearly with no annual contract.

Ship an agent that actually knows things.

Free tier, 10-minute integration, and the same API powering agents at Mintlify, daily.dev, and Propane. No credit card to start.

1,000free credits

Every month. No credit card required.

Start for freeRead the docs