---
title: "Extract"
method: POST
path: "/extract"
---

# Extract

`POST /extract`

Upload one or more files along with a prompt to extract data. The API processes the files based on the prompt and returns the extracted information.

A Pdf may generate an array of many extracted JSON blobs, 1 per page for example.

## Response `200`

Successful Response

- ExtractResponse
  - `extractions` Extraction[], required
    - `source` Source, required
      - `type` string, required — Media type of the file.
      - `name` string — Name of the file.
      - `page` integer — Page number if applicable.
    - `output` object, required — Extracted data from the file, in JSON format.
  - `usage` Usage, required — Usage statistics for the request. A request goes through the BoundaryML pipeline, where documents can be converted into images. In the process, the number of characters consumed, produced, and the number of megapixels consumed are tracked.
    - `consumed_chars` integer, required — Number of characters processed.
    - `produced_chars` integer, required — Number of characters produced.
    - `consumed_megapixels` number, required — Number of megapixels processed.
  - `request_id` string, required — Unique identifier for the request.

## Other responses

- `400` — Invalid Request Parameters
- `415` — Unsupported Media Type
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.dev/boundaryml/apis/boundaryml-extract-api.md) · [All operations](https://skmtc.dev/boundaryml/apis/boundaryml-extract-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/boundaryml/boundaryml-extract-api/revisions/2e38dce4a55e/schema)
