Skip to content
Scrappa Get API key
Web Scraper API 1 credit/request

Web Scraper Crawl API Documentation

GET https://scrappa.co/api/web-scraper/crawl

Scrappa's POST /api/web-scraper/crawl follows links from a start URL and returns the pages in one request.

Request

Send JSON: {"url": "https://example.com", "limit": 10, "max_depth": 1, "include_paths": ["/docs"], "exclude_paths": ["/docs/old"], "format": "markdown"}.

Rules

The crawl stays on the host of the start URL (include_subdomains adds subdomains). max_depth 0 returns only the start page. Paths are prefixes and * matches anything. exclude_paths wins over include_paths. A request has a time budget of 80 seconds. If the budget or limit ends the crawl early, truncated is true. This is one bounded request, not a background job.

Result

pages has url, depth, status, title, content (markdown or HTML) and links. failed lists pages that could not be fetched. Page content is capped at 300000 characters (content_truncated is true then). The whole response is capped at 5000000 characters; later pages are listed in failed and truncated is true.

Credits

1 credit per returned page. 3 credits for a page that needed a browser (at most 5 per request). meta.credits is the total. Failed pages are free. If no page works, the request answers 503 and costs nothing.

Web Scraper Crawl API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/web-scraper/crawl
Auth header
x-api-key
Cost
1 credit/request
url = https://example.com
Response preview
200 OK
{
    "data": {
        "pages": [
            {
                "url": "https://example.com",
                "depth": 0,
                "links": [
                    "https://www.iana.org/domains/example"
                ],
                "title": "Example Domain",
                "status": 200,
                "content": "# Example Domain"
            }
        ],
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

1 required parameter needed before sending a request.

6 optional filters available.

url string Required
Open example

Start URL.

Example value https://example.com
limit integer Optional

Maximum pages, 1-100. Default 10.

Example value 3
max_depth integer Optional

Link depth, 0-3. Default 1.

Example value 1
include_paths array Optional

JSON array of path prefixes to crawl.

Example value ["example"]
exclude_paths array Optional

JSON array of path prefixes to skip.

Example value ["example"]
format string Optional

markdown (default) or html.

Example value markdown
include_subdomains boolean Optional

true to follow subdomains.

Example value true

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "data": {
        "pages": [
            {
                "url": "https://example.com",
                "depth": 0,
                "links": [
                    "https://www.iana.org/domains/example"
                ],
                "title": "Example Domain",
                "status": 200,
                "content": "# Example Domain"
            }
        ],
        "failed": [],
        "start_url": "https://example.com",
        "truncated": false,
        "pages_returned": 1
    },
    "meta": {
        "credits": 1
    },
    "success": true
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

A parameter is missing or invalid, or the url points to a private, local or non-public address. Not charged.

{
    "error": {
        "code": "VALIDATION_ERROR",
        "message": "The request validation failed"
    },
    "success": false
}
503

Site Unreachable Or Blocked

The site could not be fetched after several tries, or it blocked the request. Not charged.

{
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "The site could not be reached. Please retry shortly."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.