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 PDF and Word documents into short, readable summaries. Upload a PDF, DOCX, DOC, or ODT file, or send a link to one, and get back a plain-text summary in the length and language you choose.

Pick short for about 20 words, medium for about 60, or long for about 100. Set output_language to get the summary in another language, for example de for German or es for Spanish. English is the default.

Use it to show what a document is about before someone opens it, sort incoming contracts, reports, and research papers, or add one-line descriptions to files in a document library or search index. To summarize plain text or a web page instead of a file, use the AI Summarizer API.

You can start on ApyHub's free tier with no card required.

▣ 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
fileStringYesThe 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.

Body

Name
Type
Description
bodyREQUIRED
object

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.<br>short ≈ 20 words<br>medium ≈ 60 words<br>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.

Body

Name
Type
Description
bodyREQUIRED
object
▣ 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.