# Web Scraping API

POST /v1/scrape turns any URL into clean, LLM-ready markdown or JSON in one call. Built as a web scraping API for AI agents and RAG pipelines, the same MIT engine covers scrape, crawl, map, search and extract over REST and hosted MCP. Self-host it, or start free with 1,000 credits a month and no card.

## How to call it

### Scrape a URL to markdown

```
curl -s -X POST https://webcrawl.app/v1/scrape \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'
```

### Search

```
curl -s -X POST https://webcrawl.app/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"open source web scraping API","limit":5}'
```

### TypeScript client

```
import { createClient } from "@webcrawl/client";

const client = createClient({ apiKey: process.env.WEBCRAWL_API_KEY });
const page = await client.scrape({ url: "https://example.com" });
console.log(page.markdown);
```

Credits from creditSchedule: scrape/map/crawl page or search 1; extract 3; structured surcharge +2. See GET /health.

Docs: [/docs/api](https://webcrawl.app/docs/api).
GitHub: https://github.com/brainfish-ai/webcrawl-anything.
Sign up: [/signup](https://webcrawl.app/signup).

## Why AI developers pick this web scraping API.

- One POST /v1/scrape call returns LLM-ready Markdown by default, with optional JSON structured extraction
- Hosted MCP server (https://webcrawl.app/mcp) plus @webcrawl/mcp so agents can search, read, map, crawl and extract
- Scrape, crawl, map, search and extract in one MIT-licensed API surface
- Hosted credits with a free monthly allowance, or self-host the same engine

## MCP for AI agents

Connect Claude Desktop, Cursor, or any MCP client to https://webcrawl.app/mcp or run npx @webcrawl/mcp with WEBCRAWL_API_KEY. Agents get web_read, web_search, web_map, web_crawl, and web_extract over the same billing and engine as the REST API.

## Scrape

POST /v1/scrape turns one URL into Markdown or JSON. 1 credit per page, plus 2 when you add prompt, schema or extract fields. Start here when you already know the URL.

## Crawl

POST /v1/crawl reads many pages from a start URL at 1 credit per page. Use path include and exclude filters, and async mode when you want a run id to poll.

## Map

POST /v1/map lists page URLs without reading full bodies. 1 credit per call. Map first when you want to choose which URLs to scrape or crawl.

## Search

POST /v1/search runs live web search with ranked results. Optional structured categories and scrapeOptions to read each result page in the same workflow.

## Extract

POST /v1/extract pulls structured JSON from a URL with a prompt or schema (3 credits). Or pass prompt/schema on scrape to get Markdown and structured data together.

Related: [URL to Markdown](https://webcrawl.app/url-to-markdown), [Scrape](https://webcrawl.app/scrape), [Crawl](https://webcrawl.app/crawl), [Search](https://webcrawl.app/search), [Docs](https://webcrawl.app/docs), [Compare Firecrawl](https://webcrawl.app/compare/firecrawl), [ScraperAPI alternatives](https://webcrawl.app/alternatives/scraperapi), [Tavily alternatives](https://webcrawl.app/alternatives/tavily), [SerpAPI alternatives](https://webcrawl.app/alternatives/serpapi), [Exa alternatives](https://webcrawl.app/alternatives/exa), [Jina Reader alternative](https://webcrawl.app/alternatives/jina-reader), [Alternatives](https://webcrawl.app/alternatives), [Best web scraping APIs for LLMs](https://webcrawl.app/blog/best-web-scraping-apis-for-llms), [Open source web scraping tools](https://webcrawl.app/blog/best-open-source-web-scraping-tools).

## FAQ

### What is a web scraping API?

A web scraping API fetches a page for you and returns structured content your app can use. Webcrawl turns a URL into clean Markdown or JSON over REST and MCP, so agents and RAG pipelines do not parse raw HTML for every site.

### Is there a free tier, and how does pricing work?

Free includes 1,000 credits a month with no card. Pro starts at $20 for 10,000 credits on /pricing. Live per-endpoint costs are on GET /health as creditSchedule.

### What output formats does the API return?

Scrape returns Markdown by default, with optional JSON structured extraction via prompt or schema on the same request. Extract returns structured JSON. Search returns ranked results, and you can scrape those pages in the same workflow.

### Can AI agents use Webcrawl over MCP?

Yes. Point MCP clients at https://webcrawl.app/mcp, run npx @webcrawl/mcp with WEBCRAWL_API_KEY, or call REST with @webcrawl/client. The MCP server exposes search, read, crawl, map and extract tools.

### Can I self-host this web scraping API?

Yes. The engine is MIT licensed at https://github.com/brainfish-ai/webcrawl-anything. Use the hosted API, or run the same packages yourself for CLI, MCP and self-hosted deployments.

HTML: https://webcrawl.app/web-scraping-api
