Screenshot API error ยท HTTP 401
Invalid API key
invalid_api_key
How to recognize it
The API answers with status 401 and a JSON body with the message and the error.code invalid_api_key, for example:
HTTP/1.1 401
Content-Type: application/json
{
"error": {
"code": "invalid_api_key",
"message": "Invalid authentication credentials"
},
"message": "Invalid authentication credentials"
}Common causes
- A typo, a missing character or whitespace copied along with the key.
- The key was rotated or deleted in the dashboard.
- A key of another service, or a placeholder such as
YOUR-API-KEY.
How to fix it
- Copy the key again from the dashboard and trim spaces and line breaks.
- Check which environment variable your code reads in production.
Billing
Not billed: a request answered with this error does not count against your quota.
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