Extract PDF Pages API
Send a PDF URL and a list of pages, get back a new PDF with just those pages — in the order you list them. Built for summaries, single invoices and previews.
- Free plan
- No credit card
Request
curl -X POST https://apdf.io/api/pdf/page/extract \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d pages="1-3,6,9-z"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('pages', '1-3,6,9-z');
fetch('https://apdf.io/api/pdf/page/extract', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/page/extract', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'pages' => '1-3,6,9-z'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/page/extract',
{
'file' => 'FILE_URL',
'pages' => '1-3,6,9-z'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/page/extract',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'pages': '1-3,6,9-z'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"pages": "1-3,6,9-z"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/page/extract")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("pages", "1-3,6,9-z")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/page/extract")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Pull out the pages.
Keep the original.
List the pages you want, in the order you want them.
They come back as a new PDF next to your original.
- 1,6,4
- Pages 1, 6 and 4, in exactly that order
- 3-7
- Pages 3 through 7
- 7-3
- Pages 7 down to 3, in reverse
- 2,6-z
- Page 2, then page 6 to the end
- r3-r1
- The last three pages, counted from the back
Only the pages that matter.
Long documents carry more than most readers need. Extract the part they care about and send just that.
Executive summaries
Pull the summary and the key figures out of a long report and send stakeholders a short PDF they will actually read.
One invoice from a statement
Take the pages of a single invoice out of a monthly statement and attach them to that customer's record in your app.
Free previews
Give prospects the first pages of a paid report or ebook as a preview, generated straight from the full file.
Signature pages
Lift just the signature pages out of a signed contract and file them where your team checks for completed deals.
Extract from anywhere.
Pull pages out of files wherever they already live.
One account and one monthly allowance behind every route.
One authenticated POST from any language. Copy-paste samples in cURL, Node.js, Python and more.
POST /api/pdf/page/extract
Pick the action in any Zap and map files from earlier steps. No code and no servers to run.
Extract PDF Pages
Add the Apdf node to any workflow, on n8n Cloud or self-hosted, and chain it with your automation.
Extract PDF pages
Let Claude, ChatGPT, Gemini or your own agent run it through the MCP server, on any paid plan.
extract-pdf-pages
1,000 page extractions
a month. Free.
Start on the free plan and move up only when your volume does — up to 1,000,000 operations a month on Business.
- One call is one operation, however many pages.
- Only calls that do the work are counted.
- Hard limits, so no surprise overage charges.
Extracting pages, answered
Extract pages tutorials
Building a Document Previewer: Extract PDF First Page as a Thumbnail
Learn how to build a fast PDF previewer for Document Management Systems using PHP. Extract only the first page as a lightweight thumbnail preview without forcing users to download the entire 50MB file. Perfect for improving DMS user experience and reducing bandwidth.
Split Bulk PDF Statements by Asking Claude
The accounting export is one PDF with every client's statement stacked inside. Describe the structure — 'three pages per client' — and the agent translates it into a page-range expression, splits the batch into per-client files, and reads them back to verify nothing leaked between clients.
Extract Invoice Pages from Bank Statements with PHP
Split combined PDF documents and extract specific page ranges using PHP and the Apdf Split API. Perfect for separating invoices from bank statements, extracting sections from vendor documents, or isolating specific pages.
Your code made the PDF.
Then it went dark.
Opened, read, signed or ignored — you never see any of it. Send the PDFs you generate as personal links, and every open, page read, comment and signature comes back to your software as a webhook. Need it signed? Same link. Same account, same API key, one more call.
API · Webhook · MCP