Screenshot API error · HTTP 502

Target website unreachable

target_unreachable

The browser could not load the page. The message names Chrome’s network error, such as ERR_TOO_MANY_REDIRECTS or ERR_SSL_PROTOCOL_ERROR; each has its own page. A connection that could not be opened at all (refused, timed out, unreachable) is reported as ERR_CONNECTION_FAILED.

How to recognize it

The API answers with status 502 and a JSON body with the message, for example:

HTTP/1.1 502
Content-Type: application/json

{
  "message": "The target website could not be loaded (ERR_CONNECTION_FAILED)."
}

Common causes

  • The website is down, or its firewall refuses connections from data centers.
  • A redirect loop, a broken TLS setup or an invalid response.
  • A page that answers with nothing at all.

How to fix it

  1. Open the error’s page for its causes: ERR_CONNECTION_FAILED, ERR_TOO_MANY_REDIRECTS, ERR_SSL_PROTOCOL_ERROR, …
  2. Check that the site loads from another network.

Retry

When the site is back. A retry right away usually fails the same way.

Billing

Not billed: a request answered with this error does not count against your quota.

Common Chrome network errors

What each error means, how to fix it, and how the API reports it:

Every response carries an X-Request-Id header. If this page does not explain the error, write to support@screenshotbase.com with that id. All statuses: status codes.

Other API errors

Screenshot API

Take screenshots from your code

screenshotbase renders any website in a real browser and returns the image: full page or viewport, any device size, retina, from 100+ countries, with cookie banners and ads hidden.

/v1/take documentation Screenshot API All documentation

300 free screenshots every month. No credit card required.

GET https://api.screenshotbase.com/v1/take?url=https://example.com&full_page=true

# Response: the image (PNG, JPG, WebP or GIF)
curl -G "https://api.screenshotbase.com/v1/take" \
  --data-urlencode "url=https://example.com" \
  -d viewport_width=1280 -d viewport_height=800 \
  -d format=png \
  -H "apikey: YOUR-API-KEY" \
  -o screenshot.png

More free tools

Start using our Screenshot API for free today!

Get 300 requests / month for free