Screenshot API error ยท HTTP 422
No content to convert
empty_content
format=markdown, the page rendered but has no text or image to convert, so there is no markdown to return.How to recognize it
The API answers with status 422 and a JSON body with the message and the error.code empty_content, for example:
HTTP/1.1 422
Content-Type: application/json
{
"error": {
"code": "empty_content",
"message": "The page has no text or images to convert to markdown. Check it with format=png: it may be empty, a file the browser does not show as a page (a PDF), or keep its content in iframes or shadow DOM."
},
"message": "The page has no text or images to convert to markdown. Check it with format=png: it may be empty, a file the browser does not show as a page (a PDF), or keep its content in iframes or shadow DOM."
}Common causes
- An empty page, or a page that builds its content later than the render waits for it.
- Content only inside iframes or shadow DOM, which the markdown does not include.
- A file the browser does not show as a page.
How to fix it
- Send the same request with
format=pngto see what the browser got. - Wait for the content with
wait_for_selector(an element of the content),wait_until=networkidle0or a shortdelay. - For content inside an iframe, convert the iframe’s own URL.
Billing
Not billed: a request answered with this error does not count against your quota. One exception: when an evaluate step of actions or the scripts ran in the page before the render failed, it is billed as one request, because that code could read the page, unless the failure is ours.
Related parameters
format, wait_for_selector, wait_until, delay. 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