Free
For testing and side projects
$0forever
No credit card
No overage charges
100 requests / month
Includes:
- Usage: Non-commercial
- PDF conversion
- URL conversion
- Document configuration
AI agents: the setup steps for Pdflayer are in the Agents section of this page (#agents) and as Markdown at /products/pdflayer/agents.md. Index of every APILayer API: https://apilayer.com/llms.txt
High-quality HTML to PDF conversion API · by APILayer
Free plan · 100 requests / month · no card
Overview
Turn any URL or HTML into a polished PDF with one simple API. Pdflayer renders HTML, CSS, JavaScript and SVG in seconds. You can add headers, footers, page numbers and watermarks without running your own conversion infrastructure.
curl --request GET \
--url "https://api.apilayer.net/pdflayer/api/convert?access_key=YOUR_ACCESS_KEY&document_url=https://example.com"
HTTP/1.1 200 OK
Content-Type: application/pdf
%PDF-1.4
1 0 obj
<< /Type /Catalog /Pages 2 0 R >>
endobj
…The API returns the PDF file (first bytes shown above). By default it downloads; set inline to 1 to open it in the browser.
See the response in the docsConnect to a lightweight REST API using a straightforward GET or POST request. Generate PDF documents without building your own rendering infrastructure.
Convert a standard URL directly into a PDF, or submit raw HTML for complete control over the document you're generating. Raw HTML conversion is available through HTTP POST request.
Pdflayer's conversion engine is based on real browsers running powerful operating systems, allowing it to render modern web technologies and produce high-quality PDF documents.
HTML, CSS, JavaScript and SVG: if it renders in the browser, it renders in your PDF. Pdflayer runs your page through a full browser engine, so the PDF looks like what you designed: layouts, custom fonts, charts, and dynamic content included. Send a URL or raw HTML and get back a pixel-accurate PDF.
Take control of your PDFs with more than 50 customization parameters. Configure page dimensions, margins, headers, footers, page numbers, CSS, viewport settings, rendering delays, encryption, and more.
Add customized headers and footers to your generated documents. Include branding, document information, page numbers, dates, or other dynamic elements.
Protect and brand your documents with customizable background or foreground watermark images.
Generated PDF documents are stored using Pdflayer's CDN, allowing previously generated documents to be retrieved within milliseconds without counting the retrieval toward your API usage.
The Pdflayer infrastructure is designed to process thousands of PDF conversion requests at a time, making it suitable for everything from individual document generation to high-volume production workflows.
From invoices and reports to contracts and receipts, Pdflayer turns your web content into ready-to-share PDFs automatically.
Explore Use CasesExplore the interactive docs, endpoints, parameters, response examples and integration guides. Learn to convert URLs and HTML, customize layouts, add headers, footers and watermarks, and generate PDFs programmatically.
View DocumentationPricing
Whether you're testing PDF generation, building a document workflow, or processing large volumes of PDFs, choose the plan that matches your application.
For testing and side projects
$0forever
No credit card
No overage charges
100 requests / month
Includes:
For your first live product
$9.99/ month
Billed monthly
Then $0.03996 per extra request, up to 2,000 extra a month
1,000 requests / month
Everything in Free, plus:
For growing traffic
$39.99/ month
Billed monthly
Then $0.015996 per extra request, up to 20,000 extra a month
10,000 requests / month
Everything in Starter, plus:
For high volume
$119.99/ month
Billed monthly
Then $0.0047996 per extra request, up to 200,000 extra a month
100,000 requests / month
Everything in Professional, plus:
Need more? We offer custom Enterprise pricing for unlimited requests, dedicated technical support, and more.
| 8 features | Free$0Get free key | Starter$9.99/moSubscribe | Professional$39.99/moSubscribe | Enterprise$119.99/moSubscribe |
|---|---|---|---|---|
| Usage | Non-commercial | Commercial | Commercial | Commercial |
| PDF conversion | ||||
| URL conversion | ||||
| HTML conversion | – | – | ||
| Document configuration | ||||
| Full customization parameters | – | |||
| HTTPS encryption | 256-bit | 256-bit | 256-bit | 256-bit |
| Support | – | Standard | Standard | Standard |
| Price per extra request after the monthly limit | None | $0.03996 | $0.015996 | $0.0047996 |
Playground
Build a request in your browser and see the response it returns.
Agents
Steps for AI coding agents that add Pdflayer to a project.
A person creates the account: an agent cannot sign up. Sign up at app.apilayer.com and subscribe to Pdflayer. The Free plan includes 100 requests / month and needs no credit card.
Copy the API key from the APILayer dashboard and give it to the agent as an environment variable (step 2).
Read the key from an environment variable named APILAYER_ACCESS_KEY. Do not write the key into source code, commit it to git, or paste it into a chat.
Call Pdflayer from server code. The key travels in the request URL, so a request sent from a browser shows the key to every visitor.
# add .env to .gitignore
APILAYER_ACCESS_KEY=your_api_keyhttps://api.apilayer.net/pdflayer/apiaccess_key query parameterGET /convert Generate a PDF from a URL (document_url)POST /convert Generate a PDF from raw HTML (document_html, POST only) or from a URLcurl "https://api.apilayer.net/pdflayer/api/convert?access_key=$APILAYER_ACCESS_KEY&document_url=https://example.com"The API info tab shows the response this request returns.
Each plan adds features to the plan before it. Check that the account's plan includes a feature before writing code that uses it.
| Plan | Requests / month | Adds |
|---|---|---|
| Free | 100 | Usage: Non-commercial, PDF conversion, URL conversion, Document configuration, HTTPS encryption: 256-bit |
| Starter | 1,000 | Usage: Commercial, Full customization parameters, Support: Standard |
| Professional | 10,000 | HTML conversion |
| Enterprise | 100,000 | Same features as Professional |
Prices are in the Pricing tab.
FAQs
Here are the answers you might be seeking
The Pdflayer API was built to provide a simple, fast and cost-effective REST API for developers and businesses to automate the process of converting HTML or HTTP URLs to high quality PDF documents. Integrating the Pdflayer REST API into your application using any programming language (e.g. PHP, Python, Ruby, jQuery.ajax, Java, etc.) will enable you to generate thousands of PDF documents on the fly, making use of a full-featured suite of document configuration and customization options.
Pdflayer is a product built and maintained by APILayer, the company behind 17 developer APIs, including Screenshotlayer, Scrapestack and IPstack. You can learn more on the Why choose APILayer page.
Yes. Using the API's document_url parameter the API can be requested to generate a PDF document from a standard HTTP URL. Using the document_html parameter you can request the API to convert raw HTML code to a PDF document. Please note that converting raw HTML code is only available via HTTP POST.
You can learn more by taking a look at the Pdflayer API documentation.
The Pdflayer API and its functionalities are primarily configured to be used via HTTP POST. For customers looking to make API requests via HTTP GET the Pdflayer API is also capable of handling GET API requests using its straightforward URL structure.
However, some API functionalities are not supported using HTTP GET. Throughout the API documentation you will occasionally come across "HTTP POST only" tags, indicating that the respective API feature or parameter is only supported via HTTP POST.
You can learn more by taking a look at the Pdflayer API documentation.
Pdflayer can render HTML, CSS, JavaScript, XML, SVG, images, and other browser-compatible content. Its PDF engine is based on real browsers running on powerful operating systems.
Yes. Pdflayer provides more than 50 customization parameters, including page dimensions, margins, CSS, viewport settings, rendering delays, encryption, page numbers, headers, footers, and more.
Yes. Headers and footers can be customized and added to generated PDF documents.
Yes. You can specify customizable background or foreground watermark images for generated PDF documents.
Yes. Pdflayer is designed for automated document generation and can be integrated into workflows such as invoices, reports, receipts, certificates, statements, and other web-based documents.
After conversion, the generated PDF can be accessed through the API. Pdflayer also stores generated PDF documents using a CDN, allowing existing documents to be retrieved within milliseconds.
Every registered user is assigned a personal Access Key, a unique "password" that can be used to access and query the Pdflayer API. If you are logged in, you can find it in your Account Dashboard and in all interactive links contained in the API's Documentation.
In your Account Dashboard you can reset your Access Key at any given time.
In order to make an API Request, you are required to attach your Access Key to a valid API endpoint URL, e.g: https://api.apilayer.net/pdflayer/api/convert?access_key=YOUR_ACCESS_KEY
A key factor to this API's pricing model is the number of monthly API Requests offered for each individual Subscription Plan. Requesting the API to generate one PDF will increment your monthly request volume by 1 API request. Any PDF documents generated by the Pdflayer API are stored using a powerful CDN, making it possible to access existing PDF documents within just a few milliseconds. Accessing an already generated PDF will not count towards your monthly API usage.
No. Retrieving an already generated PDF from the CDN does not count toward your monthly API usage.
Yes. All plans, including the Free plan, use 256-bit HTTPS encryption for secure data transmission.
The Pdflayer API's system status is being closely monitored around the clock. Since every effort is made to ensure the highest possible level of consistency, we are happy to announce that our API's uptime is at around 99.9%. At the current stage we are not offering any public statistics, but we will be happy to provide you with recent uptime reports - ask us »
Yes. The Free plan provides 100 API requests per month and is intended for non-commercial use.
The Free Plan is set out to be a "trial version" without a time limit, offering a volume of 100 monthly API requests.
Paid Subscription Plans feature significantly higher API request volumes, allow commercial use and include technical support. All plans, including the Free plan, use 256-bit HTTPS encryption.
In order to test the API and to get an idea of the product, you can simply sign up for the Free Plan.
As soon as you or your application requires more than 100 API requests per month, you would be well-advised to sign up for one of the premium subscription plans, starting at only $9.99 per month, or at up to 15% discount - if you decide to pay annually.
Payments can be made via Credit Card (Visa, MasterCard, Discover, Diner's Club). You can change your payment method at any given time in the Payment section of your Account Dashboard.
Yes. If you choose annual billing, the total price of your subscription plan will be up to 15% lower than the total amount you would pay with a monthly payment frequency.
You can initiate a cancellation or downgrade by selecting a new plan and providing at least one reason for your decision. The customer service team will cancel or downgrade your plan. Downgrades are not effective immediately; your premium subscription will remain active until the end of the current billing period.
To change your subscription from monthly to yearly billing, submit a request on the Contact Us page following these steps:
Step 1: Sign in to your account.
Step 2: Go to the Contact Us page.
Step 3: Fill out the form and choose the “Sales” category for this request.
Step 4: In the text box, include your specific request, for example “Change from Monthly to Yearly subscription.”
Users will be automatically notified via e-mail and on their Account Dashboard once at least 75%, 90%, and 100% of their monthly API Request allowance has been reached. After reaching 100% of the allowance, overages fees will apply so we make sure you won’t experience any disruptions and your website/application will keep running smoothly. You can learn more about overages billing here.
An overage occurs when you go over a quota for your API plan. When you reach your API calls limit, we will charge you a small amount for each new API call so we can make sure there will be no disruption in the service we provide to you and your website or application can continue running smoothly.
Prices for additional API calls will vary based on your plan. See the table below for prices per call and an example of an overage billing.
| Plan | Monthly price | Requests / month | Price per extra request | Extra requests | Overage cost |
|---|---|---|---|---|---|
| Starter | $9.99 | 1,000 | $0.03996 | 10,000 | $399.60 |
| Professional | $39.99 | 10,000 | $0.015996 | 10,000 | $159.96 |
| Enterprise | $119.99 | 100,000 | $0.0047996 | 10,000 | $48.00 |
Note: For complete details, please refer to the overages documentation here.
Overage fees allow customers to continue using an API once a quota limit is reached. We want to make sure your website or application continues running at all times, so charges will apply if you go over your monthly quota limit. If you notice you are going over your quota limit each month, look on your dashboard for an upgraded plan to help with larger request limits.
When you are close to reaching your API calls limit for the month, you will receive an automatic notification (at 75%, 90%, and 100% of your monthly quota). You can keep track of your quota usage to prevent overages by tracking the number of API calls you make and checking the dashboard for up-to-date usage statistics.
You will be charged for your monthly subscription plan, plus any overage fees applied. Your credit card will be billed after the billing period has ended.
In this case, there will be no change to your monthly invoice. Only billing cycles that incur overages will see any difference in monthly charges. The Business Continuity plan is an insurance plan to be used only if needed and guarantees your end users never see a drop in coverage from you.
If your usage consistently surpasses the set limits each month, you may face additional charges for the excess usage. Nevertheless, as your monthly usage reaches a certain threshold, it becomes more practical to consider upgrading to the next plan. By doing so, you ensure a smoother and more accommodating experience for your growing customer base. Find out about our pricing plans here.
You can easily upgrade your plan by going to your Dashboard and selecting the new plan that would be more suitable for your business needs. Additionally, you may contact your Account Manager to discuss a custom plan if you expect a continuous increase in usage.
Still have a question?
Contact support