Wait for the element that means the page is ready
Network silence is a guess about readiness. An element you chose is a statement about it.
wait_for_selectorwait_for_selector_algorithmwait_untildelaytimeoutcurl --fail-with-body "https://api.pagecapture.dev/v1/take" \
-H "X-Access-Key: $PAGECAPTURE_KEY" \
-H "Content-Type: application/json" \
--data '{"url":"https://example.com","format":"jpg","wait_for_selector":"main","wait_until":"load"}' \
-o capture.jpgVerified 2026-08-13 by running the published code against a fixture.
Configure it in the playgroundWhat it does
- Holds the capture until the CSS selector you name is present and visible, then continues with the rest of the action order.
- Offers two counting strategies through `wait_for_selector_algorithm`: the first visible match, or every match the page is still rendering.
- Shares the job's `timeout` budget, so an element that never appears ends as `timeout_error` — and a failed capture is never billed.
What it does not do
- Does not accept XPath. The selector is always CSS; the algorithm parameter controls how many nodes satisfy the wait, not the selector language.
- Does not replace `wait_until`. The navigation state still has to be reached first — this waits on top of it, not instead of it.
- Does not see into a closed shadow root unless `include_shadow_dom` is set.
Every limit on this page is the one the API enforces
These rows are read from the same parameter table that validates your request. Nothing here is transcribed, so a number cannot drift from the behaviour it describes.
| Parameter | Type | Default | Range | Endpoints | Cache key |
|---|---|---|---|---|---|
wait_for_selectorWait until this CSS selector appears. | string | — | — | /v1/take, /v1/animate | In |
wait_for_selector_algorithmHow many nodes satisfy the wait: the first visible match, or every match currently rendering. The selector is always CSS. | enum | at_least_one | — | /v1/take, /v1/animate | In |
wait_untilNavigation state to wait for. `networkidle0` waits for zero in-flight requests, `networkidle2` for at most two. | enum | load | — | /v1/take, /v1/animate | In |
delayExtra seconds to wait after the navigation state. | integer | 0 | 0 – 30 | /v1/take, /v1/animate | In |
timeoutTotal budget for the capture, in seconds. | integer | 60 | 1 – 90 | /v1/take, /v1/animate | In |
How it behaves next to the rest of the request
wait_for_selector_algorithmHow many nodes satisfy the wait: the first visible match, or every match currently rendering. The selector is always CSS.
`at_least_one` ends the wait as soon as the first match is visible. `at_least_by_count` keeps counting matches until the count repeats across two consecutive reads — which is what a list filled by XHR actually needs, because the first row appearing does not mean the last one has.
wait_untilNavigation state to wait for. `networkidle0` waits for zero in-flight requests, `networkidle2` for at most two.
For pages with a permanent connection, pair a readiness selector with `wait_until=load` rather than `networkidle0`. Idle will not arrive, and waiting for it converts a working page into a timeout.
delayExtra seconds to wait after the navigation state.
Extra seconds after the navigation state, capped at 30. It is the blunt instrument: use it when there is genuinely no element that marks readiness, not as a first attempt.
Errors this option can produce
timeout_errorHTTP 500 · retryableThe capture did not complete within the allowed time.
selector_not_foundHTTP 400The requested selector was not found.
None of them is billable. No error code in the catalog is.
Related capabilities
All capabilitiesGuides that cover this in depth
100 successful captures a month, every feature unlocked, no card.
Get an API keyPageCapture Engineering · reviewed by PageCapture API maintainers · Verified 2026-08-13 by running the published code against a fixture.