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.
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
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)
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.
{
"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.
Send a URL with preferences
Send url and formats.markdown with optional markdownParams in the JSON body
Page is fetched
Automatic proxy escalation retries blocked fetches
HTML converted to GFM
Page content is converted with your filtering preferences
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?
Why convert HTML to Markdown for LLMs and RAG?
Can I include or exclude links and images?
Does it work on JavaScript-heavy sites?
How do I convert HTML to Markdown from a URL?
What Markdown format does the API return?
How is this different from Jina Reader or Firecrawl?
Is it free for AI agent use?
Am I billed for failed requests?
How do I convert HTML to Markdown from a URL?
Why convert HTML to Markdown for LLMs and RAG?
What Markdown format does the API return?
Can I include or exclude links and images?
How is this different from Jina Reader or Firecrawl?
Does it work on JavaScript-heavy sites?
Is it free for AI agent use?
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.













