---
title: Talk to PDF API
slug: ask-question-about-pdf
url: https://apyhub.com/apyhub/service/ask-question-about-pdf
provider: ApyHub
categories: [Model Kit, Document Intelligence Kit]
tags: [ai, answer, pdf, qna, question]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 2
atoms: 200
mcp: true
alias: talk-to-pdf-api
---

# Talk to PDF API

Ask natural-language questions about an uploaded PDF or PDF URL and get an answer string back. Built for document search, review, and support.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/ask-question-about-pdf/file` | What it does Uploads a PDF and a natural-language question about that document, then returns the mo… | 200 |
| POST | `https://api.eu.apyhub.com/apyhub/ask-question-about-pdf/url` | What it does Submits a public PDF URL and a natural-language question, then returns a text answer b… | 200 |

## Endpoint reference

### Ask a question about an uploaded PDF

`POST https://api.eu.apyhub.com/apyhub/ask-question-about-pdf/file` · 200 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | PDF file to query. Maximum 10 MB. Must be a valid, non-password-protected PDF. |
| `query` | body | string | yes | Natural-language question about the document content. Example: `What was the total revenue in Q3?`. |

#### Quickstart

Upload a PDF and ask a question about its contents.

```bash
curl -X POST "https://api.eu.apyhub.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.

```json
{
  "answer": "The total revenue in Q3 was $1.2 million."
}
```

### Ask a question about a PDF at a URL

`POST https://api.eu.apyhub.com/apyhub/ask-question-about-pdf/url` · 200 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `query` | body | string | yes | Natural-language question about the document content. Example: `What is the minimum contrast ratio required for normal text?`. |
| `file_url` | body | string (uri) | yes | Publicly accessible PDF URL. Must end in .pdf. Example: `https://assets.apyhub.com/samples/sample.pdf`. |

#### Quickstart

Ask a question about a PDF by sending its public URL and your question.

```bash
curl -X POST "https://api.eu.apyhub.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 model's response to your question.

```json
{
  "answer": "The minimum contrast ratio required for normal text is 4.5:1."
}
```

## About

## What it does
PDF Question Answering lets you send a PDF and ask a natural-language question about its contents. It returns an `answer` string based on the document you provide, so you can extract specific facts without building your own parser or retrieval pipeline.

Use `POST /file` when you have the PDF as an uploaded file. Send a binary `file` up to 10 MB and a `query` string up to 2000 characters. Use `POST /url` when the PDF is already hosted online; send a public `.pdf` URL in `file_url` plus the same `query` field. In both cases, the response includes an `answer` field with the model's answer.

This is a good fit for document search, internal knowledge assistants, contract review, and support workflows where users need a direct answer from a specific PDF. Ask for totals, dates, requirements, definitions, or other details from reports, manuals, policies, and forms.

PDF Question Answering is useful when you want a lightweight AI layer over documents without converting them into another format first. Send the file or URL, ask the question, and use the returned answer in your app or automation.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/ask-question-about-pdf
