PDF to Markdown for RAG (docs-to-markdown)

Wandelt Links zu PDF-, Word-, PowerPoint-, Excel-, HTML-, CSV- oder Textdateien in sauberes Markdown für KI-Pipelines um, eine Zeile pro Dokument. Tabellen in PDFs mit Linien werden als Markdown-Tabellen ausgegeben, und RAG-Chunks mit Seitenzahlen sind integriert. Keine OCR, daher bleiben gescannte Seiten leer; passwortgeschützte Dateien werden nicht unterstützt. Das Tool läuft als Apify Actor über Apifys gehosteten MCP-Server. Dafür benötigen Sie ein Apify-Konto und ein API-Token. Die Abrechnung erfolgt pro Dokument und pro PDF-Seite: 0,004 USD pro Dokument und 0,0002 USD pro Seite im Free-Tarif, zuzüglich einer kleinen Startgebühr. Inoffizielles Tool.

Gehosteter MCP-Server

npx add-mcp 'https://mcp.apify.com/?tools=plainrecordlabs/docs-to-markdown'

Installiert in Claude Code, Codex, Cursor und mehr

Dokumentation

PDF to Markdown, PDF Text Extractor: Word to Markdown for RAG (plainrecordlabs/docs-to-markdown) Actor

Extract text from PDF files and convert PDF, Word DOCX, PowerPoint PPTX, Excel XLSX and HTML files to clean Markdown for AI pipelines, one row per document. Ruled PDF tables become Markdown tables or an Excel file, with optional RAG chunks. No OCR, so scanned pages come back empty.

Pricing

from $3.00 / 1,000 document converteds

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 section below.

Each client library has reference documentation the quickstart does not restate: JavaScript/TypeScript (npm install apify-client) and Python (pip install apify-client).

README

PDF to Markdown, PDF Text Extractor: Word to Markdown for RAG

Extract the text from PDF files and convert PDF and Word documents to Markdown for RAG and other AI pipelines. Give it links to PDF, Word (DOCX), PowerPoint, Excel, HTML, CSV or text files and get one row per document with its text as Markdown, the properties stored in the file, its page, word and table counts, and optional chunks ready for embedding. It can also put the tables from your PDFs into an Excel file.

No OCR. It reads PDFs that have a text layer. A scanned page that is only an image comes back empty, is listed in pagesWithoutText and is not charged.

Paste a few document links and press Start.

Why use it

  • PDF, Word, PowerPoint, Excel, HTML, CSV and text files all go in the same run.
  • PDF tables drawn with ruling lines come back as Markdown tables, and as an Excel file if you want one, at no extra charge.
  • RAG chunks with your own size and overlap are built in, and a PDF's chunks say which pages they come from.
  • Pick the PDF pages you want, like 1-3,7, and pay only for those pages.
  • The start fee is 0.001 USD per run, and you pay per document and PDF page with no monthly rental.
  • Each site's robots.txt is honoured, and your files stay in your own run's storage.

What people use it for

  • RAG and AI agents: feed documents into a vector store or an LLM as Markdown instead of messy raw text.
  • Extract text from PDF reports: get the text of reports, guides and court opinions in page order, one row per file, with page, word and character counts.
  • Search and knowledge bases: convert a folder of reports, decks and spreadsheets into one format.
  • Data teams: pull the text, the ruled tables and the stored author and dates out of PDFs and Office files without opening them.
  • PDF tables to Excel: extract tables from PDF reports and statements into one XLSX workbook per PDF.

How to use

  1. Paste one or more direct file links into Document URLs, like https://www.irs.gov/pub/irs-pdf/fw9.pdf. Put in as many links as you like. Each file comes back as its own row.
  2. Optional: open RAG chunks, turn on Add RAG chunks and set Chunk size (characters) and Chunk overlap (characters).
  3. Optional: open PDF options and limits to mark page breaks, pick pages with PDF page range, cap Max PDF pages per document or change Max file size (MB). A page range like 1-3,7 reads pages 1, 2, 3 and 7 of each PDF, and 10- reads from page 10 to the end. With no range, the cap counts from page 1, so a cap of 12 reads pages 1 to 12.
  4. Optional: open Text output and turn on Add plain text or Add text per PDF page. Both are off by default to keep rows small.
  5. Optional: open Excel tables and turn on Excel file of PDF tables to also get the PDF tables as an XLSX file.
  6. Press Start. When the run ends, open the Output tab or download the results from the Storage tab as JSON, CSV or Excel.
  7. Files that could not be converted are listed with the reason in the run's SUMMARY record, in the status message and in the log.

Example: extract text from several PDFs in one run

This input reads the first 4 pages of three US government PDFs, an FTC guide, a NIST framework and a Census report:

{
  "urls": [
    { "url": "https://www.ftc.gov/system/files/documents/plain-language/pdf-0136_proteting-personal-information.pdf" },
    { "url": "https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-218.pdf" },
    { "url": "https://www2.census.gov/library/publications/2024/demo/p60-282.pdf" }
  ],
  "maxPages": 4
}

On 2026-10-31 it returned 3 rows in input order, with 2,608, 6,432 and 3,179 characters of text, 12 PDF pages in all. At Free and Bronze prices that is 3 x 0.004 + 12 x 0.0002 + 0.001 = 0.0154 USD. Your files and prices may differ.

What it handles

FileHow it converts
PDFThe text of each page in page order, with each page's footnotes at its end. Tables drawn with ruling lines become Markdown tables. The title, author, subject, keywords, creator, producer, dates and PDF version stored in the file are returned when the PDF has them.
Word (DOCX)Headings, paragraphs, lists and tables. The author, subject, keywords, dates and the program that saved the file, when the file stores them.
PowerPoint (PPTX)Slide titles and text, in slide order. The same stored properties as Word.
Excel (XLSX)Each sheet as a Markdown table. Title rows and notes come out as text, a two-row header is joined into one, and empty rows and columns are left out. The same stored properties as Word.
HTMLThe main part of the page, without the site menu, banner and footer. Links and images get full URLs.
CSV, textCleaned to Markdown.

A document whose Markdown is too big for one result row (about 8 MB, like a spreadsheet with 30,000 rows) is still converted. The row holds the first part and has markdownTruncated set to true, and the whole Markdown is a file in the run's key-value store, linked in markdownUrl.

PDF page range

Put the pages you want in PDF page range. Use page numbers and ranges split by commas.

  • 1-3,7 reads pages 1, 2, 3 and 7.
  • 10- reads from page 10 to the last page.
  • Pages come back in page order, each once, whatever order you type them in.
  • You pay only for the pages read. A range does not change the document charge.
  • Pages past the end of a PDF are skipped. If none of the pages are in a PDF, that file is listed as not converted with the reason and is not charged.
  • Max PDF pages per document still applies. A range of 2-50 with a cap of 10 reads pages 2 to 11.
  • The row's pagesRead lists the pages read, and pagesConverted counts them.
  • The same range is used for every PDF in the run. Word, PowerPoint and other files ignore it.
  • A range that is not valid, like 3-1 or 0, stops the run before any file is fetched, and the status message says what to fix.

Excel tables

Turn on Excel file of PDF tables to extract tables from PDF files into Excel. Each PDF with ruled tables gets one XLSX workbook with one sheet per table, named by its page, like Page 3 table 1. The download link is in the result's xlsxUrl field and in the Excel tables part of the Output tab. The file is also in the run's key-value store.

  • The sheets hold the same tables as the Markdown, and the first row is bold.
  • Plain numbers, dollar amounts and percents are stored as numbers you can add up, shown as the PDF showed them. Codes with leading zeros, like ZIP codes, stay as text.
  • Only tables drawn with ruling lines are found. A table with no lines, or with only some of its lines, can come out with several values in one cell or not at all. Check the sheets against the PDF before you rely on them.
  • Scanned pages have no text, so they give no tables.
  • Word, PowerPoint and other files get no Excel file. A PDF with no ruled tables gets a note in xlsxNote instead.
  • The Excel file has no extra charge.

What it does not do

  • No OCR. It does not read scanned pages. A page that is only an image has no text layer, so it comes back empty, is listed in pagesWithoutText and is not charged.
  • PDF headings are not detected, so PDF text comes back as paragraphs.
  • Tables drawn without lines in a PDF come through as aligned text, not as a Markdown table. A table with lines between its columns but not between its rows is split into one row per text line. Row labels printed outside a table's lines stay in the text and can be missing from the table.
  • PDF text keeps what the page prints. Running page headers, footnote marks next to words and words split with a hyphen at a line end all stay in the text.
  • A wrapped PDF line that starts with a number can still come out as a list item when the line above ends with an abbreviation and a period, like Tr..
  • Some PDF fonts lose the spaces between words, so the words run together. On forms, labels printed beside the boxes can mix into the text. Pages set in two columns can come out with the columns mixed.
  • Document properties are read from PDF, Word, PowerPoint and Excel files only. HTML, CSV and text files get at most a title, and the other property fields are null. Properties are what the file's maker or program stored, so they can be blank, old or wrong. A Word file made from a template can keep the template's author and dates.
  • A chunk's pageStart and pageEnd are worked out from where its text sits in the Markdown. Text a PDF repeats on many pages, like a running header, counts as the page it was read from. With Mark PDF page breaks on, a page marker is part of its page, so a chunk can name a page whose only text is its marker.
  • Files are converted one at a time, so a big batch takes longer than a few files.
  • It takes links to files. It does not take uploads of files from your computer.
  • The HTML main part is found from the page's own markup, so on some sites a menu or a sidebar can still come through.
  • Password-protected files are not supported.

Input

FieldWhat it does
Document URLsDirect links to the files, one or many. Sites whose robots.txt disallows automated access are skipped.
Add RAG chunksAlso returns the Markdown split into chunks at paragraph boundaries. A PDF's chunks also have pageStart and pageEnd.
Chunk size and Chunk overlapCharacters per chunk and how much carries over.
Mark PDF page breaksPuts a <!-- page N --> comment before each PDF page.
PDF page rangeReads only these pages of each PDF, like 1-3,7 or 10-. Empty reads from page 1.
Max PDF pages per documentReads at most this many pages of each PDF, and so caps the cost. With a range, it caps the pages read from the range.
Max file size (MB)Larger files are skipped.
Excel file of PDF tablesAlso writes each PDF's ruled tables to an XLSX file, one sheet per table. Off by default.
Add plain textAlso returns each document as plain text in text. Off by default.
Add text per PDF pageAlso returns a pages list for each PDF with each page's number and plain text. Off by default.

Output

One item per converted document:

Sample output table with six converted PDFs from a real run

{
  "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
  "fileName": "fw9.pdf",
  "fileType": "pdf",
  "title": "Form W-9 (Rev. March 2024)",
  "author": "...",
  "subject": "...",
  "keywords": "...",
  "creator": "...",
  "producer": "...",
  "creationDate": "...",
  "modificationDate": "...",
  "pdfVersion": "1.7",
  "fileSize": 140000,
  "pageCount": 6,
  "pagesConverted": 6,
  "pagesWithoutText": [],
  "tableCount": 1,
  "charCount": 37929,
  "wordCount": 6311,
  "markdown": "Form W-9 Request for Taxpayer Identification Number and Certification ...",
  "chunks": [{ "index": 0, "text": "...", "pageStart": 1, "pageEnd": 2 }]
}

The example values are illustrative.

These are the properties read from the Census report p60-282.pdf on 2026-10-31. It stores no keywords, so that field is null:

{
  "title": "Income in the United States: 2023",
  "author": "U.S. Census Bureau",
  "subject": "Current Population Reports",
  "keywords": null,
  "creator": "Adobe InDesign 19.4 (Windows)",
  "producer": "Adobe PDF Library 17.0",
  "creationDate": "2024-08-29T06:54:07-04:00",
  "modificationDate": "2024-09-04T11:53:37-04:00",
  "pageCount": 59
}

With Add plain text on, each item also has text. With Add text per PDF page on, a PDF's item also has pages. With a PDF page range, a PDF's item also has pagesRead:

{
  "pagesRead": [2, 4, 5],
  "text": "Form W-9 Request for Taxpayer Identification Number and Certification ...",
  "pages": [
    { "page": 2, "text": "..." },
    { "page": 4, "text": "..." },
    { "page": 5, "text": "..." }
  ]
}

A row too big for the dataset also has markdownUrl and markdownKey for the whole Markdown file, chunksUrl when chunks are on and pagesUrl when text per page is on. Its markdown, text, chunks and pages cover the first part only.

With Excel file of PDF tables on, each item also has xlsxUrl with the download link, xlsxKey with the file's key in the run's key-value store, and xlsxNote with the reason when there is no file.

FieldWhat it holds
url, fileName, fileType, titleThe source link, the file name, its type and the title stored in the file.
author, subject, keywords, creator, producerProperties stored in the PDF, Word, PowerPoint or Excel file. Each is null when the file does not have it, and for other file types. For Office files creator is the program that saved the file and producer is always null.
creationDate, modificationDateThe dates stored in the file, in ISO 8601 and as precise as the file gives them. Null when there is no readable date.
pdfVersionThe PDF version the file declares, like 1.7. Null for other file types.
fileSizeThe file's size in bytes as downloaded.
pageCount, pagesConverted, pagesWithoutTextPDF pages, pages converted, and pages with no text.
pagesReadThe PDF page numbers read, when PDF page range is set.
tableCount, charCount, wordCountTables written as Markdown, and the size of the text.
markdownThe document as Markdown.
chunksRAG chunks, each with index and text, when chunking is on. A PDF's chunks also have pageStart and pageEnd, the first and last page their text comes from, counting the overlap.
markdownTruncated, markdownUrl, chunksUrlSet when the row was too big, with links to the whole files.
xlsxUrl, xlsxKey, xlsxNoteThe Excel file of PDF tables, or why there is none.
textThe document as plain text, when Add plain text is on.
pages, pagesUrlEach PDF page's number and plain text, when Add text per PDF page is on. pagesUrl links all pages when the row was too big.
noText, notenoText is true when a file gave no text at all, like a fully scanned PDF. Such a file is not charged and note says so. note also says when some PDF pages had no text.

The Document properties view of the Output tab shows each file's title, author, subject, keywords, creator, producer, dates, PDF version, size in bytes and page count.

What you are charged for

  • Files that could not be converted are not charged. They are listed with the reason in the run's SUMMARY record.
  • A file that gives no text at all, like a fully scanned PDF, is stored with noText set to true and is not charged.
  • PDF pages with no text layer are not charged. They are still listed in pagesWithoutText.
  • With a PDF page range, only the pages read are charged.

Privacy

Your files are fetched only for your run and converted in memory. Nothing is kept outside your own run's storage.

FAQ

Can I use it as a PDF text extractor or a PDF to text converter? Yes, for PDFs with a text layer. Since PDF headings are not detected, the Markdown of a PDF is mostly plain paragraphs in page order, with Markdown tables where the PDF has ruled tables and list marks where it has lists. Turn on Add plain text to also get it as plain text in text, and Add text per PDF page to get it page by page with page numbers.

How do I extract text from only some pages of a PDF? Put the pages in PDF page range, like 5-8 or 1,3,10-12. Only those pages are read and charged. To read only the start of long PDFs, set Max PDF pages per document instead. On 2026-10-31 a 64-page NIST report with a cap of 12 returned the text of its first 12 pages, 30,236 characters, and was charged for those 12 pages only.

Does it return the PDF's author and dates? Yes, when the PDF stores them. The title, author, subject, keywords, creator, producer, creation date and modification date come back as their own fields, with the dates in ISO 8601, plus the PDF version and the file size. Word, PowerPoint and Excel files fill the same fields from their stored properties. A property the file does not have is null.

Can I cite the page a RAG chunk came from? Yes, for PDFs. With Add RAG chunks on, each chunk of a PDF has pageStart and pageEnd, the first and last page its text comes from. With a PDF page range they are the real page numbers of the PDF.

How do I convert a PDF to Markdown for an LLM or RAG? Paste the PDF link into Document URLs and press Start. Turn on Add RAG chunks to also get the text split into overlapping chunks ready to embed in a vector store.

Does it keep tables? Tables in Word and Excel files, and PDF tables drawn with ruling lines, come back as Markdown tables. PDF tables without lines come through as aligned text.

Can I extract tables from a PDF to Excel? Yes, for tables drawn with ruling lines. Turn on Excel file of PDF tables for PDF to XLSX output with one sheet per table. Tables without lines are not found, so check the sheets against the PDF.

Can it convert scanned PDFs? No. It does not run OCR, so a page that is only an image comes back empty and is listed in pagesWithoutText. Pages with no text are not charged, and a file with no text at all is not charged.

Can I convert Word, PowerPoint and Excel files too? Yes. DOCX, PPTX, XLSX, HTML, CSV and text files all convert to Markdown in the same run.

Can I call it from an API or an AI agent? Yes. Like any Apify Actor it runs from the Apify API, the Python and JavaScript clients, an integration or the Apify MCP server, and returns one row per document.

Use it from an AI agent or MCP

AI agents can find and run this Actor through the Apify MCP server. Its search-actors tool finds it, fetch-actor-details reads the input and output fields described above, and call-actor runs it on your Apify account at the prices on the Pricing tab. To give an agent only this Actor as a tool, add it to the server URL: https://mcp.apify.com?tools=plainrecordlabs/docs-to-markdown.

For example, this input converts the IRS Form W-9 PDF to Markdown and splits it into RAG chunks:

{ "urls": [{ "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf" }], "chunks": true }

Pricing

You pay per document converted, plus a small charge per PDF page and a start fee per run. Word, PowerPoint, Excel and HTML files have no page charge. The Excel file of PDF tables is included at no extra charge. There is no monthly rental. A file with no text at all, like a fully scanned PDF, is not charged, and PDF pages with no text are not charged.

Apify planPer documentPer PDF pageStart fee per run
Free and Bronze0.004 USD0.0002 USD0.001 USD
Silver0.0035 USD0.0002 USD0.001 USD
Gold, Platinum and Diamond0.003 USD0.0002 USD0.001 USD

The start fee is charged once per GB of run memory. This Actor runs at 1 GB by default, so that is one start fee.

Per 1,000 files on the Free or Bronze plan, before the start fee:

1,000 files ofDocumentsPagesTotal
1 PDF page each4.00 USD0.20 USD4.20 USD
10 PDF pages each4.00 USD2.00 USD6.00 USD
Word, PowerPoint, Excel or HTML4.00 USDnone4.00 USD

Example: a run that converts 10 PDFs of 20 pages each on the Free or Bronze plan costs 10 x 0.004 = 0.04 USD for the documents, 200 x 0.0002 = 0.04 USD for the pages and 0.001 USD to start, so 0.081 USD in all. This is only an example. The Pricing tab shows the current prices and is the one to go by. PDF page range and Max PDF pages per document both cap what one document can cost.

Related Actors

  • Image Upscaler 2x 3x 4x: makes small images 2x, 3x or 4x bigger with Real-ESRGAN and returns them as PNG, JPEG or WebP.

Changelog

  • November 1, 2026: Word, PowerPoint and Excel files now fill the author, subject, keywords, creator and date fields from their stored properties. Every row has the file size in bytes, and PDFs have their PDF version. A PDF's RAG chunks now have pageStart and pageEnd. A chunk overlap as large as the chunk size no longer stalls a run on a long paragraph. Prices are unchanged.
  • October 31, 2026: new optional PDF page range, charged only for the pages read. Each row now also has the author, subject, keywords, creator, producer and dates stored in the PDF, null when the PDF does not have them. Files and PDF pages with no text are no longer charged, also with page markers on. New optional plain text and text per PDF page outputs, off by default. A wrapped PDF line that starts with a number, like a page cite or a year, now stays in its sentence instead of turning into a list item.

Feedback

Need another file type or a fix? Open an issue on the Issues tab.

Actor input Schema

urls (type: array):

Direct links to PDF, DOCX, PPTX, XLSX, HTML, CSV or text files, for example https://www.irs.gov/pub/irs-pdf/fw9.pdf. Sites whose robots.txt disallows automated access are skipped. A file that cannot be read is listed in the run summary and the other files still convert.

chunks (type: boolean):

Also split each document's Markdown into chunks at paragraph boundaries, ready for embedding. The chunks go in a chunks list on each result, next to the full Markdown. A PDF's chunks also carry pageStart and pageEnd, the pages their text comes from. For example, turn it on to load the chunks straight into a vector store.

chunkSize (type: integer):

Target length of each chunk in characters, not tokens, for example 2000. In English text 2,000 characters is roughly 400 to 500 tokens. Chunks break between paragraphs, so most come out a little under the target, and one long paragraph or table can make a chunk up to about one and a half times the target.

chunkOverlap (type: integer):

Characters carried over from the end of one chunk to the start of the next, for example 200, so text near a boundary appears in both chunks. Keep it well under Chunk size.

pageMarkers (type: boolean):

Insert a comment before each PDF page, so you can cite page numbers, for example page 3 of a report. The comment does not show when the Markdown is rendered.

pageRange (type: string):

Convert only these pages of each PDF, for example 1-3,7 for pages 1, 2, 3 and 7, or 10- for page 10 to the end. Leave it empty to start at page 1. Pages come back in page order, and you pay only for the pages converted. Pages past the end of a PDF are skipped. Max PDF pages per document still caps how many pages are read.

maxPages (type: integer):

Convert at most this many pages of each PDF, for example 20 to read only the start of long reports. With a PDF page range, it caps the pages read from that range. You pay per page converted. Each result's pagesConverted field shows how many pages were read.

maxFileMb (type: integer):

Skip any file larger than this many megabytes, for example 50. Skipped files are listed in the run summary.

xlsxTables (type: boolean):

Also write the ruled tables found in each PDF to an Excel (.xlsx) file, one sheet per table, named by page, like Page 3 table 1. Plain numbers, dollar amounts and percents become real numbers. Each result gets an xlsxUrl download link, and the file sits in the run's key-value store. Tables drawn without lines are not found. There is no extra charge.

plainText (type: boolean):

Also return each document as plain text in a text field, next to the Markdown. Table rows become cells split by tabs, and heading, link and bold marks are left out. For example, turn it on to feed text to a tool that does not read Markdown.

perPageText (type: boolean):

Also return a pages list for each PDF, with each converted page's number and its plain text, for example to cite page 3 of a report. Pages with no text come back with empty text. Other file types get no pages list.

Actor input object example

{
  "urls": [
    {
      "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
    }
  ],
  "chunks": true,
  "chunkSize": 1000,
  "chunkOverlap": 100,
  "pageMarkers": true,
  "pageRange": "1-3,7",
  "maxPages": 20,
  "maxFileMb": 50,
  "xlsxTables": true,
  "plainText": true,
  "perPageText": true
}

Actor output Schema

documents (type: string):

One item per converted document, with its Markdown.

excelTables (type: string):

Download links for the Excel files of PDF tables, when Excel file of PDF tables is on.

summary (type: string):

Counts, plus each document that could not be converted and why.

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

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 = {
    "urls": [
        {
            "url": "https://plainrecordlabs.web.app/sample-report.pdf"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainrecordlabs/docs-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

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 = { "urls": [{ "url": "https://plainrecordlabs.web.app/sample-report.pdf" }] }

# Run the Actor and wait for it to finish
run = client.actor("plainrecordlabs/docs-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

echo '{
  "urls": [
    {
      "url": "https://plainrecordlabs.web.app/sample-report.pdf"
    }
  ]
}' |
apify call plainrecordlabs/docs-to-markdown --silent --output-dataset

MCP server setup

{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,plainrecordlabs/docs-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/eyRjWnZuhDbdK4wcD/builds/k6PoAJlw3uVvarF9L/openapi.json