Overview
The Markdown to PDF endpoint converts GitHub flavoured Markdown — headings, lists, tables, task lists, code blocks and more — into a clean, styled PDF.
Converting Markdown
Send a POST request to the following endpoint:
POST https://www.givemepdf.com/api/v1/pdf/from-markdown
Credits required: 2 / request
Authentication
Every API call must include an API-KEY header.
You can find your API key in your dashboard.
Request body
Send the request as form-data or JSON with a markdown parameter containing your Markdown.
| Parameter | Accepted value | Required |
|---|---|---|
markdown |
Markdown text, up to 500,000 characters | Yes |
document_name |
String, up to 60 characters. Also used as the PDF title. | No |
theme |
|
No |
orientation |
portrait (default) or landscape |
No |
Response
When the conversion succeeds, you will receive a JSON response with status code 200. Here is a sample response:
{
"message": "OK",
"data": {
"location": "https://givemepdf.com/storage/8b6293cb05ee815c/ossrPslsisxeRLp0.pdf",
"theme": "github",
"file_ttl_days": 1,
"warning": "This file is available for 1 day(s). Please download as soon as possible."
},
"meta": {
"remaining_free_credit": 3470,
"remaining_paid_credit": 10000
}
}
Possible errors
| Status | Message | How to fix it |
|---|---|---|
401 Unauthorized |
API-KEY missing | Make sure your request includes the API-KEY header with a value. |
401 Unauthorized |
Invalid API Key | Your API key is incorrect, expired or revoked. Sign in to your dashboard to copy a valid key or generate a new one. |
429 Too Many Requests |
You have hit your account per minute request limit | Each plan allows a limited number of requests per minute. Please wait a moment and try again. |
422 Unprocessable Entity |
Markdown content is required | Send your Markdown in the markdown parameter. |
422 Unprocessable Entity |
Markdown content may not be longer than 500,000 characters. | Split very large documents into several requests. |
500 Internal Server Error |
Could not create a PDF from this Markdown. | Something went wrong while creating your PDF. Please check the troubleshooting tips below. If the problem persists, contact us. Contact us |
Troubleshooting
- Raw HTML inside your Markdown is removed for security. Use Markdown syntax for formatting, or use the PDF Create endpoint if you need custom HTML.
-
Use absolute URLs for images, for example
. - Some emoji and complex scripts may not render. If a language does not render correctly, contact us and let us know which one.