apyhub
FILE CONVERSION

Convert Webpage to PDF API

Hosted on ApyHub

What it does

Web Page to PDF turns a public URL into a PDF file you can download or store as a signed link. Send the page URL in the request body, and choose whether you want a direct binary download or a link response.

Use the /download endpoint when you want the PDF returned as a file. It accepts url in the body, plus optional margin and landscape query parameters, and a file name through output. Use the /link endpoint when you prefer a JSON response containing data with a URI to the generated PDF, with optional margin and landscape query parameters.

This is useful when you need to archive public webpages, generate snapshots of landing pages, or create shareable document copies of web content for review and approval workflows. Because the input is a public URL, it fits capture jobs for published pages, docs, and static marketing content.

Web Page to PDF keeps the interface simple: one URL in, a PDF out. Choose the response format that matches your workflow, whether you're streaming the file to a user or persisting a signed link for later access.

▣ ENDPOINT 01 / 02
POST
Capture public URL as PDF download
http://localhost:8080/apyhub/capture-public-url-as-pdf/download
QUICKSTARTGUIDE

Quickstart

Convert a public web page to PDF by sending its URL in the request body.

curl -X POST "http://localhost:8080/apyhub/capture-public-url-as-pdf/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.html"}'

What you'll get back

Returns a PDF file as binary data.

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 the public web page at the given URL and returns the result as a PDF download. The request sends the page URL in the body and can optionally control PDF output through query parameters.

Query Parameter(s)

AttributeTypeMandatoryDescription
marginNumberNoPDF margin, with a default of 0.1 and allowed range 0 to 1.
outputStringNoOutput filename for the PDF download.
landscapeBooleanNoSets the PDF orientation; defaults to false.

Request Body

ParameterTypeMandatoryDescription
urlStringYesPublic URL to capture as a PDF. Must be a valid URI.

Response

Returns a binary file response containing the generated PDF. The output schema is a binary string, so the success response is the downloaded PDF content 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.