Document metadata

Data about a file, like its type, size, page count, and whether OCR ran, as opposed to its body content. What an extraction API reports alongside the text.

definition

Document metadata is structured information describing a file: its format, size, authorship, creation date, page count, and similar properties. It is distinct from the body content the file carries.

Also called: file metadata, extraction metadata

in-plain-terms

A PDF's own metadata can include a title, author, and creation and modification dates. It stores this in the file itself, rather than in its visible text, along with the page count. An extraction API layers its own metadata on top of that. txtfetch's response includes content_type, byte and character counts, and whether OCR ran on that particular request. These are facts about how the extraction happened, not facts embedded in the source file.

Metadata answers questions a caller needs before or after trusting the extracted text itself. What format was this really? How big was it? Did OCR run, and which quality tier processed it? It answers all of this without re-parsing the document to find out.

why-it-matters

  • metadata.ocr in a txtfetch response tells you whether that specific request actually ran OCR. This matters when confirming a scan was processed correctly rather than silently skipped.
  • A file's own embedded metadata, like an author name or creation date, can be wrong, stale, or stripped entirely. It's a property of the file, not a guarantee, and shouldn't be trusted the same way the extracted body text is.

how-to-check

  • Check metadata.content_type and metadata.ocr on an extraction response to confirm what was actually detected and processed, rather than assuming. See the full response shape

related-terms

faq

Is a file's embedded metadata always accurate?
No. An author name, creation date, or title embedded in a file is a property the file's creator (or their software) wrote. It's not something an extraction pipeline verifies, so it can be wrong, stale, or missing.
What metadata does txtfetch return alongside extracted text?
content_type, byte and character counts, and whether OCR ran, on every response. Additional fields like page count, quality tier, and token usage appear depending on which format and quality mode was requested.

related-reading

See the term in real output.

Drop a file into the free reader and watch it happen.

Open the file reader →

Get an API key →