apyhub
Back
▣ FILE CONVERSION · SMART GENERATION

Convert Markdown to PDF API

Hosted on ApyHub

What it does

The Markdown to PDF API turns Markdown into a clean, shareable PDF with one POST request. Use it as a Markdown to PDF converter for READMEs, docs, release notes and reports, with no Pandoc or headless browser to install.

Send your content in whichever form you have:

  • Raw Markdown in the request body (up to 5 MB)
  • An uploaded file, either .md or plain text (up to 3 MB)
  • A public URL that serves Markdown or plain text, such as a raw GitHub README (up to 5 MB)

Then choose the response: get the PDF file straight back, or receive a signed URL to hand to a user or storage job. The link expires after 5 minutes, so download it promptly. Set the optional output parameter to name the file.

It fits any stack. Call it from Python, Node.js or a CI pipeline to turn md to pdf on every build. Need more control over layout? Convert Markdown to HTML first, adjust the markup, then render it with the HTML to PDF API. Embed Mermaid diagrams or LaTeX with the Diagram, Math & Code Render API, protect finished files with the PDF Watermark API, or combine documents with Merge Files to PDF.

▣ ENDPOINT 01 / 06
POST
URL → PDF
https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-url-pdf-url

QUICKSTART

GUIDE

Quickstart

Convert a Markdown file at a public URL into a PDF and return a signed download link.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-url-pdf-url?output=my-document" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.md"}'

What you'll get back

Returns a JSON object with a data string field containing a signed S3 URL for the generated PDF file, valid for 5 minutes.

{
  "data": "https://s3.amazonaws.com/bucket/consumer/converter-markdown-pdf/file.pdf?..."
}
TRY ITLIVE · 50 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*
URL pointing to a Markdown file. The remote resource must respond with a Content-Type of text/markdown or text/plain and must not exceed 5 MB.

About this endpoint

What it does

Converts a Markdown file available at a URL into a PDF and returns a signed S3 URL for the generated PDF.

Query Parameter(s)

AttributeTypeDescription
outputStringOutput name. Default: sample-output.

Request Body

ParameterTypeDescription
urlStringURL pointing to a Markdown file. The remote resource must respond with a Content-Type of text/markdown or text/plain and must not exceed 5 MB.

Response

Returns a JSON object with a data string field containing a signed S3 URL for the generated PDF file. The URL is valid for 5 minutes.

ParameterTypeDescription
dataStringSigned S3 URL for the generated PDF file. Valid for 5 minutes.
▣ ENDPOINT 02 / 06
POST
File upload → PDF
https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-file-pdf-file

QUICKSTART

GUIDE

Quickstart

Convert a Markdown file to a PDF by uploading the file and choosing an output name.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-file-pdf-file?output=my-document" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.md"

What you'll get back

Returns a downloadable PDF file as binary data, rendered from the Markdown input.

TRY ITLIVE · 50 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*
Markdown file to convert. Must have MIME type text/markdown or text/plain, or a .md file extension. Maximum size 3 MB.

About this endpoint

What it does

Uploads a Markdown file and returns a downloadable PDF file rendered from that input.

Query Parameter(s)

AttributeTypeDescription
outputStringOutput name for the generated PDF file. Default: sample-output.

Request Body

ParameterTypeDescription
fileBinaryMarkdown file to convert. Must have MIME type text/markdown or text/plain, or a .md file extension. Maximum size 3 MB.

Response

Returns a downloadable PDF file as a binary response. The output schema is a single binary string representing the rendered PDF.

ParameterTypeDescription
valueStringBinary PDF file downloaded from the Markdown input.

Notes

The uploaded file must be a Markdown source accepted by the schema: either text/markdown, text/plain, or a .md file, and it must not exceed 3 MB.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 03 / 06
POST
File upload → PDF
https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-file-pdf-url

QUICKSTART

GUIDE

Quickstart

Upload a Markdown file to generate a PDF and receive a signed download URL.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-file-pdf-url?output=my-document" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.md"

What you'll get back

Returns a JSON object with a required data string field containing a signed S3 URL for the generated PDF file, valid for 5 minutes.

{
  "data": "https://s3.amazonaws.com/bucket/consumer/converter-markdown-pdf/file.pdf?..."
}
TRY ITLIVE · 50 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*
Markdown file to convert. Must have MIME type text/markdown or text/plain, or a .md file extension. Maximum size 3 MB.

About this endpoint

What it does

Converts an uploaded Markdown file into a PDF and returns a signed S3 URL to the generated PDF. The upload is sent in the request body as a binary file, and the response contains the PDF download URL in data.

Query Parameter(s)

AttributeTypeDescription
outputStringOutput name. Default: sample-output.

Request Body

ParameterTypeDescription
fileBinaryMarkdown file to convert. Must have MIME type text/markdown or text/plain, or a .md file extension. Maximum size 3 MB.

Response

Returns a JSON object with a data string field containing a signed S3 URL for the generated PDF file. The URL is valid for 5 minutes.

ParameterTypeDescription
dataStringSigned S3 URL for the generated PDF file. Valid for 5 minutes.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 04 / 06
POST
Raw Markdown → PDF
https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-raw-pdf-file

QUICKSTART

GUIDE

Quickstart

Convert raw Markdown into a PDF file by sending the Markdown text as plain text.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-raw-pdf-file?output=my-document" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: text/plain" \
  --data-binary #x27;# Title\n\n## Section\n\nParagraph text here.'

What you'll get back

Returns a binary PDF file (format: binary) downloadable as the rendered output of your Markdown input.

TRY ITLIVE · 50 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.
Raw Markdown content. Maximum size 5 MB.

About this endpoint

What it does

Converts raw Markdown content into a downloadable PDF file. You send the Markdown in the request body and receive the rendered PDF as a binary file in response.

Query Parameter(s)

AttributeTypeDescription
outputStringOutput filename base. Default: sample-output.

Request Body

ParameterTypeDescription
bodyStringRaw Markdown content. Maximum size 5 MB.

Response

Returns a downloadable PDF file as a binary response. The output schema is a single binary string, so the response is not a JSON object and does not include named fields.

▣ ENDPOINT 05 / 06
POST
Raw Markdown → PDF
https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-raw-pdf-url

QUICKSTART

GUIDE

Quickstart

Send raw Markdown in the request body to generate a PDF link.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-raw-pdf-url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: text/plain" \
  --data-binary #x27;# Title\n\n## Section\n\nParagraph text here.'

What you'll get back

Returns a JSON object with a data string field containing a signed URL to the generated PDF file.

{
  "data": "https://s3.amazonaws.com/bucket/consumer/converter-markdown-pdf/file.pdf?..."
}
TRY ITLIVE · 50 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.
Raw Markdown content. Maximum size 5 MB.

About this endpoint

What it does

Converts raw Markdown content into a PDF and returns a signed S3 URL where the generated file can be downloaded.

Query Parameter(s)

AttributeTypeDescription
outputStringOutput name. Default: sample-output.

Request Body

ParameterTypeDescription
bodyStringRaw Markdown content. Maximum size 5 MB.

Response

Returns a JSON object with a data string field containing a URI to the generated PDF file. The data value is a signed S3 URL valid for 5 minutes.

ParameterTypeDescription
dataStringSigned S3 URL for the generated PDF file. Valid for 5 minutes.
▣ ENDPOINT 06 / 06
POST
URL → PDF
https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-url-pdf-file

QUICKSTART

GUIDE

Quickstart

Convert a Markdown file at a URL into a downloadable PDF. Replace the sample Markdown URL if you want to render your own file.

curl -X POST "https://api.eu.apyhub.com/apyhub/convert-markdown-to-pdf/md-url-pdf-file?output=my-document" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://assets.apyhub.com/samples/sample.md"
  }'

What you'll get back

Returns a binary PDF file in the response body, downloaded from the Markdown input.

TRY ITLIVE · 50 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*
URL pointing to a Markdown file. The remote resource must respond with a Content-Type of text/markdown or text/plain and must not exceed 5 MB.

About this endpoint

What it does

Converts a Markdown file available at a URL into a PDF and returns the generated PDF as a downloadable binary response.

Query Parameter(s)

AttributeTypeDescription
outputStringOutput file name without extension. Default: sample-output.

Request Body

ParameterTypeDescription
urlStringURL pointing to a Markdown file. Must be a valid URI. The remote resource must respond with Content-Type of text/markdown or text/plain and must not exceed 5 MB.

Response

Returns a downloadable PDF file as binary content. The response is a binary PDF generated from the Markdown input.

ParameterTypeDescription
binaryStringDownloadable PDF file rendered from the Markdown input.

Notes

The source Markdown URL must point to a resource that responds with Content-Type: text/markdown or text/plain, and the file must be no larger than 5 MB.

▣ 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.