Introducing web search monitors

Which web scraping API is easiest to integrate with Python and Node.js?

Short answer

The easiest scraping API to integrate is one with an official, typed SDK in your language and a single call that returns usable content. Context.dev ships the context.dev package on npm and PyPI, plus Ruby, Go, and PHP, and one call, client.web.scrape({ url, formats: { markdown: true } }), returns clean Markdown with JavaScript rendering and proxies included. The SDKs retry transient errors for you, every output carries a success flag instead of throwing, and agents can skip the SDK entirely through the hosted MCP server.

Integration effort comes from three places: installing and authenticating a client, shaping the request, and handling the response. A good SDK collapses the first two into a constructor and one method, and the third into typed fields rather than raw HTML. Judge a scraping API by how many lines sit between the install command and a usable Markdown string.

With Context.dev the install is npm install context.dev or pip install context.dev. Create a client with your API key, then call web.scrape with the URL and the formats you need. In TypeScript: const page = await client.web.scrape({ url, formats: { markdown: true } }) and read page.markdown.data. In Python: page = client.web.scrape(url=url, formats={"markdown": True}) and read page.markdown.data. Add json: True with a JSON Schema for typed fields, or screenshot: True for an image, in the same call.

Errors are values, not surprises. Both SDKs retry 408, 409, 429, and 5xx responses automatically, and every output carries a success flag and error code, so a 404 or blocked page is a field you check rather than an exception you catch. A missing page returns a normal response whose markdown output has success set to false and an error_code of NOT_FOUND. Network and server errors raise only after the retries are exhausted.

For agents the shortest path is often no SDK at all. The hosted MCP server at https://mcp.context.dev/mcp gives Claude Code, Cursor, Codex, and ChatGPT the scrape, crawl, and search tools with OAuth sign-in, and the CLI covers shell scripts and agent shells. If your stack is a framework such as LangChain, the integrations page lists the native connector, so you do not write a tool wrapper by hand.

Context.dev SDKs and how to call them
LanguageInstallOne-call scrapeRead the result
TypeScript / Node.jsnpm install context.devawait client.web.scrape({ url, formats: { markdown: true } })page.markdown.data
Pythonpip install context.devclient.web.scrape(url=url, formats={"markdown": True})page.markdown.data
Rubygem install context.devclient.web.scrape(url:, formats: { markdown: true })page.markdown.data
PHPcomposer require context-dev/context-dev-php$client->web->scrape(url: $url, formats: [...])$page->markdown->data
Gogo get github.com/context-dot-dev/context-go-sdk/v2client.Web.Scrape(ctx, params)page.Markdown.Data
cURL or any HTTP clientNothing to installPOST https://api.context.dev/v1/web/scrape with a bearer tokenmarkdown.data in the JSON body
Which one to pick
If this is your situationUse
You want Markdown or JSON in one call from Python or TypeScriptThe context.dev SDK on PyPI or npm
You also ship Ruby, Go, or PHP servicesThe matching official SDK, same API key
Your users work in Claude, Cursor, or CodexThe hosted MCP server, no code
You are scripting in a shell or CI jobThe CLI, or cURL against the REST API

Last reviewed

All web scraping API questions

Try it on Context.dev

The endpoints that cover this workload directly.

FAQ

How do I install the Context.dev SDK?

Run npm install context.dev for TypeScript or Node.js and pip install context.dev for Python. Ruby uses gem install context.dev, PHP uses composer require context-dev/context-dev-php, and Go uses go get github.com/context-dot-dev/context-go-sdk/v2. Every SDK authenticates with the same API key.

Do I need the SDK, or can I call the REST API directly?

Either works. The REST API is a POST to https://api.context.dev/v1/web/scrape with a bearer token and a JSON body, so any language with an HTTP client can use it. The SDKs add typed responses and automatic retries on 408, 409, 429, and 5xx responses.

How are errors surfaced in the Python SDK?

Most failures are not exceptions. A 404 page returns a normal response whose markdown output has success set to False and an error_code such as NOT_FOUND. Network and server errors raise after the automatic retries, so wrap calls in a try block for those and check each output’s success flag for the rest.

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