# Scrape

`POST /v1/scrape` fetches a page and returns its content as Markdown (full page by default). Costs 1 credit per page, plus 2 when structured extraction is requested. Matching `/v2/scrape` and `/api/v1/scrape` aliases exist.

Product page: [/scrape](/scrape). URL to Markdown guide: [/url-to-markdown](/url-to-markdown). [HTML to Markdown](/glossary/html-to-markdown) glossary. Web scraping API overview: [/web-scraping-api](/web-scraping-api).

## Example

```bash
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"}'
```

## Request body

- **`url`** (string (required)): Page to fetch
- **`onlyMainContent`** (boolean): Default `false` (full page). Set `true` to keep only the main content and drop navigation, headers and footers
- **`includeTags`** (string[]): Keep only elements matching these CSS selectors
- **`excludeTags`** (string[]): Remove elements matching these CSS selectors
- **`retainImages`** (all or none): Default `all`
- **`timeout`** (integer): Milliseconds (default 15000)
- **`prompt` / `schema` / `extract`** (object or string): Ask for structured data; adds 2 credits

Optional header `X-Retain-Images: none` strips images from the Markdown. Send `X-No-Cache: true` or `Cache-Control: no-cache` to bypass cached results.

## Auth

`Authorization: Bearer YOUR_API_KEY` or `X-API-Key: YOUR_API_KEY`.

## Related

- [Extract](/docs/extract) for prompt or schema-only extraction
- [Crawl](/docs/crawl) when you need many pages
- [HTML to Markdown](/glossary/html-to-markdown) for what conversion keeps and strips
- [URL to Markdown](/url-to-markdown) product guide
- [API reference](/docs/api)

## Docs index

- [Overview](https://webcrawl.app/docs)
- [Scrape](https://webcrawl.app/docs/scrape)
- [Crawl](https://webcrawl.app/docs/crawl)
- [Map](https://webcrawl.app/docs/map)
- [Search](https://webcrawl.app/docs/search)
- [Extract](https://webcrawl.app/docs/extract)
- [MCP server](https://webcrawl.app/docs/mcp)
- [MCP setup](https://webcrawl.app/docs/mcp-setup)
- [Self-hosting](https://webcrawl.app/docs/self-hosting)
- [SDKs and CLI](https://webcrawl.app/docs/sdks)
- [API reference](https://webcrawl.app/docs/api)

HTML: https://webcrawl.app/docs/scrape
