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…).

GETPOSThttps://apibox.io.vn/v1/pdf-metadata

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

NameInTypeRequiredDefault
filebodyfilenoThe PDF: multipart field file, raw binary body, or base64 in file_base64. Max 5/20/50 MB (Free/Starter/Pro).
urlbody|querystringnoPublic URL of the PDF to fetch, instead of uploading.
pages_limitbody|querynumberno50Maximum number of pages listed in pages.
xmpbody|querybooleannofalseInclude 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"

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

Start with 1,000 free requests every month. Get free API key →