TapCub is live — analytics, insights and live chat, free on one platform

Web data API URL to PDF API

Send a page and get a PDF printed by a headless browser, with selectable text, links and your print styles.

POSThttps://api.pathclue.com/v1/web/pdfBeta
Request

Call it from your code

Set your key in the TAPCUB_API_KEY environment variable. Base URL: https://api.pathclue.com/v1.

terminal
curl -X POST https://api.pathclue.com/v1/web/pdf \
  -H "Authorization: Bearer $TAPCUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/invoice/42","paper":"letter","margin":12}' \
  -o result.pdf

The response body is the file itself. Save it as shown in the examples.

Parameters

Request parameters

Request parameters
ParameterTypeRequiredDefaultDescription
urlurlNo—Page to print, http or https only. Send url or html, not both.
htmlstringNo—Your own HTML document (up to 2 MB). Scripts are turned off; images, styles and fonts it links to are loaded with the same address checks as url.
paperenumone of: a4 | letter | legal | a3 | a5 | tabloid | long | cssNo"a4"Paper size. long prints the whole page as one tall page; css uses the page’s own @page size.
landscapebooleanNofalseLandscape orientation.
marginintegerNo10Page margin in millimetres (0–50).
scaleintegerNo100Print scale in percent (50–150).
layoutenumone of: paper | laptop | desktop | wide | tablet | mobileNo—Width the page is laid out at before it is fitted to the paper: paper (the printable width), or a screen width — laptop 1024, desktop 1366, wide 1920, tablet 820, mobile 390 px. Default: laptop for url, paper for html.
mediaenumone of: screen | printNo—CSS media type: screen looks like the browser, print uses the page’s print styles. Default: screen for url, print for html.
printBackgroundbooleanNotruePrint background colours and images.
pageNumbersbooleanNofalseAdd page numbers at the bottom.
waitintegerNo0Extra seconds to wait after the page has loaded (0–5).
outputenumone of: binary | jsonNo"binary"binary returns the PDF itself; json returns base64 plus page info.
Response

Example response

Successful responses carry the X-Credits-Charged and X-Credits-Balance headers. Errors return {"error":{"code","message"}} and are never charged.

HTTP
HTTP/1.1 200 OK
Content-Type: application/pdf
X-Page-Status: 200
X-Final-Url: https://example.com/invoice/42
X-Blocked-Requests: 0

<application/pdf …>
Price and limits

What it costs

What it costs
Price5 credits per call
In US dollarsabout $0.005 · $5 / 1,000
CreditsFree or paid credits
Rate limitFree 10 / min · Plus 60 / min · Pro 300 / min
Free daily cap1,000 calls a day per key on free accounts
ChargedOnly on success — errors and timeouts are free
Use cases

What people build with it

Invoices and receipts

Render an HTML template to PDF for every order.

Reports

Turn dashboards and report pages into PDFs to email or archive.

Page archives

Keep a printable copy of terms, policies or articles as they were.

FAQ

Frequently asked questions

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

Will my print CSS be used?

Yes. The page is printed by a headless browser, so @media print rules and page-break CSS apply.

How is it different from a screenshot?

A screenshot is one image of what is on screen. A PDF keeps text selectable and splits long pages into printable pages.

How much does the URL to PDF API cost?

Each successful call costs 5 credits per call (about $0.005). 1 credit is about $0.001. Failed calls — invalid input, unreachable sites, timeouts or errors on our side — are not charged.

Can I try it for free?

Yes. New accounts get 300 credits and every account gets 30 free credits a day, and they work on this endpoint. You can also try the matching free tool on tapcub.com without a key.

What are the rate limits?

Free accounts can make 10 calls a minute and 1,000 a day per key; Plus allows 60 a minute and Pro 300. Over the limit you get HTTP 429 with a Retry-After header, and nothing is charged.

How do I get an API key?

Sign in to the TapCub console, verify your email and create a key on the Tools → API page. Keys start with tck_ and are shown once; send them in the Authorization: Bearer header.

Get your API key

Create a key in the console and make your first call in a minute. Light endpoints run on free daily credits.