PDF Metadata API
Read PDF metadata: page count, title, author, creator, producer, dates, PDF version, encryption, form fields and the size of each page (A4, Letter…).
The PDF Metadata API reads a PDF document and returns its properties without rendering it: PDF version, page count, whether it is encrypted or linearized (“fast web view”), the document information fields – title, author, subject, keywords, creator application, producer, creation and modification dates – the document language, the number of form fields and whether XMP metadata is present.
Each page (up to pages_limit, default 50) is listed with its width and height in points and millimetres and its rotation, and the first page size is matched to a paper name such as A4, A5, Letter, Legal or Tabloid, including landscape. The raw Info dictionary is returned as well, and xmp=true adds the XMP packet (up to 20,000 characters).
Upload the PDF as multipart field file, as the raw request body, as base64 in file_base64, or pass a public url. Maximum file size depends on your plan: Free 5 MB, Starter 20 MB, Pro 50 MB. Files are processed in memory and never stored.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
file | body | file | no | The PDF: multipart field file, raw binary body, or base64 in file_base64. Max 5/20/50 MB (Free/Starter/Pro). | |
url | body|query | string | no | Public URL of the PDF to fetch, instead of uploading. | |
pages_limit | body|query | number | no | 50 | Maximum number of pages listed in pages. |
xmp | body|query | boolean | no | false | Include the XMP metadata packet (max 20,000 characters). |
Example
curl -X POST "https://apibox.io.vn/v1/pdf-metadata" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@./my-file"const form = new FormData();
form.append('file', fileInput.files[0]);
const res = await fetch('https://apibox.io.vn/v1/pdf-metadata', {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
body: form,
});
console.log(await res.json());import requests
res = requests.post(
"https://apibox.io.vn/v1/pdf-metadata",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"file": open("my-file", "rb")},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/pdf-metadata');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
CURLOPT_POSTFIELDS => ['file' => new CURLFile('my-file')],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"source": "upload",
"file_name": "invoice.pdf",
"size_bytes": 924,
"sha256": "cea1669714535747e08755dbe4a082e155b91a6817ded3f9b420c784e9d10b6c",
"pdf_version": "1.7",
"page_count": 2,
"encrypted": false,
"linearized": false,
"title": "Invoice #1024",
"author": "APIBox",
"subject": "Monthly invoice",
"keywords": "invoice apibox",
"creator": "APIBox",
"producer": "pdf-lib",
"created_at": "2026-11-01T08:00:00.000Z",
"modified_at": "2026-11-01T08:00:00.000Z",
"language": null,
"page_size": {
"width_pt": 595.28,
"height_pt": 841.89,
"name": "A4"
},
"form_fields": 0,
"has_xmp": false,
"info": {
"Producer": "pdf-lib",
"ModDate": "D:20261101080000Z",
"Creator": "APIBox",
"CreationDate": "D:20261101080000Z",
"Title": "Invoice #1024",
"Author": "APIBox",
"Subject": "Monthly invoice",
"Keywords": "invoice apibox"
},
"pages": [
{
"page": 1,
"width_pt": 595.28,
"height_pt": 841.89,
"width_mm": 210,
"height_mm": 297,
"rotation": 0
},
{
"page": 2,
"width_pt": 595.28,
"height_pt": 841.89,
"width_mm": 210,
"height_mm": 297,
"rotation": 0
}
]
}
Use cases
- Count pages of uploaded documents for print-shop pricing
- Check that submitted documents are A4 and not encrypted
- Index title, author and dates of PDFs in a document library
- Detect fillable forms before sending a PDF to an e-signature flow
FAQ
How do I count the pages of a PDF via API?
POST the file as multipart field "file" to /v1/pdf-metadata and read page_count. It works for large documents too; only the first 50 pages are listed in pages unless you raise pages_limit.
Can it read password-protected PDFs?
Encrypted PDFs are opened without decrypting the content: you get encrypted: true, the page count and page sizes, but text-based fields such as title or author may be unreadable.
Does it extract the text of the PDF?
No, this endpoint only returns metadata and page geometry. It does not perform text extraction or OCR.
Related APIs
Image Metadata & EXIF
Read image dimensions, format, EXIF camera data, capture settings and GPS location from JPEG, PNG, WebP, HEIC, AVIF, GIF and more – upload or URL.
PDF₫Quote & Receipt PDF
Generate clean PDF quotations, receipts, orders and simple invoices from JSON, with Vietnamese text, VAT, totals in words and a VietQR code for payment.
M↓PDFMarkdown to PDF
Convert Markdown to a clean A4 / A5 / Letter PDF: headings, bold / italic, links, nested lists, quotes, code blocks, tables, page numbers, full Vietnamese support.