Browser API
Print a page to PDF in a real browser.
POST https://api.104-236-84-15.sslip.io/v1/pdf
Body parameters
| Name | Type | Description |
|---|---|---|
urlrequired | string (≤ 2048 chars) | Absolute http:// or https:// URL. No embedded credentials, no private or internal hosts. |
format | "A4" | "Letter" | Paper size. Default: "A4". |
print_background | boolean | Include background colors and images. Default: false. |
unblock | "none" | "stealth" | "residential" | "auto" | Unblocking tier. residential goes through your team's own proxy. auto escalates none → stealth → residential (when your team has a proxy) and charges only for the tier that succeeded. See Unblocking tiers. Default: "none". |
timeout_ms | integer (1000–120000) | Time budget for the whole request, shared by every unblock tier tried. Running out returns 504 timeout (not charged). Default: 30000. |
max_age | integer (seconds, 0–86400) | Opt-in cache. If your account made the same request (same URL and options) within max_age seconds, you get that response back without us contacting the site, for 0 credits. An older copy is revalidated with a conditional request when the site supports it. 0 always fetches but stores the result. Omit it and the cache is not used. See Render → Caching. |
respect_robots | boolean | Check the site’s robots.txt (user agent PageteerBot) first. A disallowed URL fails with 403 robots_disallowed and is not charged; a Crawl-delay spaces our requests to that site. Default: false. |
actions | object[] (≤ 20) | Read-only page actions run in the browser after the page loads: wait, wait_for, scroll, click ("Load more", tabs, accordions), press and screenshot. Forces a browser render. No typing, form submission or logins. See Page actions. |
Example
curl -X POST https://api.104-236-84-15.sslip.io/v1/pdf \
-H "Authorization: Bearer $PAGETEER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","format":"Letter","print_background":true}' \
-o example.pdfconst res = await fetch('https://api.104-236-84-15.sslip.io/v1/pdf', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PAGETEER_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"url": "https://example.com",
"format": "Letter",
"print_background": true
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const bytes = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('example.pdf', bytes));import os
import requests
headers = {"Authorization": f"Bearer {os.environ['PAGETEER_API_KEY']}"}
res = requests.post(
"https://api.104-236-84-15.sslip.io/v1/pdf",
headers=headers,
json={
"url": "https://example.com",
"format": "Letter",
"print_background": True,
},
timeout=120,
)
res.raise_for_status()
with open("example.pdf", "wb") as f:
f.write(res.content)Response
The body is the PDF (application/pdf), with these headers:
content-type: application/pdf
x-request-id: req_f44ed10e9c024ecdae615147b2d35316
x-tier-used: none
x-target-status: 200
x-credits-used: 5
x-credits-remaining: 968
content-length: 26393Send Accept: application/json for JSON instead: the same fields as a JSON screenshot (url, final_url, status, content_type, tier_used, attempts, cached, credits) with the document in pdf_base64.
Credits
5 credits, plus the tier that succeeded (stealth +5, residential through your own proxy +0). A target 5xx is printed but not charged; cache hits cost 0.
Errors
| Status | Code | When | Charged | What to do |
|---|---|---|---|---|
| 400 | invalid_request | A parameter is missing, invalid or unknown (the message and error.issues name it). | No | Fix the request; retrying it unchanged fails again. |
| 401 | invalid_api_key | No key, an unknown key, or a revoked or expired key. | No | Check the Authorization header and the key on the API keys page. |
| 402 | insufficient_credits | Not enough credits left this month for this request, and billable usage is off. error.reason says why: free_credits_used, payment_failed or subscription_inactive. | No | Act on the reason at error.billing_url: add a card, update the payment method, or restart the subscription. Or wait for the 1st (UTC). |
| 402 | spend_limit_reached | Billable usage is on and this month’s spend limit is reached (error.reason: spend_limit). | No | Raise the spend limit at error.billing_url (the Billing page), or wait for the 1st (UTC). |
| 403 | forbidden_target | The URL is denylisted, resolves (or redirects) to a private or internal address, or sends cookies or credentials to a login, account or checkout page. | No | Do not retry. See the Acceptable Use Policy. |
| 403 | robots_disallowed | respect_robots is on (default for crawl and batch) and the site’s robots.txt disallows the URL for PageteerBot. | No | Skip the URL. Turn respect_robots off only for sites you own or may crawl. |
| 403 | org_suspended | The account is suspended. | No | Contact support. |
| 403 | feature_not_in_plan | Schema extraction on the free mode or while it is not available on this deployment. | No | Use selectors or structured, or add a card. |
| 403 | proxy_not_configured | unblock "residential" without a team proxy saved in Settings → Proxy (404 from POST /v1/proxy/test). | No | Save your proxy URL in Settings → Proxy (see Bring your own proxy), or use another tier. |
| 413 | payload_too_large | The request body is over 64 KB (8 MB for POST /v1/batch), or a crawl is too large to export in one file. | No | Send less, or split a batch; read a large crawl with GET /v1/crawl/:id. |
| 422 | target_blocked | The site blocked every tier we tried (with unblock "auto", the tiers this deployment offers). block_reason, block_vendor and attempts say how. | No | Try a stronger unblock tier (or "auto"); if auto already failed, retry much later. |
| 422 | captcha_required | The site answered with a CAPTCHA or bot challenge. We never solve them and try no further tier. | No | Do not retry soon. Use the site’s API or data feed if it has one. |
| 422 | login_required | The site redirected to a login or sign-in page (final_url says where). We never log in. | No | The content is not public: skip it. |
| 429 | rate_limited | Over your requests per minute, or too many requests to one site across the platform right now. | No | Wait Retry-After seconds, then back off with jitter. |
| 429 | concurrency_limit | Too many of your requests are in flight at once. | No | Wait for one to finish (Retry-After: 1) or lower your parallelism. |
| 429 | target_rate_limited | The site asked us to slow down (429, or 503 with Retry-After), or per-site pacing would not let your request start in time. We pause that site for everyone. | No | Wait error.retry_after seconds (also in Retry-After). |
| 502 | proxy_failed | Your proxy failed: reason "auth" (it rejected the credentials), "unreachable", "status" (it refused the connection) or "blocked" (its host resolves to a private address). | No | Fix the URL or credentials in Settings → Proxy and test it. "unreachable" and "status" may pass on retry. |
| 500 / 502 / 503 | internal_error | Something failed on our side (rendering engine, LLM extraction or the API itself), or the rendering engine is at capacity (503, Retry-After: 5). | No | Retry with backoff (honor Retry-After); quote x-request-id if it persists. |
| 504 | timeout | The site did not answer within timeout_ms. | No | Retry, maybe with a larger timeout_ms or mode "http". |