# Scrape the URL in the path (/docs/reference/scrape-target-url)

Scrapes the URL that follows the host with default options, e.g. GET /https://example.com. A URL without a scheme, e.g. GET /example.com, is taken as https.

`GET /{target_url}`

An API key is optional; without one the caller is anonymous.

## Example request

```sh
curl 'https://api.elisebot.dev/<target_url>' \
  -H "Authorization: Bearer $ELISEBOT_API_KEY"
```

## Parameters

- `target_url` (path, string, required): The URL to scrape.

## Responses

### 200

OK.

Type: `ScrapeResponse`

- `data` (Document, required)
  - `html` (string): The page HTML, converted to UTF-8; only its main content with responseOptions.onlyMainContent.
  - `markdown` (string): The page as Markdown.
  - `metadata` (DocumentMetadata, required)
    - `contentType` (string): The response content type.
    - `error` (string): Why the scrape failed.
    - `errorCode` (string): A machine-readable error code.
    - `sourceURL` (string, required): The requested URL.
    - `statusCode` (integer (int64)): The HTTP status code.
    - `url` (string, required): The final URL after redirects.
- `success` (boolean, required): Always true. One of `true`.

### 202

The page was not scraped within timeout. The scrape keeps running: poll url, also sent as Location, for the document.

Headers:

- `Location` (string): The scrape status URL, the same as url.

Type: `ScrapeAcceptedResponse`

- `id` (string, required): The scrape ID.
- `success` (boolean, required): Always true. One of `true`.
- `url` (string, required): The URL to check the scrape status.

### 401

UNAUTHORIZED: The API key is invalid or revoked; API_KEY_REQUIRED: This endpoint needs an API key; INVALID_ACCESS_TOKEN: The OAuth access token is unknown, expired or revoked, or was sent to an endpoint other than /mcp, the only one it works on.

Type: `UnauthorizedResponse`

- `code` (string, required): A machine-readable error code. One of `UNAUTHORIZED`, `API_KEY_REQUIRED`, `INVALID_ACCESS_TOKEN`.
- `details` (array of ValidationErrorDetail or null): The invalid fields.
  - `location` (string): Where the error occurred, e.g. body.urls[3].
  - `message` (string): What went wrong.
  - `value` (any): The rejected value.
- `error` (string, required): A human-readable message.
- `success` (boolean, required): Always false. One of `false`.

### 402

INSUFFICIENT_CREDITS: The credit balance does not cover the request's URLs.

Type: `PaymentRequiredResponse`

- `code` (string, required): A machine-readable error code. One of `INSUFFICIENT_CREDITS`.
- `details` (array of ValidationErrorDetail or null): The invalid fields.
  - `location` (string): Where the error occurred, e.g. body.urls[3].
  - `message` (string): What went wrong.
  - `value` (any): The rejected value.
- `error` (string, required): A human-readable message.
- `success` (boolean, required): Always false. One of `false`.

### 422

VALIDATION_FAILED: One or more fields are invalid; TOO_MANY_URLS: The request has more URLs than your rate limit allows; IDEMPOTENCY_CONFLICT: The Idempotency-Key was already used with a different request.

Type: `ValidationFailedResponse`

- `code` (string, required): A machine-readable error code. One of `VALIDATION_FAILED`, `TOO_MANY_URLS`, `IDEMPOTENCY_CONFLICT`.
- `details` (array of ValidationErrorDetail or null): The invalid fields.
  - `location` (string): Where the error occurred, e.g. body.urls[3].
  - `message` (string): What went wrong.
  - `value` (any): The rejected value.
- `error` (string, required): A human-readable message.
- `success` (boolean, required): Always false. One of `false`.

### 429

RATE_LIMITED: Rate limit exceeded, retry after Retry-After seconds.

Headers:

- `Retry-After` (integer): Seconds to wait before retrying. Minimum 1.

Type: `TooManyRequestsResponse`

- `code` (string, required): A machine-readable error code. One of `RATE_LIMITED`.
- `details` (array of ValidationErrorDetail or null): The invalid fields.
  - `location` (string): Where the error occurred, e.g. body.urls[3].
  - `message` (string): What went wrong.
  - `value` (any): The rejected value.
- `error` (string, required): A human-readable message.
- `success` (boolean, required): Always false. One of `false`.

### 500

INTERNAL_ERROR: Something went wrong on our side, try again.

Type: `InternalErrorResponse`

- `code` (string, required): A machine-readable error code. One of `INTERNAL_ERROR`.
- `details` (array of ValidationErrorDetail or null): The invalid fields.
  - `location` (string): Where the error occurred, e.g. body.urls[3].
  - `message` (string): What went wrong.
  - `value` (any): The rejected value.
- `error` (string, required): A human-readable message.
- `success` (boolean, required): Always false. One of `false`.
