---
name: sous-scrape
description: Get live web data through the Sous Scrape API. Any page as clean Markdown (JavaScript rendering, anti-bot, residential proxies, exit country), structured extraction, screenshots, all URLs of a site, crawls, web search, redirect checks by country, bulk domain checks and a browser agent. Use when a task needs current web content, a page that blocks plain fetch/curl, data from many pages of one site, or a view of a site from another country.
---

# Sous Scrape

Web scraping API for agents. Base URL: `https://sousproxy.com/scrape`. Full reference: `https://sousproxy.com/scrape/llms-full.txt`.

## Setup

The API key lives in the environment variable `SOUS_SCRAPE_API_KEY` (starts with `ss_`).
If it is empty, ask the user for a key (free at `https://sousproxy.com/scrape/dashboard`, 1,000 free credits every month) and tell them to set it:

- macOS / Linux: `export SOUS_SCRAPE_API_KEY=ss_...` (add to `~/.zshrc` or `~/.bashrc`)
- Windows PowerShell: `setx SOUS_SCRAPE_API_KEY ss_...` (then reopen the terminal)

Never write the key into project files, commits or chat logs.

If MCP tools named like `mcp__sous-scrape__scrape` are available, use them instead of curl:
they take the same parameters as below.

## Pick the cheapest call

| Need | Call | Credits |
|---|---|---|
| One page as text | `POST /v1/scrape` | 1 (5 if it needs a browser) |
| Specific fields from a page | `POST /v1/extract` with `schema` (CSS) or `prompt` (AI) | 1 / 15-60 |
| Which pages a site has | `POST /v1/map` | 2 |
| Many pages of a site | `map` first, then `POST /v1/batch` with the URLs you need | 1 per page |
| Whole section of a site | `POST /v1/crawl` (background job) | 1 per page |
| No URL yet | `POST /v1/search` | 3 |
| How a page looks | `POST /v1/screenshot` | 5 |
| Where a link redirects per country | `POST /v1/linkcheck` | 2 per country |
| Domain age, SSL, status | `POST /v1/domains` | 2 per domain |
| Click, type, multi-step task | `POST /v1/agent` | 25-100 per step |
| Credits left | `GET /v1/account` | 0 |

Rules of thumb:
- Start with `scrape`. Default `render=auto` opens a real browser only when the page needs it.
- Use `map` before `crawl` and fetch only the pages you need.
- Add `"max_age": 86400` when the page may be cached: cache hits cost 0.
- Add `"country": "de"` (any 2-letter code) to see the site from that country.
- Blocked or failed requests are refunded automatically. On `402` stop and tell the user to top up.
- Do not use the agent for logins, payments or anything the site's rules forbid.

## Recipes

Scrape one page as Markdown:
```bash
curl -s -X POST https://sousproxy.com/scrape/v1/scrape \
  -H "X-API-Key: $SOUS_SCRAPE_API_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","formats":["markdown"]}'
```
Response: `{"status":200,"final_url":"...","content":"# Example...","credits":1}`.
Formats: `markdown`, `html`, `text`, `links`, `metadata`, `screenshot` (base64 PNG), `json` (AI, needs `prompt`
or `json_schema`). With one format the result is in `content`; with several, also in `formats.<name>`.

Structured data with AI:
```bash
curl -s -X POST https://sousproxy.com/scrape/v1/scrape \
  -H "X-API-Key: $SOUS_SCRAPE_API_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/pricing","formats":["json"],"prompt":"all plans with price and limits","json_schema":{"plans":[{"name":"string","price":"number"}]}}'
```

Exact fields with CSS selectors (cheap, no AI):
```bash
curl -s -X POST https://sousproxy.com/scrape/v1/extract \
  -H "X-API-Key: $SOUS_SCRAPE_API_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/item/1","schema":{"title":"h1","price":".price"}}'
```

All URLs of a site, filtered:
```bash
curl -s -X POST https://sousproxy.com/scrape/v1/map \
  -H "X-API-Key: $SOUS_SCRAPE_API_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","search":"/blog/","limit":500}'
```

Many URLs at once (background), then poll:
```bash
curl -s -X POST https://sousproxy.com/scrape/v1/batch \
  -H "X-API-Key: $SOUS_SCRAPE_API_KEY" -H "Content-Type: application/json" \
  -d '{"urls":["https://example.com/a","https://example.com/b"],"formats":["markdown"]}'
# -> {"id":"..."}; then:
curl -s https://sousproxy.com/scrape/v1/batch/ID -H "X-API-Key: $SOUS_SCRAPE_API_KEY"
```
`/v1/crawl` works the same way (`url`, `max_pages`, `max_depth`, `include`, `exclude`), status at `/v1/crawl/ID`.
Poll every 3-5 seconds until `status` is not `running`.

Web search with page contents:
```bash
curl -s -X POST https://sousproxy.com/scrape/v1/search \
  -H "X-API-Key: $SOUS_SCRAPE_API_KEY" -H "Content-Type: application/json" \
  -d '{"query":"best residential proxy pricing","limit":5,"scrape_results":3}'
```

Screenshot to a file:
```bash
curl -s -X POST https://sousproxy.com/scrape/v1/screenshot \
  -H "X-API-Key: $SOUS_SCRAPE_API_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","full_page":true}' -o shot.png
```

Redirect chain from several countries:
```bash
curl -s -X POST https://sousproxy.com/scrape/v1/linkcheck \
  -H "X-API-Key: $SOUS_SCRAPE_API_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://bit.ly/xxxx","countries":["us","de","br"],"mobile":true}'
```

Browser agent (only when interaction is really needed):
```bash
curl -s -X POST https://sousproxy.com/scrape/v1/agent \
  -H "X-API-Key: $SOUS_SCRAPE_API_KEY" -H "Content-Type: application/json" \
  -d '{"task":"Find the cheapest plan and what it includes","url":"https://example.com","max_steps":8}'
```

On Windows PowerShell use `curl.exe` and put the JSON in a file (`-d "@body.json"`) to avoid quoting problems,
or call the API from Python (`requests.post(url, json=..., headers={"X-API-Key": key})`).

## Errors

`400` bad parameters or a private/LAN address, `401` bad key, `402` no credits, `429` more than 10 parallel
requests, `502` the site did not answer (refunded), `503` browser or AI temporarily off.
