API Provider

API Temple
API Temple

Developer links

Web page to PDF API
Web page to PDF API

Convert any web page URL to PDF.

Renders the provided URL and prints it as a PDF file as it should be displayed in a Google Chrome browser.

This API has two modes.

Print Mode

This mode is triggered with print=true (default)parameter. When print is set to true, the PDF file will be generated by browser's print functionality and the elements in the resulting PDF will be vectors and texts will be selectable.

When in printing mode, you can also define grayscale=true in order to get images in grayscale.

The PDF will be printed on A4 pagesize by default. If you need larger pages such as A3, B4 or simply Letter or B5 just set it such as passing the pagesize=B4 parameter

Sometimes you have HTTP Realm authentications that requires username and passwords to reach the URLs. You can set them such as username=john&password=secret

A sample request with cURL is below:

curl --request GET \
--url 'https://api.promptapi.com/url_to_pdf?url=google.com&grayscale=true&pagesize=B4' \
--header 'apikey: YOUR API KEY'

Screenshot Mode

Some web pages are just not optimized for printers. So the result may be flaky. You may have no choice but to take a screenshot and then convert it to PDF. You can achieve this functionality by simply setting the print parameter to false.

When print=false, the API fetches the provided URL and takes a screenshot as it is displayed on an actual Chrome browser and then serves the output as a PDF file. The browser has a screen resolution of 1400x1080 pixels, so the output is sharp and clean.

The PDF will contain full page screenshots. It will scroll automatically and take a full height screenshot of your web page. (max height: 10.000 pixels)

You can also customize the wait time (in seconds) for taking a screenshot with the timeout parameter. Just pass timeout=5 or any value you desire for your needs. (max timeout value is 15 seconds)

We use up to date Up to date Chrome browsers to make pixel perfect screenshots and ensure support for all modern web features.

A sample cURL request to trigger screensot mode is below:

curl --request GET \
--url 'https://api.promptapi.com/url_to_pdf?url=google.com&print=false' \
--header 'apikey: YOUR API KEY'

How secure is this service?

Prompt API is a legal entity in European Union and regulated by its laws. We never store any sensitive information on our servers and fully respect your privacy.

Is it free?

Web page to PDF API is a paid service but we have a free plan that will be more than enough for you to test its functionalities and see if it works for your needs.

How does Prompt API's pricing work?

Our subscriptions are tiered. We offer a monthly subscription scheme and you decide which tier works for you the best. No strings attached.

Can I cancel/upgrade/downgrade at any time?

Sure you can. You can cancel your subscription or upgrade/downgrade yourself, anytime without any restrictions.

Simple and fast
Easy on budget
Able to fetch full page
Timeout is customizable

Ready to try it out?

We offer a free plan. No credit cards required!

or see documentation

See Also

View All