apyhub
Back
▣ ARTIFICIAL INTELLIGENCE · SMART GENERATION

Document Summarizer API: Summarize PDF and Word Files

Hosted on ApyHub

What it does

The Document Summarizer API turns a PDF, DOCX, DOC, or ODT file into a concise plain-text summary. Upload the document as file or send a direct url, and get the summary back as JSON in data.summary.

Set summary_length to short (about 20 words, the default), medium (about 60 words), or long (about 100 words). Add an output_language BCP-47 code such as de or es to get the summary in another language; English is the default. Uploads are capped at 100 MB per request.

Use the document summarizer API to summarize PDF reports, contracts, and research papers for triage queues, to generate preview text for document cards in a file library or search results, or to give reviewers the gist before they open a long file. As a PDF summarizer inside an ingestion pipeline, it gives each incoming document a short description that helps route it to the right team. AI agents can call it through ApyHub MCP to summarize files they receive.

For plain text and web pages, use the AI Summarizer API. When you need the full document text instead of a summary, the Extract Text from PDF API and the Extract Text from Word API return it as JSON.

▣ ENDPOINT 01 / 02
POST
Summarize an uploaded document
https://api.eu.apyhub.com/apyhub/summarize-documents/file

QUICKSTART

GUIDE

Quickstart

Upload a document to generate a summary.

curl -X POST "https://api.eu.apyhub.com/apyhub/summarize-documents/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf" \
  -F "summary_length=short"

What you'll get back

Returns a JSON object with a data object. The data object includes a summary string containing the generated document summary.

{
  "data": {
    "summary": "..."
  }
}
TRY ITLIVE · 2600 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.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
The document to summarize (.pdf, .docx, .doc, or .odt).
Target length — short (~20 words), medium (~60 words), long (~100 words).
BCP-47 language code for the output. Defaults to English.

About this endpoint

What it does

Uploads a document and returns a generated text summary for that file. The request body includes the file to summarize and optional settings for summary length and output language.

Request Body

ParameterTypeMandatoryDescription
fileBinaryYesThe document to summarize. Accepted formats: .pdf, .docx, .doc, or .odt.
summary_lengthENUMNoTarget summary length. Allowed values: short (default, ~20 words), medium (~60 words), long (~100 words).
output_languageStringNoBCP-47 language code for the output. Defaults to English.

Response

Returns a JSON object with a data object field. The data object contains a summary string with the generated document summary.

ParameterTypeMandatoryDescription
dataObjectYesWrapper object for the response payload.
data.summaryStringNoThe generated summary text.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 02
POST
Summarize a document from a URL
https://api.eu.apyhub.com/apyhub/summarize-documents/url

QUICKSTART

GUIDE

Quickstart

Summarize a document from a direct file URL.

curl -X POST "https://api.eu.apyhub.com/apyhub/summarize-documents/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/report.pdf",
    "summary_length": "short"
  }'

What you'll get back

Returns a JSON object with a data object. The data object contains a summary string with the generated document summary.

{
  "data": {
    "summary": "..."
  }
}
TRY ITLIVE · 2600 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*
Direct URL to a PDF, DOCX, DOC, or ODT file.
Target length — short (~20 words), medium (~60 words), long (~100 words).
BCP-47 language code for the output. Defaults to English.

About this endpoint

What it does

Summarizes a document fetched from a direct URL and returns the generated summary in the response. The request body includes the document URL and can optionally control summary length and output language.

Request Body

ParameterTypeMandatoryDescription
urlStringYesDirect URL to a PDF, DOCX, DOC, or ODT file.
summary_lengthENUMNoTarget summary length. Allowed values: short, medium, long. Default: short.
short ≈ 20 words
medium ≈ 60 words
long ≈ 100 words
output_languageStringNoBCP-47 language code for the output. Defaults to English.

Response

Returns a JSON object with a data object field. The data object contains a summary string field with the generated document summary.

ParameterTypeMandatoryDescription
dataObjectYesResponse wrapper object.
data.summaryStringNoThe generated summary text.
▣ 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.