Skip to content

Extract pages

Keep only selected pages from a PDF. MCP tool extract_pages / HTTP POST /v1/pages/extract.

Produce a new PDF containing only the pages you select, dropping the rest.

MCP tool extract_pages
HTTP endpoint POST /v1/pages/extract
Price $0.05
Input One PDF + a page range
Output A PDF with only the selected pages
Parameter Type Required Description
file file yes Source PDF.
pages page range yes Pages to keep, e.g. 1-3,5,9-. 1-indexed.

From https://example.com/report.pdf, keep only pages 1 to 3 and page 5.

{
"file": "https://example.com/report.pdf",
"pages": "1-3,5"
}
Terminal window
curl -i -X POST https://api.pdfasyougo.com/v1/pages/extract \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <base64-encoded-payment-payload>" \
-d '{"file":"https://example.com/report.pdf","pages":"1-3,5"}'
{
"output": {
"url": "https://files.pdfasyougo.com/o/7b2c…?token=…",
"expires_at": "2026-06-29T12:00:00Z",
"pages": 4,
"bytes": 41984
},
"operation": "pages.extract",
"cost": "0.05 USDC"
}
  • Pages are 1-indexed; see the full page-range syntax.
  • Output pages appear in ascending document order, regardless of how you ordered the terms.
  • A range entirely outside the document is a processing_error and isn’t charged; partial overlaps are clamped.