Convert Files to Markdown with the API2PDF MarkItDown API
API2PDF now supports file to Markdown conversion with a new MarkItDown API endpoint.
Developers can provide a URL to a document and API2PDF will convert the file into clean Markdown, making document content easier to process, store, search, and send to AI and LLM applications.
The new endpoint is:
POST /markitdown
This makes API2PDF a simple File to Markdown API for developers building AI applications, RAG pipelines, document ingestion systems, search tools, knowledge bases, and other automated document-processing workflows.
Convert a File to Markdown with cURL
Here is a complete cURL example:
curl -X POST "https://v2.api2pdf.com/markitdown" \
-H "Authorization: YOUR-API-KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/document.pdf",
"fileName": "document.md"
}'
Replace YOUR-API-KEY with your API2PDF API key and provide a URL to the document you want to convert.
The url property contains the URL of the source file. The optional fileName property lets you specify the filename of the generated Markdown file.
File to Markdown API Request
The basic request is simple:
{
"url": "https://example.com/document.pdf",
"fileName": "document.md"
}
API2PDF downloads the source document and converts its contents to Markdown.
If the source document requires HTTP headers to access it, you can also provide extraHTTPHeaders:
{
"url": "https://example.com/private-document.pdf",
"fileName": "document.md",
"extraHTTPHeaders": {
"Authorization": "Bearer YOUR-TOKEN"
}
}
This is useful when processing documents stored behind authenticated URLs, signed endpoints, or internal applications.
Why Convert Documents to Markdown?
Documents such as PDFs and Office files are designed primarily for people to read. AI applications usually work better when the useful content of those documents is extracted into a structured text representation.
Markdown provides a lightweight representation that can preserve important document structure such as:
Headings
Paragraphs
Lists
Links
Tables
Code
Other textual structure
That makes Markdown particularly useful as an intermediate format for document-processing applications.
Instead of maintaining your own document parsing infrastructure, your application can send a file URL to API2PDF and receive Markdown that can be passed into the next stage of your application.
File to Markdown for AI and LLM Applications
One of the most useful applications of the MarkItDown API is preparing documents for large language models and AI agents.
Modern AI systems frequently need to work with existing documents. The original PDF, Word document, PowerPoint presentation, or other file format is often not the format you ultimately want to provide to an LLM.
Converting the document to Markdown creates a straightforward pipeline:
Document → API2PDF → Markdown → LLM
The resulting Markdown can then be used with AI systems such as ChatGPT, Claude, Gemini, or your own application built on an LLM API.
Common use cases include document summarization, question answering, information extraction, classification, analysis, and AI-generated content based on existing documents.
Build RAG Pipelines with Markdown
The API is also useful for Retrieval-Augmented Generation (RAG) systems.
A typical RAG document ingestion pipeline might look like:
Document → Markdown → Chunking → Embeddings → Vector Database → LLM
Converting source documents into Markdown gives the ingestion pipeline a consistent text-based representation before chunking and embedding.
For example, an application could use the API2PDF MarkItDown endpoint to convert uploaded business documents into Markdown, divide that Markdown into chunks, generate embeddings, and store those embeddings in a vector database.
When a user asks a question, the application can retrieve the relevant document chunks and provide them as context to an LLM.
Use Cases for a File to Markdown API
The MarkItDown endpoint can be useful anywhere an application needs to extract document content into a developer-friendly text format.
Common use cases include:
AI document ingestion
RAG pipelines
LLM preprocessing
AI agents
Document summarization
Knowledge bases
Semantic search
Enterprise search
Document indexing
Content migration
Document analysis
Automated data extraction
Search indexing
Archiving workflows
For applications processing many different documents, converting them into a common Markdown representation can simplify the rest of the processing pipeline.
MarkItDown as an API
MarkItDown is designed to transform documents into Markdown suitable for downstream text-processing and AI workflows.
With API2PDF, developers can use this functionality through a hosted REST API without operating their own document conversion infrastructure.
Instead of running document conversion services yourself, make an HTTP request:
File URL → POST /markitdown → Markdown
API2PDF handles the conversion and returns the result for your application to use.
Endpoint Reference
Method: POST
Endpoint: https://v2.api2pdf.com/markitdown
Authentication:
Authorization: YOUR-API-KEY
Content-Type:
application/json
Required field:
url — URL of the file to convert to Markdown.
Optional fields include:
fileName — Specify the filename for the generated Markdown file.
extraHTTPHeaders — HTTP headers API2PDF should include when retrieving the source file.
storage — Custom storage configuration for storing the generated file outside API2PDF's default storage.
The endpoint also supports the outputBinary query parameter when binary output is desired.
Getting Started
If you already use API2PDF, you can start converting files to Markdown using:
POST https://v2.api2pdf.com/markitdown
If you're new to API2PDF, create an account, obtain an API key, and make your first File to Markdown request.
API2PDF provides APIs for PDF generation, document conversion, PDF manipulation, document extraction, and other automated document-processing workflows.
The new MarkItDown endpoint extends those capabilities in the other direction: taking existing documents and turning their contents into Markdown that is ready for developers, AI applications, LLMs, and RAG pipelines.
For the complete request specification and available options, see the API2PDF v2 documentation.



