ScraperFlyAI-ready Web Data API

rendering

Scraping API render_wait for JavaScript pages

Some JavaScript pages need a short pause after browser rendering starts before useful content appears. ScraperFly gives teams a controlled render_wait option, so they can capture late public content without turning every scrape into a slow or expensive browser request.

Timing with proof

Wait only for content that changes the response

ScraperFly render_wait gives a browser-rendered request a short, controlled pause before capture. It is useful when the page starts correctly, but the useful content appears a moment later after JavaScript, route hydration, lazy loading, or a frontend data request finishes.

The goal is not to slow every scrape. The goal is to prove which pages benefit from a wait, keep easy targets on lighter requests, and return the response in the format your product can use immediately.

render_waitlate contentshortest useful pause
Developers reviewing browser render timing and wait controls for a scraping API request

What is render_wait in a scraping API?

render_wait is a timing control for rendered scraping requests. After ScraperFly opens a public page with browser rendering, the wait gives the page additional time before the response is captured. That extra time can help when useful content arrives after the first browser pass rather than in the initial source HTML.

This is different from treating every timeout, empty response, or partial page as the same problem. A wait helps with timing. It does not fix a missing URL, invalid request, blocked target, exhausted credits, bad output choice, or a page that never exposes the expected content. The best use of render_wait starts with evidence: compare source HTML, rendered HTML, screenshot state, response size, final URL, and the fields your workflow actually needs.

Practical takeaway: use render_wait when a rendered request works, but captures the page before the useful public content has settled.

When should teams add a render wait?

Add a wait when the first rendered capture is close, but incomplete. Common examples include product cards that appear after frontend requests, search results that hydrate after route changes, comments or reviews that load late, charts that render after data fetches, pages that lazy-load important sections, or screenshots that need a stable visual state before capture.

The strongest signal is a before-and-after comparison. If raw HTML is incomplete and rendered output improves the page, rendering is justified. If a short wait makes the rendered output complete, render_wait is justified. If longer waits do not change the captured response, the problem is probably not timing. It may be routing, access state, request context, response size, output format, or target behavior.

Observed result Likely meaning Best next action
Raw HTML already contains the data The page does not need browser timing Keep the request on the light HTML path.
Rendered output contains some data, but misses late sections The page may need a short wait before capture Test small wait values and compare completeness.
Screenshot shows loading placeholders The capture happened before the visual state settled Add a modest wait and verify the screenshot again.
Rendered output stays empty after waiting The issue may not be timing Inspect final URL, status, route, headers, session, and target response.
Only a few templates need wait time The workload has mixed timing profiles Apply wait selectively instead of to every URL.

How is render_wait different from render timeout?

render_wait and render timeout solve different parts of the timing problem. render_wait is a deliberate pause before capture. It gives late content time to appear when the browser is already running successfully. A render timeout is the limit that stops a rendered request from running forever when the page is too slow, stalled, blocked, oversized, or never reaches a useful state.

Teams should not use a bigger timeout as the first answer to every slow page. A timeout asks the system to tolerate a longer request. A wait asks the system to capture after a specific delay. The practical workflow is to test whether a short wait improves the response, then keep the shortest value that reliably captures the useful page state. If the page still fails, move into timeout diagnosis rather than repeating the same heavy request.

For deeper timeout recovery, use the render timeout diagnosis page. For broader JavaScript execution decisions, start with the JavaScript rendering API guide.

How should teams choose the shortest useful wait?

The right value is the smallest delay that changes the result in a meaningful way. Test a representative page with no extra wait, then with small increments. Compare the fields that matter to the workflow: rendered HTML, clean text, Markdown, JSON metadata, screenshot, PDF, response size, and final URL. If a small wait completes the target content, keep it. If each larger value produces the same response, stop increasing it.

This keeps the decision practical. A crawler, agent, monitoring job, or data pipeline should not inherit a long wait because one page was slow during testing. Segment targets by template or behavior. Static pages stay light. JavaScript pages render. Pages with late public content get a short wait. Hard failures go through request evidence before routing or retry escalation.

Wait choice Good fit Risk Decision rule
No extra wait Content appears immediately after rendering Late sections may be missed Use as the baseline for every target sample.
Short wait Lazy lists, route hydration, small async updates Slightly higher latency Use when it visibly improves output completeness.
Longer wait Known slow public pages with proven late content Higher request weight and slower batches Use only for templates that consistently need it.
Retry without diagnosis Rarely a good production default Repeats the same incomplete capture Inspect timing and response evidence first.
Routing escalation Delivery or access evidence points beyond timing Can add cost without fixing late content Escalate only after timing evidence is clear.

Which output formats benefit from waiting?

Waiting can improve any output that depends on the final rendered page state. Rendered HTML can include nodes that did not exist at first capture. Text and Markdown can become cleaner when headings, cards, reviews, or article sections arrive after JavaScript runs. JSON metadata can show whether the request finished with the expected status, final URL, response type, and useful response size. Screenshots and PDFs can prove whether the visible page had settled before capture.

The output still needs to match the downstream job. A screenshot is helpful for QA, monitoring, and visual proof, but it is not usually the best parser input. Rendered HTML is useful for DOM structure. Text is useful for lightweight search or classification. Markdown is useful for AI and RAG workflows when readable headings and links matter. The response formats page helps choose the smallest useful result.

What mistakes make render_wait expensive?

The most common mistake is adding a generous wait to every rendered request because one sample arrived late. That makes fast pages slower, increases request weight, and hides the real differences between page templates. Another mistake is using wait time to mask unrelated problems. A blocked page, invalid URL, unsupported output, exhausted credits, response-too-large issue, or wrong final route will not become healthy just because the browser waited longer.

A better pattern is to classify request profiles. Use no wait for pages that complete quickly. Use a short wait for templates that consistently load useful public content late. Use timeout diagnosis when rendering never finishes. Use sessions, headers, country routing, or stronger delivery only when the evidence points there. That keeps scraping recovery specific instead of turning every difficult page into the most expensive request.

How does ScraperFly keep render waits practical?

ScraperFly gives teams an API-first way to test timing before production code depends on it. Start with a target URL, compare raw and rendered responses, add render_wait only when it changes the result, then choose HTML, text, Markdown, JSON, screenshot, or PDF based on the workflow. The same request profile can move into cURL, Postman, Python, Node.js, a backend service, an agent, or a monitoring pipeline.

This is useful for teams that want reliable public web data without maintaining their own browser fleet, custom retry logic, screenshot workers, PDF capture, proxy routing, and response converters for every edge case. The buying path stays simple too: test the page, prove the timing, estimate request weight with pricing and the credit cost calculator, then scale only the profile that has evidence behind it.

Wait requirements

Map late-loading content before adding wait time

Some public pages look ready before the useful data arrives. Compare source HTML, rendered HTML, visual state, final URL, response size, and target template behavior so wait time solves a real capture gap instead of becoming a default delay.

Raw HTML response mapped to visible page data
01

Raw HTML availability

Check whether the fields you need are already present in the first HTML response.

Best first test for simple pages, articles, docs, listings, and product details.

Before and after JavaScript rendering comparison
02

JavaScript dependency

Compare raw HTML with the rendered DOM or screenshot before turning on browser rendering.

Use rendering when raw HTML is only a shell and scripts create the useful content.

Cookies, consent, session and access context for scraping
03

State & access context

Identify whether cookies, consent, login boundaries, pagination, or the same visitor state affect the response.

Use sessions and headers when continuity changes the data you receive.

Regional content variations across countries and routes
04

Geo/content variation

Test whether country, language, currency, inventory, SERP, ads, or route reputation changes the result.

Use geo or premium routing only when the target proves the response varies by route.

Checks before adding a browser wait

Where is the target field?

Find whether the field exists in raw HTML, rendered DOM, an API call, structured data, a file, or a later interaction state.

What changes the response?

Sample a few URLs and compare status, final URL, content length, redirects, empty states, and visible result differences.

What context is required?

Mark any dependency on consent, locale, cookies, headers, authentication boundary, pagination, filters, or previous requests.

What does failure look like?

Define the signals for blocked, partial, stale, redirected, empty, timed-out, or region-mismatched responses before scaling.

How render_wait changes the request

Fetch mode

Raw HTML availability decides whether the first request can stay simple or needs rendering, waits, screenshots, or extraction.

Request context

State requirements decide whether to add headers, cookies, sessions, consent handling, or a stable visitor profile.

Routing choice

Geo and reputation findings decide whether standard routing is enough or a country/premium route is justified.

Validation rules

Known failure states become checks for retries, escalation, QA review, and deciding when a lighter profile is still complete.

Wait-aware request builder

Build the smallest rendered request that captures the settled page state

Use API Builder to compare no-wait and short-wait captures, choose the response format, and keep the proven timing profile ready for cURL, Postman, Python, Node.js, agents, or backend jobs.

FAST
Baseline

Start with no extra wait

First prove what the page returns after normal browser rendering before adding more time.

render=truebaseline
WAIT
Timing

Add wait only for late content

Use a short pause when listings, reviews, route content, charts, or screenshots settle after initial render.

render_waitlate state
FMT
Output

Compare the response shape

Rendered HTML, text, Markdown, metadata, screenshot, and PDF can reveal different timing problems.

htmlscreenshot

Controls that shape render_wait behavior

url

The public page and template being tested.

render

Browser execution for JavaScript-built content.

wait

A controlled pause before response capture.

format

The output used to verify completeness.

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"

Wait cost control

Keep render waits short, targeted, and tied to real page behavior

Every extra wait increases how long a browser request stays open. ScraperFly makes the cost decision easier: keep static and fast pages light, then reserve waits for templates where samples prove the response becomes more complete.

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 makes render_wait requests heavier

More infrastructure work

Browser rendering, routing choices, and longer waits mean the platform has to do more than return a simple response.

More target uncertainty

Redirects, empty states, rate limits, and challenge pages often require stronger delivery options or retries.

More state to preserve

Cookies, sessions, consent, and multi-page flows add moving parts that a plain stateless fetch does not have.

More evidence to return

Screenshots, PDFs, rendered output, and richer response artifacts are useful, but they are heavier than plain HTML.

How to keep wait usage predictable

Sample before scale

Test a small URL set first and group targets by the lightest profile that returns complete data.

Do not render by default

Inspect raw HTML before turning on rendering. Many public pages already contain the data you need.

Escalate by evidence

Move up only when the response shows missing content, state dependency, geo variance, or routing problems.

Measure useful results

Optimize around valid records delivered, not raw request volume. A lighter profile is best only when it stays complete.

Render wait FAQ

Common questions about scraping API render_wait

Practical answers for teams tuning browser wait time, late JavaScript content, response formats, screenshots, retries, and request cost.

Wait answers
Timing

When to wait

Use wait time only when the page state improves after rendering starts.

What does render_wait do?

render_wait gives a rendered request extra time before capture, which helps when useful public content appears shortly after JavaScript starts running.

Should every rendered page use render_wait?

No. Many rendered pages are ready quickly. Add wait time only when samples show late content or visual state changes after initial rendering.

Evidence

How to verify the wait

Compare outputs before making wait time a production default.

How should I choose a wait value?

Test no-wait and small wait increments on representative pages, then keep the shortest value that reliably includes the required content.

What should I compare after adding a wait?

Compare rendered HTML, text or Markdown, JSON metadata, screenshot state, response size, final URL, and the fields your workflow expects.

Scope

What waiting cannot fix

A wait is a timing control, not a cure for every failed scrape.

Does render_wait fix 403, login, or blocking states?

No. Waiting helps timing problems. Access, routing, authorization, and rate-limit problems need separate request evidence and recovery choices.

Is render_wait the same as render timeout?

No. render_wait is a pause before capture. A render timeout is the maximum time allowed before a slow or stalled rendered request is stopped.

Cost

Keeping waits affordable

Long waits should stay limited to pages that prove they need them.

Can render_wait increase latency?

Yes. Extra wait time keeps the request open longer, so use the smallest delay that improves the captured response.

How do I avoid wasting credits with waits?

Segment targets by behavior: fast pages stay light, JavaScript pages render, and only templates with proven late content receive a wait.