apyhub
Back
▣ INGESTION KIT · DOCUMENT INTELLIGENCE KIT

Extract PDF Metadata API

What it does

The Extract PDF Metadata API reads the document properties stored inside a PDF and returns them as JSON. Send a PDF as a public pdf_url or a pdf_base64 string, and get back a metadata object with fields such as Title, Author, Subject, Keywords, Creator, Producer, CreationDate and ModDate.

Send exactly one input per request. pdf_url must be a public http or https link. pdf_base64 carries the file inline, and the whole request body must stay under 5 MB. The API returns only the fields the PDF contains, each as a string. A PDF with no title has no Title key.

Teams use the Extract PDF Metadata API to label files before indexing, check which tool produced a document, flag PDFs with a missing title or author, and record creation dates for audit trails.

It reads document properties only. It does not return page text, and password-protected PDFs return a 422 error.

To get the page text as well, pair it with the Extract PDF Content API. For photos and scans, the Extract Image Metadata API reads EXIF data in the same way.

AI agents can call it through ApyHub MCP.

POST
Extract metadata and document properties from a PDF
https://api.eu.apyhub.com/sarvasoft/extract-pdf-metadata/pdf/extract/metadata

QUICKSTART

GUIDE

Quickstart

Read the document properties of a public PDF.

curl -X POST "https://api.eu.apyhub.com/sarvasoft/extract-pdf-metadata/pdf/extract/metadata" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pdf_url":"https://assets.apyhub.com/samples/sample.pdf"}'

What you'll get back

Returns a JSON object with a metadata object holding the properties stored in the PDF.

{
  "metadata": {
    "Title": "Invoice 1042",
    "Author": "SarvaPDF",
    "Producer": "Skia/PDF"
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
body*

About this endpoint

What it does

Reads the document properties of a PDF sent by public URL or as Base64, and returns them as a metadata object.

Request Body

ParameterTypeDescription
pdf_urlStringRequired if pdf_base64 is not set. Public URL of the PDF. Must be http or https. Max length 2083 characters.
pdf_base64StringRequired if pdf_url is not set. Base64-encoded PDF. Provide exactly one of pdf_url or pdf_base64.

Response

Returns a JSON object with a metadata object. Each key is a document property found in the PDF, and each value is a string.

ParameterTypeDescription
metadataObjectDocument properties found in the PDF. Only fields present in the file are returned.
metadata.TitleStringDocument title. Returned only if set in the PDF.
metadata.AuthorStringDocument author. Returned only if set in the PDF.
metadata.SubjectStringDocument subject. Returned only if set in the PDF.
metadata.KeywordsStringDocument keywords. Returned only if set in the PDF.
metadata.CreatorStringApplication that created the original document. Returned only if set in the PDF.
metadata.ProducerStringApplication that produced the PDF. Returned only if set in the PDF.
metadata.CreationDateStringCreation date as stored in the PDF. Returned only if set in the PDF.
metadata.ModDateStringLast modification date as stored in the PDF. Returned only if set in the PDF.

Notes

  • Provide exactly one of pdf_url or pdf_base64. Sending both or neither returns an error.
  • The request body must be under 5 MB. Larger bodies return 413.
  • Password-protected PDFs return 422 with type pdf_password_protected.
  • A file that is not a readable PDF, invalid Base64, or a URL that cannot be loaded returns 422. details[].loc names the field.
  • Only document properties are read. Page text is not returned.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.