---
title: "Extract pages from a PDF"
method: POST
path: "/v1/pdf-tools/extract-pages"
tags: ["PDF Tools"]
---

# Extract pages from a PDF

`POST /v1/pdf-tools/extract-pages`

Return a single PDF containing only the selected pages of the input, in the order specified. Replaces the need for splitting + reassembling client-side.

**Pages syntax:** 1-indexed, comma-separated. Supports ranges (`1-3`) and singles (`5`). Order is preserved: `5,1,3` outputs those 3 pages in that order.

**Credits:** 1 credit per call.

## Request body

- ExtractPdfPagesRequest
  - `export_type` 'url' | 'binary'
  - `expiration` integer — URL expiration in seconds. Min 60, max 604800. Only applies to `url` export type.
  - `filename` string, nullable — Custom filename (without `.pdf`). Defaults to a generic name.
  - `pdf_url` string, nullable — Public HTTPS URL to download the PDF from
  - `pdf_base64` string, nullable — PDF file encoded as a base64 string
  - `pages` string, required — 1-indexed page selection. Supports ranges and singles separated by commas, e.g. `1-3, 5, 7-9`. Order is preserved (`5,1,3` outputs those 3 pages in that order).

## Response `200`

Successful Response

- PdfToolsResponse
  - `url` string, required — Signed URL to download the PDF
  - `filename` string, required — Filename of the resulting PDF
  - `credits_remaining` integer, required — Remaining credits after this request
  - `expires_in` integer, required — Seconds until the signed URL expires

## Other responses

- `402` — Insufficient credits
- `422` — Invalid input (bad PDF, out-of-bounds page, etc.)
- `429` — Rate limit exceeded

---

[API](https://skmtc.net/pdftemplateapi/apis/templatefox-api.md) · [All operations](https://skmtc.net/pdftemplateapi/apis/templatefox-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pdftemplateapi/templatefox-api/revisions/5673fc0d5fad/schema)
