Screenshot API error · HTTP 502
Target website unreachable
target_unreachable
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
- Open the error’s page for its causes: ERR_CONNECTION_FAILED, ERR_TOO_MANY_REDIRECTS, ERR_SSL_PROTOCOL_ERROR, …
- 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:
ERR_CONNECTION_RESETERR_CONNECTION_REFUSEDERR_CONNECTION_TIMED_OUTERR_CACHE_MISSERR_ADDRESS_UNREACHABLEERR_TIMED_OUTERR_SSL_PROTOCOL_ERRORERR_CONNECTION_CLOSEDERR_QUIC_PROTOCOL_ERRORERR_NAME_NOT_RESOLVEDERR_TOO_MANY_REDIRECTSERR_NETWORK_CHANGEDERR_SSL_VERSION_OR_CIPHER_MISMATCHERR_HTTP2_PROTOCOL_ERRORERR_SOCKET_NOT_CONNECTEDERR_CERT_AUTHORITY_INVALIDERR_CONNECTION_ABORTEDERR_INTERNET_DISCONNECTEDERR_FILE_NOT_FOUNDERR_FAILEDERR_EMPTY_RESPONSEERR_BLOCKED_BY_RESPONSEERR_UNKNOWN_URL_SCHEMEERR_CERT_COMMON_NAME_INVALIDERR_SSL_UNRECOGNIZED_NAME_ALERTERR_TUNNEL_CONNECTION_FAILEDERR_INVALID_RESPONSEERR_BAD_SSL_CLIENT_AUTH_CERTERR_CERT_DATE_INVALIDERR_PROXY_CONNECTION_FAILEDERR_BLOCKED_BY_CLIENTERR_CONNECTION_FAILED
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