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

Pdflayer

Operational

High-quality HTML to PDF conversion API · by APILayer

  • Business
  • PDF
  • 50+ customization parameters
  • 99.9% reported uptime

Free plan · 100 requests / month · no card

Playground tab is switched off on the live page (AP-6510). Delete this widget to turn it back on.

Overview

API info

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.

Example request

GETShellcurl
curl --request GET \
  --url "https://api.apilayer.net/pdflayer/api/convert?access_key=YOUR_ACCESS_KEY&document_url=https://example.com"
Run it in the Playground

Example response

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 docs

Everything you need for powerful PDF generation

  • Easy to integrate

    Connect to a lightweight REST API using a straightforward GET or POST request. Generate PDF documents without building your own rendering infrastructure.

  • URL & HTML conversion

    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.

  • Browser-based PDF rendering

    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.

  • Full web rendering

    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.

  • Full document customization

    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.

  • Headers & footers

    Add customized headers and footers to your generated documents. Include branding, document information, page numbers, dates, or other dynamic elements.

  • Watermarks

    Protect and brand your documents with customizable background or foreground watermark images.

  • Built-in PDF storage

    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.

  • Built to scale

    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.

  • ThousandsRequests at a time
  • 99.9%Reported uptime
  • 50+Customization parameters
  • MillisecondsCDN retrieval

Build smarter with automated PDF generation

  • See Pdflayer in Action

    From invoices and reports to contracts and receipts, Pdflayer turns your web content into ready-to-share PDFs automatically.

    Explore Use Cases
  • Pdflayer API Documentation

    Explore 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 Documentation

Pricing

Flexible plans for every stage of growth

Whether you're testing PDF generation, building a document workflow, or processing large volumes of PDFs, choose the plan that matches your application.

MonthlyYearlySave up to 15%

Free

For testing and side projects

$0forever

No credit card

No overage charges

Get Free API Key

100 requests / month

Includes:

  • Usage: Non-commercial
  • PDF conversion
  • URL conversion
  • Document configuration

+ 1 more

See all 8 features

Starter

For your first live product

$9.99/ month

Billed monthly

Then $0.03996 per extra request, up to 2,000 extra a month

Subscribe Now

1,000 requests / month

Everything in Free, plus:

  • Usage: Commercial
  • Full customization parameters
  • Support: Standard
See all 8 features
Most popular

Professional

For growing traffic

$39.99/ month

Billed monthly

Then $0.015996 per extra request, up to 20,000 extra a month

Subscribe Now

10,000 requests / month

Everything in Starter, plus:

  • 10× the requests of Starter
  • Lower cost per request
  • HTML conversion
See all 8 features

Enterprise

For high volume

$119.99/ month

Billed monthly

Then $0.0047996 per extra request, up to 200,000 extra a month

Subscribe Now

100,000 requests / month

Everything in Professional, plus:

  • 10× the requests of Professional
  • Lower cost per request
See all 8 features

Custom

Need more? We offer custom Enterprise pricing for unlimited requests, dedicated technical support, and more.

Contact Us

Compare all features

8 featuresFree$0Get free keyStarter$9.99/moSubscribeProfessional$39.99/moSubscribeEnterprise$119.99/moSubscribe
UsageNon-commercialCommercialCommercialCommercial
PDF conversion
URL conversion
HTML conversion––
Document configuration
Full customization parameters–
HTTPS encryption256-bit256-bit256-bit256-bit
Support–StandardStandardStandard
Price per extra request after the monthly limitNone$0.03996$0.015996$0.0047996

Playground

Try the API

Build a request in your browser and see the response it returns.

GET
inline Optional

Add your free API key to run it from your code.

curl

      
    

Agents

Agents: start here

Steps for AI coding agents that add Pdflayer to a project.

  1. 1Get an API key

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

  2. 2Keep the key out of code

    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.

    .env
    # add .env to .gitignore
    APILAYER_ACCESS_KEY=your_api_key
  3. 3Make the first request

    Base URL
    https://api.apilayer.net/pdflayer/api
    Auth
    access_key query parameter
    Formats
    PDF
    Endpoints
    • GET /convert Generate a PDF from a URL (document_url)
    • POST /convert Generate a PDF from raw HTML (document_html, POST only) or from a URL
    Shell
    curl "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.

  4. 4Check the plan before you use a feature

    Each plan adds features to the plan before it. Check that the account's plan includes a feature before writing code that uses it.

    PlanRequests / monthAdds
    Free100Usage: Non-commercial, PDF conversion, URL conversion, Document configuration, HTTPS encryption: 256-bit
    Starter1,000Usage: Commercial, Full customization parameters, Support: Standard
    Professional10,000HTML conversion
    Enterprise100,000Same features as Professional

    Prices are in the Pricing tab.

  5. 5Use the machine-readable docs

FAQs

Need clarity?

Here are the answers you might be seeking

Data & features

01.What is Pdflayer?

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.

You can sign up for your free API Access Key here »

02.Who runs the Pdflayer API?

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.

03.Can I convert both URLs and raw HTML code?

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.

04.Does the API support HTTP GET and HTTP POST?

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.

05.What web technologies can Pdflayer render?

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.

06.Can I customize the generated PDF?

Yes. Pdflayer provides more than 50 customization parameters, including page dimensions, margins, CSS, viewport settings, rendering delays, encryption, page numbers, headers, footers, and more.

07.Can I add headers and footers?

Yes. Headers and footers can be customized and added to generated PDF documents.

08.Does Pdflayer support watermarks?

Yes. You can specify customizable background or foreground watermark images for generated PDF documents.

09.Can I generate PDFs from invoices and business 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.

10.How are generated PDFs delivered?

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.

API access

01.How do I get an API Access Key?

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

02.What is an API request?

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.

03.Does retrieving an existing PDF count as an API request?

No. Retrieving an already generated PDF from the CDN does not count toward your monthly API usage.

04.Is Pdflayer secure?

Yes. All plans, including the Free plan, use 256-bit HTTPS encryption for secure data transmission.

05.What is the API's uptime?

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 »

Plans & pricing

01.Is there a free plan?

Yes. The Free plan provides 100 API requests per month and is intended for non-commercial use.

02.What is the difference between Free and Paid Subscriptions?

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.

03.Which Subscription Plan fits my needs?

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.

04.Which payment methods are supported?

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.

05.Can I also pay yearly?

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.

06.How do I cancel/downgrade?

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.

07.How do I change between monthly and yearly billing?

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

Overages

01.What happens if I exceed my API Request volume?

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.

02.What is an overage?

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.

PlanMonthly priceRequests / monthPrice per extra requestExtra requestsOverage cost
Starter$9.991,000$0.0399610,000$399.60
Professional$39.9910,000$0.01599610,000$159.96
Enterprise$119.99100,000$0.004799610,000$48.00

Note: For complete details, please refer to the overages documentation here.

03.Why does APILayer have overage fees?

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.

04.How do I know if I will be charged for overages?

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.

05.How will I be charged for my API subscription?

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.

06.What happens if I don't have any overage fees?

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.

07.What if I consistently have more API calls than my plan allows?

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.

08.I would like to upgrade my plan. How can I do that?

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