Skip to main content

Page Load Settings

Control when the screenshot is captured during page load. Some websites need more time to fully render content before capturing.

Wait condition

The waitUntil parameter determines when to consider the page “loaded” before capturing:
ConditionDescriptionBest For
loadWait for full page load eventSimple static pages
domcontentloadedWait until HTML is fully parsedPages with fast rendering
networkidle0Wait until no network connections (at least 0.5s)Pages with minimal AJAX
networkidle2Wait until at most 2 network connections (at least 0.5s)Most pages (default)

Using wait conditions

bash
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&waitUntil=domcontentloaded" \
  --output screenshot.png

Choosing the right condition

  • networkidle2 (default) - Best for most websites. Waits for page to be mostly loaded.
  • networkidle0 - Use for pages with minimal JavaScript or known tracking scripts.
  • domcontentloaded - Use for fast-capturing when content renders quickly.
  • load - Use only for simple, static pages without dynamic content.

Timeout

The timeout parameter sets the maximum wait time before aborting the screenshot.
ValueDescription
Minimum1000ms (1 second)
Default30000ms (30 seconds)
Maximum120000ms (120 seconds)

Setting timeout

bash
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&timeout=60000" \
  --output screenshot.png

When to adjust timeout

  • Increase timeout for slow-loading pages, heavy content, or complex web applications
  • Decrease timeout for fast, lightweight pages to fail quickly on errors

Combining settings

For complex pages, combine wait condition with custom timeout:
bash
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&waitUntil=networkidle0&timeout=60000" \
  --output screenshot.png

Troubleshooting

ProblemSolution
Screenshot is blank/incompleteIncrease timeout or use networkidle2
Screenshot takes too longUse domcontentloaded or decrease timeout
Dynamic content not visibleUse networkidle0 or increase timeout

Parameters

ParameterTypeDefaultDescription
waitUntilstringnetworkidle2When to capture: load, domcontentloaded, networkidle0, networkidle2
timeoutnumber30000Maximum wait time in milliseconds (1000-120000)

See also