Can I get a screenshot of a page? – DataForSEO
Can I get a screenshot of a page?
Yes, you can.
Using the new Page Screenshot endpoint of On-Page API, you can make a high-quality screenshot of any page.
Call the endpoint.
https://api.dataforseo.com/v3/on_page/page_screenshotSpecify the URL of a page you wish to make a screenshot of in the
urlfield. Note: you should indicate an absolute URL withhttp://,https://, orwww..Example:
"url": "https://docs.dataforseo.com/v3/on_page/page_screenshot/"Specify the language header for accessing the website in the
accept_languagefield. Note: if you do not specify this parameter, some websites may deny access. In this case, you will obtain"error_message":"Screenshot is empty"in the response arrayExample:
"accept_language": "en-US"
Your POST request should be structured as in the following example:
[\
{\
"url": "https://docs.dataforseo.com/v3/on_page/page_screenshot/"\
}\
]
In the API response, you will receive the URL of the page screenshot on the DataForSEO storage.
{
"version": "0.1.20220428",
"status_code": 20000,
"status_message": "Ok.",
"time": "3.3395 sec.",
"cost": 0.004,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [\
{\
"id": "05181113-2806-0444-0000-0e13e6bc4076",\
"status_code": 20000,\
"status_message": "Ok.",\
"time": "3.2689 sec.",\
"cost": 0.004,\
"result_count": 1,\
"path": [\
"v3",\
"on_page",\
"page_screenshot"\
],\
"data": {\
"api": "on_page",\
"function": "page_screenshot",\
"url": "https://docs.dataforseo.com/v3/on_page/page_screenshot/"\
},\
"result": [\
{\
"crawl_progress": "finished",\
"error_message": null,\
"items_count": 1,\
"items": [\
{\
"image": "https://api.dataforseo.com/cdn/screenshot/05181113-2806-0444-0000-0e13e6bc4076"\
}\
]\
}\
]\
}\
]
}
Embed DataForSeo widget on your website
Width:
Height:
Embed code:
Copy Code
Preview: