Screenshot API error ยท HTTP 400

Host name not resolved

target_unresolvable

The host name in url has no address: the DNS lookup failed. In the browser the same failure is ERR_NAME_NOT_RESOLVED.

How to recognize it

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

HTTP/1.1 400
Content-Type: application/json

{
  "message": "The hostname of the target website could not be resolved."
}

Common causes

  • A typo in the domain, or a domain that expired or has no A/AAAA record.
  • A redirect of the page to a host that does not resolve.
  • A brand-new DNS record that has not reached public resolvers yet.

How to fix it

  1. Check the URL, and the domain’s records with dig +short example.com.
  2. After repeated failures a host is answered with this error for a few minutes without a new lookup, so retry a fixed domain after a short wait.

Billing

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

The same error in a browser

Chrome shows this failure as ERR_NAME_NOT_RESOLVED.

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