# PDF to Markdown for LLMs & RAG Chunks - No Login (`cliqtomedia/pdf-to-markdown`) Actor

Convert public PDF URLs to clean Markdown for LLMs and RAG: headings, lists, GFM tables and ready-made chunks with page numbers and token estimates. OCR for scanned pages. No login, no API key.

- **URL**: https://apify.com/cliqtomedia/pdf-to-markdown.md
- **Developed by:** [Cliqto Media](https://apify.com/cliqtomedia) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.24 / 1,000 document (text pages)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

Convert public PDF links into clean Markdown for LLMs and RAG: real headings, lists, GitHub-style tables and ready-made chunks with page numbers and token counts. Scanned pages are read with OCR. No login and no API key: paste a PDF URL, click **Start**, and a 15-page paper is done in about 3 seconds for $0.0082 (Free plan).

It is for developers who feed PDFs into vector databases, AI agents and knowledge bases and do not want to run their own PDF parser and OCR.

![PDF to Markdown for LLMs: a PDF link becomes Markdown with headings and tables, then RAG chunks with page numbers and token counts](https://api.apify.com/v2/key-value-stores/e6fJH0GLbvw4VPaWh/records/README-BANNER-20261016.png)

### Table of contents

- [What it does](#what-it-does)
- [What data you get](#what-data-you-get)
- [Quick start](#quick-start)
- [Input](#input)
- [Output](#output)
- [Pricing](#pricing)
- [Use cases](#use-cases)
- [Scheduling and monitoring](#scheduling-and-monitoring)
- [API, export and integrations](#api-export-and-integrations)
- [Limitations and partial results](#limitations-and-partial-results)
- [Troubleshooting](#troubleshooting)
- [FAQ](#faq)
- [Related Actors](#related-actors)
- [Support](#support)

### What it does

You give the Actor one or more links to PDF files. For each file it:

1. Downloads the PDF from the public URL.
2. Reads the text layer of each page and keeps the layout: big text becomes `#` headings, bullets become lists, and grids of words become Markdown tables.
3. Reads scanned pages (pages without a text layer) with OCR.
4. Cuts the Markdown into chunks for embeddings. A new heading always starts a new chunk, and every chunk knows its pages and the headings above it.
5. Saves one row per PDF in the Dataset.

#### Good fit

- Load research papers, reports or manuals into a vector database for RAG.
- Give an AI agent the text of a PDF as Markdown, with tables it can read.
- Pull tables out of public reports and forms as Markdown or as cells.
- Read old scanned documents that have no text layer.

#### Not a fit

- PDFs behind a login, a paywall or a private network. Only public `http(s)` links work.
- Password-protected PDFs. The Actor reports them and does not try to open them.
- Formulas, charts and pictures. The text around them is kept, the images are not described.
- Uploading files from your computer. Put the file at a public URL first.

### What data you get

| Data | Field | Example |
| --- | --- | --- |
| Full Markdown of the document | `markdown` | `# Attention Is All You Need` … `<!-- page 2 -->` |
| Tables as Markdown and as cells | `tables[]` | page 6, 6 rows × 4 columns |
| Chunks for embeddings | `chunks[]` | text, `pageStart`, `pageEnd`, `headingPath`, `tokens` |
| Title, page count, size | `title`, `pageCount`, `tokenEstimate` | `Attention Is All You Need`, 15, 10449 |
| How each page was read | `pages[]` | `text` or `ocr`, OCR confidence |
| Status and errors | `status`, `error`, `warnings` | `complete`, `not_found`, `PDF_PASSWORD_REQUIRED` |
| Source and time | `url`, `finalUrl`, `fetchedAt` | when the file was downloaded |

### Quick start

1. Open the **Input** tab.
2. Keep the example link in **PDF URLs** (`https://arxiv.org/pdf/1706.03762`) or add your own PDF links, one per line.
3. Keep the default settings: chunks of about 500 tokens, OCR **Auto**.
4. Click **Start**.
5. Open the **Output** tab. The **Documents** view shows the Markdown and tables; the **Chunks** view shows the chunks.

Expected result: one row with `status: "complete"`, 15 pages, 4 tables and 41 chunks for the example paper.

### Input

#### Input fields

| Field | Type | Required | Default | Allowed values | What it changes | Recommendation |
| --- | --- | --- | --- | --- | --- | --- |
| `pdfUrls` | array of strings | yes | prefill: `https://arxiv.org/pdf/1706.03762` | 1–100 public `http(s)` URLs | The PDFs to convert. Duplicate links are processed once. | Use direct links to PDF files. |
| `chunkSize` | integer | no | `500` | 100–4000 tokens | Target size of each chunk (tokens ≈ characters / 4). | 300–800 suits most embedding models. |
| `chunkOverlap` | integer | no | `50` | 0–2000 tokens, at most half of `chunkSize` | Text repeated at the start of the next chunk in the same section. | 10% of `chunkSize`. Use `0` for no repeats. |
| `ocr` | string | no | `auto` | `auto`, `on`, `off` | `auto`: OCR only pages without text. `on`: OCR every page. `off`: never OCR. | Keep `auto`. Use `off` to never pay for OCR. |
| `languages` | array | no | `["eng"]` | up to 3 of 20 languages | OCR languages. Not used for text-layer pages. | Pick only the languages of the document: each one is charged per OCR page. |
| `pages` | string | no | empty (all pages) | e.g. `1-3, 5, 10-` | Which pages of every document to read. | Use for long files when you need only some pages. |
| `maxPages` | integer | no | `50` | 1–300 | Upper limit of pages per document, after `pages`. Extra pages are skipped and not charged. | Raise to 300 for long reports. |
| `maxFileSizeMb` | integer | no | `50` | 1–100 MB | Larger files are not downloaded and get `FILE_TOO_LARGE`. | Keep the default unless your files are bigger. |

Empty `pdfUrls` is rejected before the run starts. A wrong `pages` value such as `abc` stops the run with `INVALID_INPUT` and no document charges.

#### Interacting settings

| When | Settings | What happens |
| --- | --- | --- |
| You select pages | `pages` + `maxPages` | `pages` is applied first, then `maxPages` cuts the rest. Cut pages are listed in `warnings` and not charged. |
| A page has no text layer | `ocr` + `languages` | With `auto` or `on` the page is read by OCR in the selected languages; with `off` it stays empty. |
| Small chunks | `chunkSize` + `chunkOverlap` | Overlap is limited to half of the chunk size. |
| Large table | `chunkSize` | A table stays in one chunk; if it alone is bigger than `chunkSize`, it is split by rows and the header row is repeated. |

#### Input examples

##### One research paper (the prefill)

```json
{
  "pdfUrls": ["https://arxiv.org/pdf/1706.03762"]
}
```

Expected: 1 row, 15 text pages, 4 tables, 41 chunks, in about 3 seconds.

##### Several reports, smaller chunks

```json
{
  "pdfUrls": [
    "https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf",
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
  ],
  "chunkSize": 300,
  "chunkOverlap": 30,
  "maxPages": 100
}
```

Expected: 2 rows. The first 100 pages of the long NIST file are read (the rest are listed in `warnings`), and the W-9 form is read in full.

##### A scanned document with OCR

```json
{
  "pdfUrls": ["https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10003-10041.pdf"],
  "ocr": "auto",
  "languages": ["eng"],
  "pages": "1-5"
}
```

Expected: 1 row with `ocrUsed: true`, `ocrPages: 5`. OCR takes about 10 seconds per page.

### Output

One row per PDF in the default Dataset. Two views: **Documents** (Markdown, tables, status) and **Chunks** (chunk list per document). The run summary is in the key-value store as `RUN_SUMMARY`.

#### Output example

Real row for the prefill, trimmed: long text is cut with `…`, and only one table, one chunk and one page are shown.

```json
{
  "url": "https://arxiv.org/pdf/1706.03762",
  "finalUrl": "https://arxiv.org/pdf/1706.03762",
  "status": "complete",
  "title": "Attention Is All You Need",
  "pageCount": 15,
  "pagesProcessed": 15,
  "pagesTruncated": false,
  "markdown": "<!-- page 1 -->\n\n…\n\n# Attention Is All You Need\n\n…\n\n<!-- page 2 -->\n\n## 1 Introduction\n\nRecurrent neural networks, long short-term memory [13] and gated recurrent [7] neural networks …",
  "markdownUrl": null,
  "charCount": 41793,
  "tokenEstimate": 10449,
  "tables": [
    {
      "index": 1,
      "page": 6,
      "rows": 6,
      "columns": 4,
      "markdown": "| Layer Type | Complexity per Layer | Sequential | Maximum Path Length |\n| --- | --- | --- | --- |\n…",
      "cells": [["Layer Type", "Complexity per Layer", "Sequential", "Maximum Path Length"], ["Self-Attention", "2 · O(n d)", "O(1)", "O(1)"]]
    }
  ],
  "chunks": [
    {
      "index": 8,
      "text": "### 3.2 Attention\n\nAn attention function can be described as mapping a query and a set of key-value pairs to an output …",
      "pageStart": 3,
      "pageEnd": 4,
      "headingPath": ["Attention Is All You Need", "3 Model Architecture", "3.2 Attention"],
      "tokens": 136,
      "charCount": 543
    }
  ],
  "chunkSize": 500,
  "ocrUsed": false,
  "textPages": 15,
  "ocrPages": 0,
  "ocrLanguages": null,
  "pages": [
    { "pageNumber": 1, "method": "text", "charCount": 2886, "tables": 0, "ocrConfidence": null, "error": null }
  ],
  "fileSizeBytes": 2215244,
  "contentType": "application/pdf",
  "metadata": { "creator": "LaTeX with hyperref", "producer": "pdfTeX-1.40.25", "pdfVersion": "1.5" },
  "encrypted": false,
  "error": null,
  "warnings": [],
  "fetchedAt": "2026-10-15T18:15:47.458Z",
  "processedAt": "2026-10-15T18:15:47.633Z"
}
```

`null` means "not known" or "not used", not zero. For example, `ocrLanguages` is `null` when no page needed OCR, and `pageCount` is `null` when the file could not be opened.

#### Output fields

| Field | Type | Can be null? | Meaning |
| --- | --- | --- | --- |
| `url` | string | no | The URL from your input. |
| `finalUrl` | string | yes | The URL after redirects; `null` if the file was not downloaded. |
| `status` | string | no | `complete`, `partial` (some pages not read), `not_found` (HTTP 404/410) or `error`. |
| `title` | string | yes | Title from the PDF metadata, else the first top-level heading of the text layer. Never taken from OCR. |
| `pageCount` | integer | yes | Pages in the PDF. |
| `pagesProcessed` | integer | no | Pages read successfully. |
| `pagesTruncated` | boolean | no | `true` when `maxPages` cut the page selection. |
| `markdown` | string | yes | Markdown of all read pages. Each page starts with `<!-- page N -->`. `null` on error or when it was moved to `markdownUrl`. |
| `markdownUrl` | string | yes | Link to the full Markdown file when it was too large for one row (over 8 MB). |
| `charCount` | integer | no | Characters in the Markdown. |
| `tokenEstimate` | integer | no | Approximate tokens (characters / 4). |
| `tables[]` | array | no | `index`, `page`, `rows`, `columns`, `markdown`, `cells`. `cells` is `null` only when dropped to fit the row size. |
| `chunks[]` | array | no | `index`, `text`, `pageStart`, `pageEnd`, `headingPath`, `tokens`, `charCount`. |
| `chunkSize` | integer | no | Chunk size used. |
| `ocrUsed` | boolean | no | `true` when at least one page was read by OCR. |
| `textPages` | integer | no | Pages read from the text layer. |
| `ocrPages` | integer | no | Pages read by OCR. |
| `ocrLanguages` | array | yes | OCR languages used; `null` without OCR. |
| `pages[]` | array | no | Per page: `pageNumber`, `method` (`text`, `ocr`, `none`), `charCount`, `tables`, `ocrConfidence` (0–100, OCR only), `error`. |
| `fileSizeBytes` | integer | yes | Size of the downloaded file. |
| `contentType` | string | yes | Content-Type sent by the server. |
| `metadata` | object | yes | PDF metadata as written in the file (author, creator, dates…). Not checked. |
| `encrypted` | boolean | yes | `true` when the PDF is encrypted. It may still open without a password. |
| `error` | object | yes | `{ code, message }` when something went wrong for this row. |
| `warnings` | array | no | Notes such as skipped pages or pages without a text layer. |
| `fetchedAt` | string | yes | When the file was downloaded (ISO 8601). |
| `processedAt` | string | no | When the row was written (ISO 8601). |

#### Where results appear

| Situation | Where | What you see |
| --- | --- | --- |
| Normal PDF | Dataset | `status: "complete"`, Markdown, tables, chunks |
| Very large document | Dataset + key-value store | `markdown: null`, `markdownUrl` points to the full file |
| Dead link | Dataset | `status: "not_found"`, `error.code: "NOT_FOUND"` |
| Not a PDF, password, too large | Dataset | `status: "error"` and the `error.code` |
| Run stopped early | Dataset + `RUN_SUMMARY` | `partial` rows and unprocessed rows with `DEADLINE_REACHED` or `CHARGE_LIMIT_REACHED` |

### Pricing

#### Pricing unit

You pay per event (pay-per-event). Platform usage is included in the event prices.

| Event | When | Free | Bronze | Silver | Gold, Platinum, Diamond |
| --- | --- | ---: | ---: | ---: | ---: |
| Actor start | once per run, per GB of memory (default 1 GB = 1 event) | $0.005 | $0.005 | $0.005 | $0.005 |
| Document | per started 50 text-layer pages of a PDF (1–50 pages: 1 event, 51–100: 2) | $0.0032 | $0.0029 | $0.0026 | $0.0023 |
| OCR page | per page read by OCR, per selected language | $0.012 | $0.0108 | $0.0096 | $0.0084 |

Not charged: dead links, files that are not PDFs, password-protected PDFs, files that are too large, pages cut by `maxPages`, and pages that failed. A run where every link fails costs only the start event ($0.005).

#### Cost examples (Free plan, 1 GB, English OCR)

| Scenario | Events | Cost |
| --- | --- | ---: |
| One 15-page paper | start + 1 document | $0.0082 |
| 100 papers, each up to 50 pages | start + 100 documents | $0.325 |
| One 300-page report | start + 6 documents | $0.0242 |
| A 36-page scan | start + 36 OCR pages | $0.437 |
| 100 dead links | start only | $0.005 |

Set **Max total charge** in the run options to cap the cost. When the next page or document would go over the cap, the Actor stops, writes what it has, and marks the rest `CHARGE_LIMIT_REACHED` without charging them.

### Use cases

| Job | Input | Key fields | Next step |
| --- | --- | --- | --- |
| RAG over research papers | arXiv links in `pdfUrls` | `chunks[].text`, `headingPath`, `pageStart` | Embed chunks into your vector database; cite pages in answers. |
| Table extraction from reports | report links, `maxPages: 300` | `tables[].cells`, `tables[].page` | Load cells into a sheet or a database. |
| Agent reads a PDF | one link from the conversation | `markdown`, `title`, `tokenEstimate` | Put the Markdown into the model context. |
| Digitize old scans | scan links, `ocr: "auto"` | `markdown`, `pages[].ocrConfidence` | Check pages with low confidence by hand. |

### Scheduling and monitoring

The Actor reads the file at the moment of the run. To keep a knowledge base fresh, create a task with your list of PDF links and add a schedule in Apify (for example weekly). Compare `fileSizeBytes`, `metadata.modificationDate` or `charCount` with the previous run to see if a document changed. Each scheduled run is charged like a normal run.

### API, export and integrations

- **API:** start the Actor with `POST https://api.apify.com/v2/acts/cliqtomedia~pdf-to-markdown/runs` and the input JSON. Read rows from the run Dataset, or use `run-sync-get-dataset-items` for one short call.
- **Export:** download the Dataset as JSON, CSV, Excel or XML. JSON keeps the nested `tables` and `chunks`.
- **Integrations:** LangChain, LlamaIndex, Make, Zapier, n8n and webhooks can start the run and read the Dataset.

#### Use with AI agents (MCP)

- MCP server URL with only this Actor: `https://mcp.apify.com?tools=cliqtomedia/pdf-to-markdown`

- Smallest useful input:

  ```json
  { "pdfUrls": ["https://arxiv.org/pdf/1706.03762"] }
  ```

- Key output fields: `status` (did it work), `markdown` (the document), `chunks` (ready for embeddings, with pages), `tables` (tables as cells), `error.code` (what to fix).

- A 15-page text PDF takes about 3 seconds and costs $0.0082 with the start event. Each OCR page adds about 10 seconds (up to 30 for dense pages) and $0.012 per language.

- Limits: up to 100 URLs per run and 300 pages per document; public URLs only. For long scans, use `pages` or `maxPages` so the call returns in time (default timeout 30 minutes).

### Limitations and partial results

#### What it does not do

- No login, cookies, paywalls or private networks. No password cracking.
- No image, chart or formula description. Text in pictures is read only by OCR on scanned pages.
- Tables without lines are found by the columns of words. Merged or very complex cells can shift.
- Tokens are an estimate (characters / 4), not the count of a specific tokenizer.
- Files are deleted when the run ends. Only the Markdown and the summary are kept in your storage.

#### Speed and limits

- Text PDFs: about 3 seconds for a 15-page paper; 100 PDFs (535 pages) in about 45 seconds; a 300-page report with 1,281 tables in about a minute.
- OCR: about 10 seconds per page at 1 GB, up to 30 seconds for dense pages. A 36-page scan takes about 6 minutes. The default run timeout is 30 minutes (about 90–180 OCR pages); for bigger scans raise the timeout or use `pages`.
- Up to 100 URLs per run, up to 300 pages and 100 MB per document.
- A row larger than 8 MB moves its Markdown to a file (`markdownUrl`).

#### Partial results

If the run is close to its timeout, the Actor stops taking new pages, saves what it has with `status: "partial"`, and lists the documents it did not reach with `DEADLINE_REACHED`. You pay only for pages that were read.

### Troubleshooting

#### The row has `UNSUPPORTED_FILE_TYPE`

The link returned something that is not a PDF, such as an HTML page or an image. Open the link in a browser and copy the direct link to the `.pdf` file.

#### The Markdown is empty or has strange words

The page may be a scan. Check `pages[].method`: with `ocr: "off"` scanned pages stay empty. With OCR, low `ocrConfidence` means a poor scan; pick the right `languages`.

#### `PDF_PASSWORD_REQUIRED` or `PDF_DAMAGED`

The file needs a password or is broken. The Actor does not open such files and does not charge for them.

#### `DEADLINE_REACHED` or `TOO_MANY_FAILURES`

The run was about to time out, or too much time was lost on slow downloads and failed pages. Raise the run timeout, lower `maxPages`, or split the list into several runs.

#### `CHARGE_LIMIT_REACHED`

Your **Max total charge** was reached. Raise it or process fewer pages.

### FAQ

#### Do I need a login or an API key for the PDFs?

No. The Actor reads public links. You only need an Apify account to run it.

#### How is this different from a plain PDF text extractor?

A plain extractor gives one long text. This Actor keeps headings, lists and tables as Markdown and also returns chunks with pages and the headings above them, so you can load them into a vector database without your own splitter.

#### Why did I pay for OCR on a PDF?

Some pages had no text layer (scans), so they were read by OCR. Set `ocr: "off"` if you never want OCR.

#### Is the output always perfect?

No. Text-layer PDFs are converted well; complex tables and poor scans can have mistakes. Check `pages[].ocrConfidence` and the `warnings`.

#### Do you keep my documents?

No. The PDF files are deleted at the end of the run. The rows stay in your own Apify storage.

### Related Actors

- [PDF & Image to Text OCR for AI Agents](https://apify.com/cliqtomedia/pdf-text-ocr) — plain text per page from PDFs and images, when you do not need Markdown tables and chunks.
- [DOI Metadata & Bibliography Enrichment](https://apify.com/cliqtomedia/doi-bibliography-enrichment) — find paper metadata and open-access links by DOI, then convert the PDFs here.
- [YouTube Subtitles & Transcript Scraper API](https://apify.com/cliqtomedia/youtube-transcript-scraper) — text from videos for the same RAG pipeline.

### Support

For bugs, questions or feature requests, open an issue in the **Issues** tab of this Actor. Include the run ID, your input settings and the `error.code`. Do not send private documents, tokens or passwords.

PDF text and layout by [Poppler](https://poppler.freedesktop.org/) (GPL, run as a separate program); OCR by [Tesseract](https://github.com/tesseract-ocr/tesseract) (Apache-2.0). Markdown tables follow the [GitHub Flavored Markdown](https://github.github.com/gfm/#tables-extension-) format.

# Changelog

This Actor's version history is a separate document: https://apify.com/cliqtomedia/pdf-to-markdown/changelog.md

# Actor input Schema

## `pdfUrls` (type: `array`):

Up to 100 public http(s) URLs of PDF files. No login, cookies or private networks; password-protected PDFs are reported, not opened. Duplicates are processed once. Files are deleted when the run ends.

## `chunkSize` (type: `integer`):

Target size of each chunk in approximate tokens (characters / 4). A new heading always starts a new chunk; tables stay whole unless they alone are bigger, then they split by rows with the header repeated. 100–4000, default 500 (fits most embedding models).

## `chunkOverlap` (type: `integer`):

Approximate tokens of text repeated at the start of the next chunk in the same section, so sentences cut at a boundary keep context. Default 50 (or a quarter of a small chunk size); at most half the chunk size.

## `ocr` (type: `string`):

auto (default): use the PDF text layer and run OCR only on pages without usable text (scans). on: OCR every page. off: text layer only; scanned pages give no text. Text-layer pages are covered by one per-document charge; OCR is charged per page and per selected language.

## `languages` (type: `array`):

Languages of the document, used by OCR only. Up to 3. Each OCR page is charged once per selected language, so pick only the languages the document uses. Default: English.

## `pages` (type: `string`):

Optional page selection for every document, e.g. 1-3, 5, 10- (10 to the end). Empty: all pages, up to Max pages per document.

## `maxPages` (type: `integer`):

Upper limit of processed pages per document (after the page selection). Extra pages are skipped, not charged, and reported in warnings. 1–300, default 50.

## `maxFileSizeMb` (type: `integer`):

Larger files are not downloaded and get error FILE_TOO_LARGE. 1–100, default 50.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "chunkSize": 500,
  "chunkOverlap": 50,
  "ocr": "auto",
  "languages": [
    "eng"
  ],
  "maxPages": 50,
  "maxFileSizeMb": 50
}
```

# Actor output Schema

## `documents` (type: `string`):

One row per PDF: markdown, tables, chunks.

## `chunks` (type: `string`):

Chunk lists per document, ready for embeddings.

## `runSummary` (type: `string`):

Status, counts of documents, pages, tables and chunks, charged pages, error codes.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "pdfUrls": [
        "https://arxiv.org/pdf/1706.03762"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cliqtomedia/pdf-to-markdown").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "pdfUrls": ["https://arxiv.org/pdf/1706.03762"] }

# Run the Actor and wait for it to finish
run = client.actor("cliqtomedia/pdf-to-markdown").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "pdfUrls": [
    "https://arxiv.org/pdf/1706.03762"
  ]
}' |
apify call cliqtomedia/pdf-to-markdown --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cliqtomedia/pdf-to-markdown"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/3nCncNOre95PQ2F0e/builds/vHQWmVJRmL0q8b645/openapi.json
