URL to PDF

Turn any public web page into a PDF, rendered by headless Chrome.

Overview

The URL to PDF endpoint opens a public web page in headless Chrome, waits for it to finish loading and returns a link to the generated PDF.

Converting a URL

Send a POST request to the following endpoint:

POST https://www.givemepdf.com/api/v1/pdf/from-url

Credits required: 3 / request

Authentication

Every API call must include an API-KEY header.

You can find your API key in your dashboard.

Request body

Send the request as form-data or JSON with a url parameter containing the page to convert.

Parameter Accepted value Required
url A public http:// or https:// URL, up to 2048 characters Yes
document_name String, up to 60 characters No
orientation portrait (default) or landscape No
scale A number between 0.1 and 2.0 No (default: 0.75)
format Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6 No (default: A4) Other formats are available to Pro users.

Response

When the conversion succeeds, you will receive a JSON response with status code 200. Here is a sample response:

{
    "message": "OK",
    "data": {
        "location": "https://givemepdf.com/storage/8b6293cb05ee815c/ossrPslsisxeRLp0.pdf",
        "source_url": "https://example.com",
        "file_ttl_days": 1,
        "warning": "This file is available for 1 day(s). Please download as soon as possible."
    },
    "meta": {
        "remaining_free_credit": 3470,
        "remaining_paid_credit": 10000
    }
}

Possible errors

Status Message How to fix it
401 Unauthorized API-KEY missing Make sure your request includes the API-KEY header with a value.
401 Unauthorized Invalid API Key Your API key is incorrect, expired or revoked. Sign in to your dashboard to copy a valid key or generate a new one.
429 Too Many Requests You have hit your account per minute request limit Each plan allows a limited number of requests per minute. Please wait a moment and try again.
422 Unprocessable Entity URL is required Send the address of the page you want to convert in the url parameter.
422 Unprocessable Entity The url must point to a publicly accessible website. Private, local and internal network addresses are not allowed. Use a public http:// or https:// URL.
500 Internal Server Error Could not create a PDF from this URL The page could not be loaded in time or returned an error. Check that it opens in a normal browser. If the problem persists, contact us. Contact us

Troubleshooting

  • Pages behind a login, or on private and local networks, cannot be converted. Make sure the URL opens in a private browser window.
  • The page must finish loading within 60 seconds. Very heavy pages or pages with endless network activity may time out.
  • The PDF uses the page's print styles, so it can look slightly different from what you see on screen.