Menu

Errors options

Reference for the errors options of the shotkit screenshot API, with an example request for each.

Fail the request instead of returning a screenshot of a broken page. Failed requests don't count toward your monthly screenshots.

ignore_host_errors

Capture even if the site returns 4xx/5xx. By default, a 4xx or 5xx from the site fails the request with host_returned_error.

Type: boolean · Default: false

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/missing-page","ignore_host_errors":true}' \
  --fail-with-body -o shot.jpg

error_on_selector_not_found

Fail if selector / scroll_into_view is missing.

Type: boolean · Default: false

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","selector":"#chart","error_on_selector_not_found":true}' \
  --fail-with-body -o shot.jpg

fail_if_request_failed

Fail if a matching sub-request fails. Wildcard patterns matched against sub-request URLs. A request fails when it errors or returns 4xx/5xx.

Type: list

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","fail_if_request_failed":["*api.example.com*"]}' \
  --fail-with-body -o shot.jpg

fail_if_content_missing

Fail if this text is missing (case-insensitive). Matched against the page's visible text. Catches login walls and empty states.

Type: list

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","fail_if_content_missing":["Add to cart"]}' \
  --fail-with-body -o shot.jpg

fail_if_content_contains

Fail if this text is present (case-insensitive).

Type: list

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","fail_if_content_contains":["Access denied","captcha"]}' \
  --fail-with-body -o shot.jpg