New1 billion tokens free on sign-up — crawl, parse, chunk and embed on the houseSee pricing
SarvCrawlSarvCrawl

Glossary · Extraction and parsingUpdated

What is a web scraping API?

A web scraping API is a hosted service that fetches web pages on your behalf and returns their content in a structured form, such as markdown, HTML or JSON, through an HTTP request. It replaces running your own browsers, queues and parsers.

01Web scraping APIs in more depthof 05

Web scraping APIs in more depth

Scraping a handful of static pages takes a few lines of code. Scraping thousands of modern pages reliably takes infrastructure: headless browsers for JavaScript rendering, queues, retries with backoff, timeouts, content extraction, Markdown conversion and storage. A web scraping API packages that behind an endpoint: send a URL and options, get content back.

APIs differ mainly in what they return and what they do after the fetch. Some return raw HTML and leave parsing to you; others return clean markdown or structured JSON; some go further and index the result for search.

How a scraping API works

  1. You authenticate, typically with an API key in a header.
  2. You send a URL and options: output formats, whether to keep only main content, timeouts.
  3. The service queues the job, renders the page in a browser and extracts the requested formats.
  4. You receive the result directly (synchronous) or a job id to poll or a webhook (asynchronous).

Asynchronous jobs are the norm for crawls and for anything that renders JavaScript, because a page can take many seconds and a crawl many minutes.

curl -s -X POST https://crawl.sarv.com/api/jobs/scrape \
  -H "x-api-key: $KB_API_KEY" -H "Content-Type: application/json" \
  -d '{"kb_id":"kb_abc123","url":"https://example.com","formats":["markdown","links"]}'
# → {"job_id":"…","status":"queued"}

Build or buy, and what to compare

Running your own stack makes sense for a few predictable sites, or when you need full control. An API makes sense when you need many sites, JavaScript rendering, or want to skip operating a browser fleet. When comparing services, check:

  • Output quality. Look at the markdown for your own pages, not a demo.
  • Formats. Markdown, HTML, links, screenshots, structured JSON.
  • Crawl controls. Depth, page limits, path filters, sitemap discovery.
  • What happens next. Do you get files back, or chunked and searchable data?
  • Integrations. SDKs, CLI, MCP for AI agents, workflow tools.
  • Pricing model and how failures are billed.

Common pitfalls are trusting a demo instead of testing your own pages, not handling the asynchronous job lifecycle, and assuming any API can access every site; logins, blocking and site terms still apply.

How SarvCrawl handles it

SarvCrawl is a scraping and crawling API whose results go straight into a knowledge base. The REST API at https://crawl.sarv.com/api authenticates with an x-api-key header and offers scrape, crawl, map, parse for uploaded documents, search and monitor. Pages are rendered in a real browser and returned as markdown, HTML, links, screenshots or JSON metadata, then chunked and embedded for keyword and hybrid semantic search on paid plans.

Clients include the sarvcrawl SDK for Node and Python, the sarv-kb CLI, an MCP server with 21 tools for AI agents, an n8n node and a Chrome extension. SarvCrawl does not focus on anti-bot evasion or proxy networks.

Frequently asked questions

What is the difference between a scraping API and a scraping library?

A library such as BeautifulSoup or Playwright runs in your code on your machines. An API runs the browsers and parsing as a hosted service and returns results over HTTP.

Do web scraping APIs handle JavaScript?

Most do, by rendering pages in a headless browser before extracting content. Check whether rendering is on by default or an extra option.

Why are scraping APIs asynchronous?

Rendering a page can take seconds and a crawl can take minutes, longer than an HTTP request should stay open. Returning a job id to poll, or calling a webhook, avoids timeouts.

SarvCrawl

Turn any site into a searchable knowledge base

Crawl pages and parse documents into clean markdown, then chunk, embed and search them from one API.