ScraperFlyAI-ready Web Data API

rendering

Web Page to PDF API for rendered page captures

ScraperFly turns public pages into PDF artifacts when a workflow needs a durable visual record: approval packets, archives, support evidence, compliance review, customer handoff, or document-style QA. Render JavaScript pages when needed and keep lighter response formats available when a file is unnecessary.

PDF ARTIFACTS

Capture the page as a PDF when the result needs to be reviewed, shared, or archived

ScraperFly gives teams an API-first way to turn a public URL into a PDF artifact. That is useful when the output is not just data for a parser, but a durable record for approvals, compliance checks, customer handoff, support evidence, internal QA, or page archives.

The request can stay practical. Test the target, render JavaScript only when the page needs it, wait for late content only when samples prove timing matters, and keep HTML, text, Markdown, JSON metadata, or screenshots available when PDF is not the right output.

URL to PDFrendered pagedownloadable artifact
Team reviewing an API workflow that converts a public web page into a PDF artifact

What is a web page to PDF API?

A web page to PDF API accepts a public URL and returns a PDF representation of the captured page. Instead of running a browser farm, building a PDF renderer, managing proxy delivery, and stitching file handling into the backend, the application can request a document-style artifact from a hosted API workflow.

PDF capture is different from normal scraping output. HTML, text, Markdown, and JSON are machine-friendly formats. PDF is a review-friendly format. It is valuable when a human, customer, auditor, support team, or downstream process needs a portable record of what the public page looked like after the request completed.

That distinction keeps the page honest. A PDF should not replace structured parsing when the product needs fields, links, prices, headings, or metadata. It should be used when a file artifact makes the workflow easier to approve, archive, share, or inspect.

Practical takeaway: use PDF output when the next step needs a document record, not just extracted page data.

When is PDF better than a screenshot?

Screenshots are fast visual proof of a browser state. PDFs are better when the captured page needs to behave like a document. A PDF can be attached to a ticket, stored in an archive, reviewed by a non-technical team, passed to a customer, or used as a durable record for approval and compliance workflows.

For layout QA, a screenshot may be enough. For a customer-facing report, invoice-like page, policy page, search result proof, listing evidence, or audit packet, PDF often fits the human workflow better. It gives the team a file that travels well across systems that already understand documents.

NeedUse PDF whenUse screenshot when
ReviewThe page should be shared as a document or attached to a workflow.The team only needs a quick visual state.
ArchiveThe output should become a portable record that can be stored and retrieved later.A thumbnail or layout snapshot is enough.
ComplianceThe capture needs a document-style artifact for audit or approval.The proof is mainly visual QA.
Customer handoffA non-technical recipient expects a PDF-like file.The file is only used internally for debugging.
AutomationThe application routes documents between systems.The application compares pixels or visual states.

For workflows that need both visual formats, the broader web page screenshot and PDF API page explains how to choose between them. This page stays focused on PDF as the primary deliverable.

How does rendering affect PDF capture?

A PDF generated from the wrong page state is still a bad artifact. Many public pages send complete useful content in the first HTML response. Others build the important content after JavaScript runs, change content by region, show overlays, lazy-load sections, or redirect based on request context.

ScraperFly can use browser rendering before PDF output when the useful public page state depends on JavaScript. Wait timing can help when lazy sections need a moment to settle. Headers, cookies, sessions, country targeting, and stronger routing can help when the target returns different content for different visitors.

The goal is not to make every PDF request heavy. The goal is to prove which capture profile creates the right artifact for a target pattern. Compare source response, rendered response, screenshot state, final URL, status, and file output before applying the same settings to a batch.

Practical takeaway: render PDF captures when JavaScript changes the document you need to preserve.

What should teams validate before trusting PDF output?

PDF output is useful because it is easy to share, but that also makes mistakes more visible. A wrong redirect, consent screen, blank page, login wall, CAPTCHA state, or slow-loading section can create a file that looks valid while preserving the wrong content.

  • Final URL and status. Confirm the PDF came from the expected public page, not a redirect, placeholder, or soft error.
  • Rendered state. Check whether JavaScript execution changes the page before capture.
  • Wait timing. Give lazy content and route transitions enough time only when real samples prove the need.
  • Viewport and page shape. Make sure the captured layout fits the document-style record your workflow expects.
  • Overlays and banners. Consent prompts, modals, and interstitials can dominate a PDF if the request context is incomplete.
  • Content versus proof. Keep machine-readable formats available when the application needs data, not a document artifact.

These checks help separate a PDF problem from a delivery problem. If the target returns the wrong page state, the fix may be rendering, headers, sessions, country targeting, wait timing, or routing. If the product needs structured fields, the fix may be a different response format.

How is web page to PDF different from HTML scraping or Markdown output?

HTML scraping is usually the starting point when the product needs parseable markup, selectors, attributes, links, tables, or exact DOM relationships. Web page to Markdown is useful when content should move into AI, RAG, documentation, search, or review workflows in a readable shape. PDF is useful when the output should be a file.

That makes PDF a delivery format, not the universal best scraping format. If your application wants to calculate prices, extract product fields, compare headings, index text, or build a dataset, PDF is usually less convenient than HTML, text, Markdown, or JSON metadata. If your application wants to attach a public page capture to an approval flow, archive a record, or give a human a portable view, PDF makes sense.

OutputBest fitTrade-off
PDFReview, archive, approvals, compliance packets, customer handoff.Less convenient for parsing and usually heavier than text output.
ScreenshotVisual QA, browser-state proof, layout checks, selected monitoring samples.Great visual evidence, but hard to query as data.
HTMLDOM parsing, selectors, links, attributes, tables, exact source evidence.Requires cleanup and parser logic.
MarkdownAI, RAG, docs, review, and readable content workflows.May simplify complex DOM structures.
JSON metadataRequest diagnostics, final URL, status, content type, logging.Does not replace target-specific extraction.

Use the API Builder to compare those outputs on the same target URL before committing a production workflow. A small amount of testing prevents a team from building document workflows around pages that only needed lighter response formats.

Practical takeaway: choose PDF when the artifact itself is valuable; choose lighter formats when the consumer needs data.

How can ScraperFly keep PDF capture practical?

ScraperFly is useful because PDF capture stays inside the same request model as the rest of the web scraping workflow. The team can test the target URL, inspect response evidence, compare formats, enable rendering when JavaScript matters, add wait timing when page state is late, and use routing controls when delivery changes the result.

That keeps the buying decision cleaner too. A one-off review job can use pay-as-you-go credits. A recurring archive or QA process can move toward monthly credits once the target behavior and request weight are proven. Review pricing after the capture profile is clear, not before the team knows whether PDF output is actually needed.

If the workflow needs a file returned from the API, connect this page with downloadable artifacts. If the workflow needs visual proof but not a document, compare with the website screenshot API. The best PDF workflow is specific enough to preserve the right page and disciplined enough not to turn every scrape into a document job.

Web page to PDF

Build a PDF capture request before wiring browser infrastructure

Use ScraperFly to test the public URL, compare lighter response formats, enable rendering only when the page needs it, and return PDF output when the workflow benefits from a document-style artifact.

PDF
PDF artifact

Preserve a rendered public page as a portable file

Use PDF output for approvals, archives, compliance review, support evidence, customer handoff, and document-style QA.

format=pdfdownloadarchive
JS
Rendered page

Capture JavaScript-built content before the PDF is created

Use browser execution and waits for pages where source HTML is incomplete or late content changes the final artifact.

render=truewaitpage state
API
Same API path

Compare PDF with lighter response formats first

Keep HTML, text, Markdown, JSON metadata, and screenshots available so PDF is chosen for the right jobs.

htmlmarkdownscreenshot

Controls that shape web page to PDF capture

url

The public page ScraperFly should capture as a PDF.

format=pdf

Return a document-style artifact instead of HTML, text, Markdown, JSON, or screenshot output.

render

Execute browser-side JavaScript before PDF capture when source HTML is incomplete.

render_wait

Let lazy sections, route changes, or overlays settle when sample evidence shows timing matters.

country

Capture the regional page state when location changes content, redirects, or availability.

download

Return the PDF as a downloadable artifact for handoff or storage.

cURL example

Generate Markdown with the same request shape you can move into production

curl "https://scraperfly.com/api/v1?url=https%3A%2F%2Fexample.com&format=markdown" \
  -H "apikey: YOUR_API_KEY"

PDF fit

Confirm when a PDF artifact is more useful than parsed content

PDF capture is strongest when the workflow needs a document-style record: approval, archive, compliance, customer handoff, visual review, or support proof. When the application only needs fields, text, links, or metadata, lighter response formats are usually better.

01

Define why the file exists

Name the review, approval, archive, support, compliance, or handoff workflow that will consume the PDF.

Useful when a human or another system expects a portable document.

02

Prove the page state before capture

Check final URL, status, rendered content, wait timing, overlays, region, and whether the target returned the expected public page.

Useful when blank files, redirects, or consent screens can create false records.

03

Keep data formats available

PDF is not a parser-friendly source. Keep HTML, text, Markdown, or JSON metadata when the workflow needs machine-readable content.

Useful for products that need extraction, search, monitoring, or AI ingestion.

Checks before choosing PDF output

Does a person need to review the page as a document?

If yes, PDF may fit better than raw HTML or JSON.

Does the page need JavaScript before capture?

Compare source and rendered states before adding browser execution.

Will the file be stored or shared?

PDF is useful for archives, tickets, approval flows, and customer handoff.

Does the product need structured data?

Use HTML, text, Markdown, or metadata when parsing is the real job.

What changes in request setup

Document workflows need file output

Use PDF when the result must travel as an artifact.

Dynamic pages need rendering evidence

Render only when JavaScript changes the PDF content.

Slow pages need measured waits

Add timing when lazy content or route state affects the file.

Regional pages need request context

Use country, headers, or sessions when page state changes by visitor.

Error handling

Turn scraping failures into fixes

Every web data workflow eventually meets a bad response: a missing URL, an invalid key, an empty HTML shell, a target 403, a rate limit, a render timeout, a broken PDF capture, or a JSON payload that does not contain the fields your product expected. ScraperFly is built to make those moments diagnosable. You inspect the HTTP status, the stable error code, the request profile, and the returned artifact, then choose the cheapest useful next move: fix the request, add credits, slow down, retry with backoff, enable rendering, change country, use premium routing, preserve headers, or validate the output before scaling.

Stable error shapeRetry decisionsCost-aware escalationOutput validation
Developer reviewing code and API request parameters on a laptop

01 / Request setup and access

Fix request mistakes first

Some failures are not target problems at all. They happen before ScraperFly can make a meaningful delivery attempt: a missing or malformed URL, an unsupported output format, an incompatible visual file type, a missing API key, an invalid key, or a key that has been paused or disabled. These errors are configuration signals, not retry signals: stop the workflow, point the developer to the exact field that needs correction, and keep credits focused on real target tests instead of repeated bad inputs.

missing_urlinvalid_urlunsupported_formatinvalid_api_key
  • Validate the URL and encoding before sending a batch.
  • Use supported outputs: HTML, text, Markdown, JSON, screenshot, or PDF.
  • Match screenshot file types to image output and PDF file type to PDF output.
  • Treat missing or invalid API keys as configuration work, not retry work.
Business dashboard with charts, documents and usage planning on a desk

02 / Credits, limits and concurrency

Separate limits from failures

A workload can fail because the account has no usable credits, the monthly plan limit has been reached, or concurrency is too aggressive for the current plan and target mix. ScraperFly makes those limits visible as operating signals, not mysterious scrape failures. That keeps the buying decision practical: start free, test the target, buy pay-as-you-go credits for uneven jobs, move to monthly credits when volume becomes predictable, and use backoff when request pressure is the real issue.

usage_limit_reachedrate_limitedcreditsbackoff
  • Use account status to check remaining credits before large runs.
  • Retry rate limits with backoff instead of immediately increasing pressure.
  • Keep one-off projects on pay-as-you-go when volume is uneven.
  • Move predictable recurring work to monthly credits when the pattern is proven.
Server room representing delivery paths, routing and network infrastructure

03 / Target delivery and network

Find delivery failures first

Many scraping platforms collapse delivery issues into a vague request failure. In production, that is not enough. The team needs to know whether the request timed out, the upstream target returned a temporary server error, the connection failed, the response was too large, redirects went somewhere unexpected, or the page came back as tiny HTML with no useful content. ScraperFly turns those failures into delivery evidence: try the light profile first, compare status and response size, then decide whether the next request needs backoff, another route, premium proxy, country targeting, or a narrower capture.

timeout5xxredirectsresponse_too_large
  • Retry temporary network and upstream failures with a controlled backoff policy.
  • Compare final URL, status, content type and response size across samples.
  • Escalate routing only when the response proves the simple path is unstable.
  • Treat oversized responses as a scope problem before scaling the same profile.
Digital security screen representing anti-bot and protected access signals

04 / Anti-bot, geo and access blocks

Read blocks before escalation

A target 403, 401, 429, CAPTCHA screen, WAF challenge, login wall, consent loop, or region-specific mismatch is not just an error; it is a clue about what the site expects from the visitor. Competitors often push teams toward a heavier default profile, but that can burn budget without proving the fix. ScraperFly's better path is evidence-based escalation: preserve realistic headers when context matters, use sessions when continuity changes the response, enable rendering when the useful content is browser-built, and choose premium or country routing when reputation or geography changes the result.

403429CAPTCHAcountry mismatch
  • Use premium routing when IP reputation is the proven bottleneck.
  • Use country targeting when language, currency, inventory or search results change by market.
  • Use headers, cookies and sessions when visitor state changes the response.
  • Reduce concurrency and add backoff when repeated requests trigger target throttling.
Developer preparing code and output artifacts on a laptop

05 / Rendering and output quality

Ship usable artifacts

A 200 status is not the same thing as a usable scrape. The raw HTML can be an empty app shell, Markdown can miss the main article, JSON can lack expected metadata, text can include noise, screenshots can be blank, and PDF or image output can fail if the browser step times out. ScraperFly is valuable because the same API request can move from raw HTML to rendered DOM, clean text, Markdown, JSON, screenshot or PDF, then be checked against the artifact your product actually needs. That reduces glue code, failed imports, and expensive batch runs that only discover bad output after the fact.

render_timeoutbrowser_render_failedJSON fieldsPDF/image output
  • Enable rendering when raw HTML is only a shell and the useful content appears after JavaScript.
  • Validate text, Markdown and JSON against expected fields before batching.
  • Use screenshot or PDF output when visual proof or audit evidence matters.
  • Treat blank or partial artifacts as quality failures even when HTTP status is successful.
ScraperFly fit

Cleaner error recovery

ScraperFly helps teams decide what to fix, what to retry, and what to escalate without turning every scrape into the most expensive request profile.

Stable error shape

Use HTTP status and error code together so application logic can choose between fixing input, refreshing credentials, slowing down, retrying, or escalating delivery.

Retry only when it helps

Network failures, rate limits, and temporary server errors can use backoff. Invalid URLs, unsupported formats, and bad keys should be corrected once.

Cost-aware escalation

Start with the light request profile, then add rendering, premium routing, country, sessions, headers, waits, or visual capture only when the failure proves it.

Validate output before scale

Confirm the real artifact your product needs: HTML, text, Markdown, JSON, screenshot, or PDF, before copying the same profile across a large URL set.

Why ScraperFly

Create PDF artifacts without maintaining a separate browser-and-PDF stack

Teams can build their own browser workers, proxy handling, wait logic, PDF generation, retries, and file handoff. ScraperFly keeps those decisions in one API workflow so the team can test the target, choose PDF only when it helps, and keep lighter formats available for content jobs.

Less infrastructure

No separate PDF capture service to maintain

Use the same request model for HTML, Markdown, screenshots, and PDFs instead of stitching together browser automation and file generation.

one APIPDFrendering
Better decisions

Test document capture before scaling it

Compare PDF with screenshot, HTML, text, Markdown, and metadata on real targets before turning a page class into a file workflow.

API Buildersample firstformat choice
Cost control

Reserve heavier capture for pages that need proof

Keep content-only requests light, then add rendering, waits, routing, and PDF output where the artifact saves review or handoff work.

pay as you gorender when neededdownload

Where ScraperFly fits better for web page to PDF workflows

The practical advantage is not only creating a PDF. It is creating the right artifact from the right page state without losing request evidence or format flexibility.

Decision pointScraperFly advantageTypical alternative
Initial testTry the URL, compare formats, and validate rendered state before production code depends on a PDF.Teams often wire browser automation first and discover page-state problems after the pipeline exists.
Output choiceUse PDF for document workflows, screenshot for visual proof, and HTML, text, Markdown, or JSON for machine-readable content.PDF tooling often sits apart from scraping output, making format comparisons harder.
Dynamic pagesAdd rendering, waits, headers, sessions, country targeting, or routing when evidence shows they improve the artifact.Browser execution can become the default even for simple pages that do not need it.
Buying pathStart free, use pay-as-you-go credits for one-off captures, and move recurring PDF jobs to monthly credits when volume is proven.PDF capture and browser automation often push teams toward fixed infrastructure before workload is clear.

PDF cost control

Use PDF capture where file proof saves more work than it adds

PDF requests can be heavier than simple HTML, text, Markdown, or JSON responses because the workflow may involve browser execution, waits, page rendering, file generation, and downloadable artifacts. ScraperFly makes that tradeoff visible before the team scales it.

A lightweight HTML request returning a simple response
01

Basic fetch

Use a basic fetch when public HTML already contains the fields you need.

Lightest request profile; keep it when the response is complete.

JavaScript rendering producing a complete DOM
02

Rendering

Use rendering when raw HTML is a shell and JavaScript completes the page.

Heavier profile; use it only when browser output changes the result.

Several requests preserving cookies and visitor state
03

Stateful session

Use sessions when cookies, consent, locale, or pagination change the response.

Heavier state profile; preserve it only when continuity matters.

Request routing through geo and higher quality routes
04

Premium routing & geo

Use premium routing or geo only when origin, country, reputation, or regional content changes the result.

Heaviest routing profile; apply it only to targets that prove they need it.

What can make PDF capture heavier

Browser rendering

Needed when JavaScript creates the content that belongs in the PDF.

Wait timing

Needed when lazy content, route state, or overlays affect the final artifact.

Regional or session context

Needed when page content changes by country, language, cookies, or continuity.

File output

Useful for review and archive, but heavier than returning machine-readable content.

How to keep PDF capture predictable

Start with the lightest valid response

Use HTML, text, Markdown, or JSON when the workflow does not need a file.

Capture PDFs only for proven page classes

Apply PDF output to pages where review, proof, archive, or handoff matters.

Render by evidence

Enable browser execution only when it changes the page state captured in the PDF.

Use flexible credits while testing

Keep one-off PDF work on pay-as-you-go and move recurring capture to monthly credits when the pattern is proven.

PDF FAQ

Common questions about converting web pages to PDF

Practical answers for teams deciding when PDF output is worth using, how rendering affects capture quality, and how to keep document-style artifacts useful without making every scrape heavier.

PDF FAQ
OUTPUT

Choosing PDF

Use PDF when the output needs to behave like a document.

When is PDF better than a screenshot?

PDF is better for archives, approvals, customer handoff, compliance review, and document-style records. Screenshots are better for quick visual state checks.

Should every scrape create a PDF?

No. Use PDF when the file changes the workflow. Use lighter response formats for machine-readable content.

RENDERING

Capturing dynamic pages

The PDF should preserve the right page state.

Can ScraperFly capture JavaScript pages as PDFs?

Yes. Enable rendering when useful public content appears only after browser-side JavaScript runs.

Can wait timing change the PDF?

Yes. Waits can help when lazy sections, overlays, or route transitions need time before capture.

WORKFLOW

Files versus data

PDF output complements data extraction rather than replacing it.

Is a PDF good parser input?

Usually not. Use HTML, text, Markdown, or JSON metadata when the application needs fields, links, or machine-readable content.

Is this a full document generation platform?

No. ScraperFly captures public pages as artifacts. Your application owns storage, retention, annotation, and custom document assembly.

RELIABILITY

Quality and cost

Validate the capture profile before PDF output scales.

What should I inspect if a PDF is blank?

Check final URL, status, rendered state, response size, overlays, redirects, wait timing, and whether routing or headers changed the page.

How do teams control PDF capture cost?

Keep content jobs on lighter formats and add rendering, waits, routing, and PDF output only where the artifact is worth the extra request work.