Welcome to the guide for the MakeMYPDF API. This is a documentation of all the steps, guidelines and details you need to use the API.
The examples given will be in Node.js, cURL, Python, PHP, Ruby, and C#
Developers send their API keys with each request in order for our service to authenticate their accounts. You can manage your API keys from your dashboard.
Requests made without an API key will be more rate-limited and will also have the MakeMyPDF watermark. This is useful for testing our API. Note that requests without an API key will also be slower, as such developers are better served using the API key for more long-term use.
Send your API key via the HTTP Header X-API-Key with each request.
fetch('https://makemypdf.org/api/pdf/generate', { method: 'POST', headers: { 'X-API-Key': 'your_api_key', ... }, }) ...
We have a sandbox parameter which we set to true by default when you start using the service.
The sandbox parameter adds a watermark to generated PDFs. PDFs with the watermark do not count as conversions and do not use up your credits.
This setup ensures you can try out and run tests without worrying about using up your credits.
Once you are done, you can then remove the sandbox parameter or set it to false which removes the watermark.
fetch('https://makemypdf.org/api/pdf/generate', { method: 'POST', body: { sandbox: true ... } }) ...
We implement rate limiting for requests without an API key. The limit is 3 requests per minute.
Once you create an account and start using your API key with each request, you can make up to 300 requests per minute.
After the limit is reached, further requests will return a response with HTTP status code 429 (Too Many Requests)
Please note that we restrict use of testing/sandbox requests to 10 requests per minute.
When you make requests, our responses will contain these headers which let you know your current usage:
| HEADER | PURPOSE |
|---|---|
| X-RateLimit-Limit | Max number of requests allowed per minute |
| X-RateLimit-Remaining | Number of requests left before reaching the limit |
| X-RateLimit-Reset | Timestamp for when the limit resets |
/ Each response will contain these 3 rate limit headers: / X-RateLimit-Limit: 300 / X-RateLimit-Remaining: 70 / X-RateLimit-Reset: 1466636890
The following is a list of the HTTP status codes denoting the different kinds of errors you might encounter using our API.
If you encounter anything outside of these expected errors, please feel free to let us know.
We communicate error information by providing the following properties, in combination with the HTTP status codes:
The MakeMyPDF API uses the following error codes:
If you need any assistance converting your documents or with anything else, please feel free to reach out to us. We work hard to provide assistance quickly.
Our support team is available at [email protected]
Converting documents starts by making a POST request to our /api/pdf/generate endpoint.
Provide your API key via the X-API-Key header. The body of the request should be comprised of the following:
Please note that we restrict use of testing/sandbox requests to 10 requests per minute.
When you make requests, our responses will contain these headers which let you know your current usage:
const fetch = require('node-fetch'); const { pipeline } = require('stream'); const { createWriteStream } = require('fs'); const { promisify } = require('util'); const streamPipeline = promisify(pipeline); fetch('https://makemypdf.org/api/pdf/generate', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'your_api_key', }, body: JSON.stringify({ input: { type: 'url', source: 'https://en.wikipedia.org/wiki/Main_Page' }, sandbox: false, }) }) .then(async (res) => { if (!res.ok) { throw new Error('Failed to convert document'); } await streamPipeline(res.body, createWriteStream('document.pdf')); }) ...
This is how you get information on how much credits are available in total, how much you have used and how much are left - according to the API key you provide.
Provide your API key via the X-API-Key header.
const fetch = require('node-fetch'); fetch('https://makemypdf.org/api/credits/usage', { method: 'GET', headers: { 'X-API-Key': 'your_api_key', } }) .then(async (res) => { if (!res.ok) { throw new Error('Failed to convert document'); } console.log(await res.json()); // { // "limit": 20000, // "remaining": 19891, // "used": 109 // } }) ...