---
title: "Extract page content as markdown from URLs"
method: POST
path: "/extract"
tags: ["Extract"]
---

# Extract page content as markdown from URLs

`POST /extract`

## Request

- Base URL: `https://kagi.com/api/v1`
- URL: `https://kagi.com/api/v1/extract`
- Auth: HTTP bearer

Extracts markdown content from up to 10 HTTP(s) URLs. Each URL is processed
and the extracted content is returned in the response.

## Request body

- ExtractRequest: Request body for content extraction
  - `pages` PageInput[], required: Array of pages to extract content from. Must contain 1-10 URLs. Each URL must be a valid HTTPS URL.
    - `url` string, uri, required: The HTTPS URL of the page to extract content from. Must use HTTPS scheme with a valid host.
  - `timeout` number, float: Optional timeout in seconds for the extraction operation. Out of range values will be clamped back within range. All URLs are fetched concurrently. This timeout applies a time budget for the entire bulk fetch operation.
  - `format` 'json' | 'markdown': **(EXPERIMENTAL)** Format to serialize the API response as. The exact contents and structure of markdown output is still being worked on - please send your feedback!

## Response `200`

Successful extraction

- ExtractResponse: Response containing extracted content
  - `meta` Meta, required: This object is subject to change as it is provided for debugging purposes. Fields may be added or removed as required. Don't build any hard dependancies on any of this data.
    - `trace` string: Trace ID that can be used to debug individual API requests. Provide this, if needed, when contacting Kagi support.
    - `node` string: The hostname of the node that fulfilled the request.
    - `ms` integer: how long the request took to fulfill, excluding round trip to the client.
  - `data` PageOutput[], required: Array of extracted page content
    - `url` string, uri, required: The URL of the extracted page
    - `markdown` string, nullable: Extracted markdown content of the page. Will be absent if extraction fails.
    - `error` string: If extraction fails, a string describing the reason why.
  - `errors` ErrorDetail[]: Optional array of errors that occurred during extraction
    - `code` string, required: Namespaced error code
    - `url` string, uri, required: URL to error documentation. **NOTE:** These URLs are still a work in progress and will currently return a 404 error. These will be updated to real URLs as the preview period continues.
    - `message` string, nullable: Human-readable error message
    - `location` string, nullable: Field location where the error occurred

## Other responses

- `400`: Invalid request parameters
- `401`: Access token is missing or invalid
- `403`: Forbidden - IP address not authorized
- `429`: Rate limited or usage limit exhausted
- `500`: Internal server error

---

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