---
title: "Scrape a URL and Wait for the Result"
method: POST
path: "/url-scraper/scrape"
tags: ["Scrape"]
---

# Scrape a URL and Wait for the Result

`POST /url-scraper/scrape`

## Request

- Base URL: `https://api.anakin.io/v1`
- URL: `https://api.anakin.io/v1/url-scraper/scrape`
- Auth: API key in header `X-API-Key`

Scrapes a single URL and returns the result in the same response, so no polling is needed. Takes the same body as POST /url-scraper. If the scrape takes longer than about 90 seconds, the response is a 202 with an `id` and a non-terminal `status`; fetch the result later with GET /url-scraper/{jobId}. A failed scrape also returns 200 with `status: "failed"`, so check `status`. Limited to 20 requests per minute.

## Request body

- ScrapeRequest
  - `url` string, uri, required: The full URL of the website to extract data from.
  - `country` string: Proxy country code, e.g. us, gb, de.
  - `useBrowser` boolean: Use a headless browser — best for JS-heavy sites.
  - `generateJson` boolean: AI-extract structured JSON from the page content.
  - `forceFresh` boolean: Bypass the cache and force a fresh extraction.
  - `sessionId` string: Reuse an existing authenticated browser session (see Browser Sessions) instead of an anonymous request.
  - `sessionName` string: Human-readable name of a saved browser session — alternative to sessionId.

## Response `200`

Scrape finished (completed or failed)

- ScrapeResult
  - `id` string: Job ID.
  - `url` string: The URL that was scraped.
  - `status` 'pending' | 'processing' | 'completed' | 'failed'
  - `cached` boolean: Whether this result was served from cache.
  - `durationMs` integer: Extraction duration in milliseconds.
  - `markdown` string: Page content as clean markdown (populated when the default markdown format is used).
  - `generatedJson` object: AI-extracted structured JSON — populated only when generateJson was true.
  - `error` string: Populated only when status is failed.

## Other responses

- `202`: Still running; poll GET /url-scraper/{jobId} with the returned id
- `400`: Bad request: missing or malformed body
- `401`: Missing or invalid API key
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/anakin/apis/anakin-api.md) · [All operations](https://skmtc.dev/anakin/apis/anakin-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anakin/apis/anakin-api/revisions/5eda91e679e5?raw)
