- Docs
- Parameters
- ms_delay
ms_delay
Adjust rendering delay to capture dynamic content
How it works
Section titled “How it works”When content is missing from your screenshots, the ms_delay parameter lets you add a delay before capture. This can help with:
- JavaScript that needs time to execute
- Assets (images, fonts) still loading
- Animations not completing
- Dynamic content not appearing
When to use ms_delay
Section titled “When to use ms_delay”The ms_delay parameter should only be used when:
- Your screenshots are missing expected content
- Dynamic content isn’t appearing in the final image
- Custom fonts or images aren’t loading properly
Default behavior
Section titled “Default behavior”By default, the API intelligently handles most loading scenarios:
- Waits for the page to fully load
- Detects when assets finish loading
- Automatically manages common JavaScript frameworks
Only add ms_delay if you notice issues with the default behavior.
Image credits and billing
Section titled “Image credits and billing”Image credit usage
Section titled “Image credit usage”The ms_delay parameter can affect how many image credits are consumed per request:
| Delay Range (ms) | Image Credits Used | Example Usage |
|---|---|---|
| 0-5000 | 1 image credit | Standard usage, suitable for most cases |
| 5001-10000 | 2 image credits | Complex pages with many assets |
| 10001-15000 | 3 image credits | Heavy JavaScript applications |
| 15001-20000 | 4 image credits | Maximum delay scenarios |
Important notes
Section titled “Important notes”- Maximum allowed value is 20,000ms (20 seconds)
- Values are rounded up to the nearest image credit tier
- Image credits are calculated before the request is processed
Examples
Section titled “Examples”// Standard usage (1 image credit){ "html": "<div>Your content</div>", "ms_delay": 3000}
// 2 image credits used{ "html": "<div>Your content</div>", "ms_delay": 8000}
// 4 image credits used (maximum){ "html": "<div>Your content</div>", "ms_delay": 20000}Alternatives to high ms_delay values
Section titled “Alternatives to high ms_delay values”Instead of using high ms_delay values, consider:
- Using the
render_when_readyparameter - Optimizing your page load time
- Preloading assets
- Reducing JavaScript execution time
This can help reduce both image credit usage and overall processing time.