apyhub
ARTIFICIAL INTELLIGENCE · DATA EXTRACTION

Talk to PDF API

What it does

Ask PDF Questions lets you send a PDF and a natural-language question, then get an answer back from the document content. Use it with either an uploaded file or a publicly accessible PDF URL.

For uploads, POST /file accepts a file field containing a valid, non-password-protected PDF up to 10 MB, plus a query string of up to 2000 characters. For remote documents, POST /url accepts a file_url that ends in .pdf and a query string. In both cases, the response always includes an answer field as a string.

This is useful when you need to query contracts, reports, policies, manuals, or research papers without building your own document search pipeline. Ask for a specific figure, a summary of a section, or a fact buried in a long PDF, and use the returned answer in review workflows, document assistants, or internal support tools.

Ask PDF Questions is a fit when the source of truth is already in a PDF and you want a direct answer instead of extracting the whole file first. Keep in mind that the service only works with valid PDF input and the query is limited to document content.

▣ ENDPOINT 01 / 02
POST
Ask a question about an uploaded PDF
https://api.eu.apyverse.com/apyhub/ask-question-about-pdf/file

QUICKSTART

GUIDE

Quickstart

Upload a PDF and ask a question about its contents.

curl -X POST "https://api.eu.apyverse.com/apyhub/ask-question-about-pdf/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf" \
  -F "query=What was the total revenue in Q3?"

What you'll get back

Returns a JSON object with an answer string field containing the model’s response to your question.

{
  "answer": "The total revenue in Q3 was $1.2 million."
}
TRY ITLIVE · 200 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*
PDF file to query. Maximum 10 MB. Must be a valid, non-password-protected PDF.
Natural-language question about the document content.

About this endpoint

What it does

Uploads a PDF file and a natural-language question, then returns a generated answer based on the document content.

Request Body

ParameterTypeMandatoryDescription
fileStringYesPDF file to query. Maximum 10 MB. Must be a valid, non-password-protected PDF.
queryStringYesNatural-language question about the document content. Maximum length: 2000 characters.

Response

Returns a JSON object with an answer string field. The response shape is described as depending on the LLM output, but it always includes answer.

ParameterTypeMandatoryDescription
answerStringNoThe generated answer to the question.

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
Ask a question about a PDF at a URL
https://api.eu.apyverse.com/apyhub/ask-question-about-pdf/url

QUICKSTART

GUIDE

Quickstart

Ask a question about a PDF by sending the PDF URL and your question in one JSON request.

curl -X POST "https://api.eu.apyverse.com/apyhub/ask-question-about-pdf/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file_url":"https://assets.apyhub.com/samples/sample.pdf","query":"What is the minimum contrast ratio required for normal text?"}'

What you'll get back

Returns a JSON object with an answer string field containing the response to your question.

{
  "answer": "..."
}
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*
Natural-language question about the document content.
Publicly accessible PDF URL. Must end in `.pdf`.

About this endpoint

What it does

Sends a public PDF URL and a natural-language question to the endpoint and returns a textual answer derived from the document content.

Request Body

ParameterTypeMandatoryDescription
file_urlStringYesPublicly accessible PDF URL. Must be a valid URI and end in .pdf.
queryStringYesNatural-language question about the document content. Maximum length: 2000 characters.

Response

Returns a JSON object with an answer string field containing the response to the question about the PDF.

ParameterTypeMandatoryDescription
answerStringNoThe answer generated from the PDF content.

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.