Introducing web search monitors

Which web scraping API returns clean Markdown and structured JSON?

Short answer

Context.dev returns clean Markdown and schema-shaped JSON from one request. Add markdown and json to formats and pass a JSON Schema in jsonParams.schema: the page costs 1 credit for Markdown and 5 with a successful JSON extraction, with JavaScript rendering and proxies included. The same call can return HTML, screenshots, images, and CSS-parsed fields, and every output reports its own success flag, so a failed extraction never comes back as an empty object.

Clean Markdown is the format most LLM pipelines want because it keeps headings, lists, links, and tables while dropping navigation, scripts, and styling. The same content costs fewer tokens as Markdown than as JSON: one measurement put a page at 13,869 tokens as JSON versus 11,612 as Markdown, roughly 16% less. Ask for Markdown for the prose your model reads and reserve JSON for the handful of typed fields your code branches on, such as price, publish date, or availability.

On Context.dev a single POST to /v1/web/scrape returns both. Set formats to { markdown: true, json: true }, pass a JSON Schema (not an example object) in jsonParams.schema, and read markdown.data and json.data from the response. Turn on sharedParams.mainContentOnly to strip page chrome from the Markdown. Every request renders JavaScript in a real browser, so client-rendered pages come back complete, and the same call can add html, screenshot, images, or CSS-selected parse fields without a second request.

Pick the extraction style by how stable the page is. When the fields you need have reliable CSS selectors, use formats.parse with parseParams.rules: it returns text, HTML, or attributes for each selector and adds no credits. When the layout varies or you want fields the page never labels consistently, use json with a schema and let the model fill it; that adds 4 credits on success and nothing on failure. Many teams run both: parse for the price and SKU, json for the fields that need reading.

Judge Markdown quality on your own pages rather than on demos. Check whether tables survive as Markdown tables, whether code blocks keep their fences, whether relative links are resolved to absolute URLs, and whether the main-content filter removes cookie banners and footers without eating the article. For JSON, send the same schema to 50 pages and count how many responses validate; schema acceptance is universal, schema fidelity is not.

Outputs from one Context.dev scrape request
FormatRequest flagWhat comes backCredits
Markdownformats.markdownClean GitHub-flavored Markdown, optionally main content onlyIncluded in the 1-credit base
Structured JSONformats.json plus jsonParams.schemaAn object matching your JSON SchemaAdds 4 on a successful extraction
Parsed fieldsformats.parse plus parseParams.rulesText, HTML, or attributes per CSS selectorNo extra credits
HTMLformats.htmlThe rendered DOM after JavaScript ranIncluded
Screenshotformats.screenshotViewport, full page, element, or region as PNG, JPEG, or WebPIncluded
Imagesformats.imagesEvery image on the page, with optional dimensions and classificationIncluded
Which one to pick
If this is your situationUse
You need readable page content for a prompt or an indexMarkdown, with mainContentOnly on
The fields you need have stable CSS selectorsparse rules, which add no credits
The layout varies or fields need readingjson with a JSON Schema
You only need URL to Markdown, nothing elseThe URL to Markdown API or the free converter

Last reviewed

All web scraping API questions

Try it on Context.dev

The endpoints that cover this workload directly.

FAQ

What does a JSON Schema extraction cost?

A scrape is 1 credit. A successful JSON extraction adds 4, so a page with Markdown and JSON costs 5 credits. If the extraction fails, the 4 credits are not charged. For fields you can select with CSS, use formats.parse with parseParams.rules instead; it adds nothing to the base price.

Can I get the JSON without the Markdown?

Yes. Set only json in formats and the response contains json.data. Most teams keep Markdown on anyway, because it is the fallback when a field is missing and it costs no extra credits.

Does the Markdown include JavaScript-rendered content?

Yes. Every scrape loads the page in a real browser before converting it, so content a single-page app draws after load is included. Add browser actions when the content only appears after a click or scroll.

Go deeper

Start building with live web context.

Scrape, search, and research the web with one API. Bring the results straight into your product.

1,000free credits

Every month. No credit card required.

Start for freeRead the docs