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

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

The API returns the PDF file. 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 & 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 9 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 9 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 9 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 9 features

Custom

Need more? Contact sales for custom needs.

Contact Us

Compare all features

9 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
Custom solutions––––
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
    • /convert Convert
    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?

pdflayer is a REST API that converts any URLs or HTML into high-quality PDF documents. It is designed for developers and businesses that need to generate PDFs programmatically from web content.

02.Can pdflayer convert a URL into a PDF?

Yes. You can use the document_url parameter to provide a URL that pdflayer will convert into a PDF document. URL conversion can be performed using GET or POST requests.

03.Can I convert raw HTML into a PDF?

Yes. You can submit raw HTML using the document_html parameter. Raw HTML conversion is available through the HTTP POST method.

04.Does pdflayer support GET and POST?

Yes. pdflayer supports both HTTP GET and HTTP POST. Some advanced functionality and parameters are available through POST only.

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.

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

API access

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

No. According to pdflayer's FAQ, retrieving an already generated PDF from its CDN does not count toward your monthly API usage.

02.Is pdflayer secure?

Paid subscription plans include 256-bit HTTPS encryption for secure data transmission.

03.What is pdflayer's uptime?

pdflayer states that its API uptime is around 99.9%, with its system status monitored around the clock.

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

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

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

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

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

Overages

01.What happens when I exceed my API limit?

pdflayer sends notifications when you reach 75%, 90%, and 100% of your monthly allowance. After reaching the included quota, overage fees apply so applications can continue running without interruption.

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

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

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

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

Still have a question?

Contact support