apyhub
DATA EXTRACTION · FILE CONVERSION

Convert Webpage to PDF API

What it does

Webpage to PDF lets you capture a public web page and return it as a PDF, either as a direct download or as a signed link. Send a URL and choose whether you want the output in portrait or landscape; for downloads, you can also set the page margin and output filename.

Use POST /download when you want a binary PDF response you can store, forward, or attach to another workflow. The request body contains url, and the query string supports margin, output, and landscape. Use POST /link when you prefer a signed PDF URL instead of the file itself; it accepts url, margin, and landscape, and returns a JSON object with data set to the PDF link.

This is a practical fit for archiving invoices, saving published articles, generating printable snapshots of landing pages, or turning a customer-facing page into a document for review. The service is scoped to public URLs, so it works well when you need a stable PDF version of content that already lives on the web.

▣ ENDPOINT 01 / 02
POST
Capture public URL as PDF download (PDF-07)
https://api.eu.apyverse.com/apyhub/convert-webpage-to-pdf/download

QUICKSTART

GUIDE

Quickstart

Convert a webpage to a PDF by sending the page URL in the request body.

curl -X POST "https://api.eu.apyverse.com/apyhub/convert-webpage-to-pdf/download" \
  -H "apy-token: $APY_TOKEN" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.html"}'

What you'll get back

Returns a binary PDF file.

TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Captures a publicly accessible webpage URL and returns the generated PDF as a binary download. The request body supplies the page URL, while optional query parameters control the PDF output settings.

Query Parameter(s)

AttributeTypeMandatoryDescription
marginNumberNoPage margin in the range 0 to 1. Default: 0.1.
outputStringNoOutput filename. Example: output.pdf.
landscapeBooleanNofalse by default. When true, generates the PDF in landscape orientation.

Request Body

ParameterTypeMandatoryDescription
urlStringYesPublic webpage URL to capture. Must be a valid URI. Example: https://assets.apyhub.com/samples/sample.html.

Response

Returns a binary file containing the generated PDF. The success response is a raw String value with binary format rather than a JSON object.

Query parameters

Name
Type
Description
marginOPTIONAL
number
DEFAULT 0.1
outputOPTIONAL
string
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.