> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formepdf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Extract Embedded Data

> Read back the JSON data embedded in a Forme PDF with the hosted API. Not counted as an operation.

`POST /v1/extract`

Returns the JSON data embedded in a Forme PDF. See [Embedded Data](https://docs.formepdf.com/embedded-data.md).

On the hosted API, a render of a [JSX template](https://docs.formepdf.com/hosted-api/templates.md#jsx-templates) (sync or async) embeds the request data automatically. PDFs from HTML templates and from `/v1/render/html` have no embedded data. A PDF rendered locally with `embedData` also works.

Extract is **not** counted as an [operation](https://docs.formepdf.com/hosted-api.md#operations-and-plan-limits). It shares the render rate limit.

***

## Request

Send the raw PDF bytes as the body, with `Content-Type: application/pdf` or `application/octet-stream`. Maximum 10 MB.

```bash curl theme={null}
curl -X POST https://api.formepdf.com/v1/extract \
  -H "Authorization: Bearer forme_sk_abc123..." \
  -H "Content-Type: application/pdf" \
  --data-binary @invoice.pdf
```

```javascript Node.js theme={null}
const res = await fetch("https://api.formepdf.com/v1/extract", {
  method: "POST",
  headers: {
    Authorization: "Bearer forme_sk_abc123...",
    "Content-Type": "application/pdf",
  },
  body: fs.readFileSync("invoice.pdf"),
});

const { data } = await res.json();
```

```python Python theme={null}
import requests

res = requests.post(
    "https://api.formepdf.com/v1/extract",
    headers={
        "Authorization": "Bearer forme_sk_abc123...",
        "Content-Type": "application/pdf",
    },
    data=open("invoice.pdf", "rb").read(),
)

print(res.json()["data"])
```

***

## Response

`200 OK`

```json theme={null}
{ "data": { "clientName": "Jane Smith", "items": [ ... ] } }
```

`404` `{"error": "No embedded data found in this PDF"}` when the PDF has no Forme embedded data.

> [!NOTE]
>
> The self-hosted server does not have `/v1/extract`. To extract without the hosted API, use `extractData()` from `@formepdf/core`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.