Screenshot API error ยท HTTP 422
Target is a file, not a page
target_not_renderable
message names the file’s type.How to recognize it
The API answers with status 422 and a JSON body with the message and the error.code target_not_renderable, for example:
HTTP/1.1 422
Content-Type: application/json
{
"error": {
"code": "target_not_renderable",
"message": "The target URL answered with a file (application/pdf), not a web page, so it cannot be rendered."
},
"message": "The target URL answered with a file (application/pdf), not a web page, so it cannot be rendered."
}Common causes
- A link straight to a PDF document (
Content-Type: application/pdf), such ashttps://example.com/report.pdf. - A download: a file sent with
Content-Disposition: attachment, or a type the browser does not display, such asapplication/ziportext/csv. - A page that redirects to such a file.
How to fix it
- Render the web page that links the file, not the file itself.
- Download a PDF or other file directly: the API renders web pages, not files.
- Only the answer to the URL itself counts: a page that starts a download while it loads (“Your download will start …”) is captured as usual.
Billing
Not billed: a request answered with this error does not count against your quota.
Related parameters
url. Each is described in the take endpoint reference.
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, AVIF 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