OnPage

‌‌ Using this endpoint, you can capture a full high-quality screenshot of any webpage. In this way, you can review the target page as the DataForSEO crawler and Googlebot see it.

post/v3/on_page/page_screenshot

Request

  • Base URL: https://api.dataforseo.com
  • URL: https://api.dataforseo.com/v3/on_page/page_screenshot
  • Auth: HTTP basic

Request body

urlstring

<em>page url</em><br><strong>required field</strong><br>absolute URL of the page to snap<br><strong>note:</strong> if the URL you indicate here returns a 404 status code or the indicated value is not a valid URL, you will obtain <code>"error_message":"Screenshot is empty"</code> in the response array

accept_languagestring nullable

<em>language header for accessing the website</em><br>optional field<br>all locale formats are supported (xx, xx-XX, xxx-XX, etc.)<br><strong>note:</strong> if you do not specify this parameter, some websites may deny access; in this case, you will obtain <code>"error_message":"Screenshot is empty"</code> in the response array

custom_user_agentstring nullable

<em>custom user agent</em><br>optional field<br>custom user agent for crawling a website<br>example: <code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36<br></code><br>default value: <code>Mozilla/5.0 (compatible; RSiteAuditor)</code>

browser_presetstring nullable

<em>preset for browser screen parameters</em><br>optional field<br>if you use this field, you don't need to indicate <code>browser_screen_width</code>, <code>browser_screen_height</code>, <code>browser_screen_scale_factor</code><p>possible values:<br><code>desktop</code>, <code>mobile</code>, <code>tablet</code><p><code>desktop</code> preset will apply the following values:<p><code>browser_screen_width: 1920</code><br><code>browser_screen_height: 1080</code><br><code>browser_screen_scale_factor: 1</code><p><code>mobile</code> preset will apply the following values:<p><code>browser_screen_width: 390</code><br><code>browser_screen_height: 844</code><br><code>browser_screen_scale_factor: 3</code><p><code>tablet</code> preset will apply the following values:<p><code>browser_screen_width: 1024</code><br><code>browser_screen_height: 1366</code><br><code>browser_screen_scale_factor: 2</code><p><strong>Note:</strong> in this endpoint, the <code>enable_browser_rendering</code>, <code>enable_javascript</code>, <code>load_resources</code>, and <code>enable_xhr</code> parameters are always enabled.

browser_screen_widthinteger nullable

<em>browser screen width</em><br>optional field<br>you can set a custom browser screen width to perform audit for a particular device;<br>if you use this field, you don't need to indicate <code>browser_preset</code> as it will be ignored;<p>minimum value, in pixels: <code>240</code> <br>maximum value, in pixels: <code>9999</code>

browser_screen_heightinteger nullable

<em>browser screen height</em><br>optional field<br>you can set a custom browser screen height to perform audit for a particular device;<br>if you use this field, you don't need to indicate <code>browser_preset</code> as it will be ignored;<p>minimum value, in pixels: <code>240</code> <br>maximum value, in pixels: <code>9999</code>

browser_screen_scale_factornumber nullable

<em>browser screen scale factor</em><br>optional field<br>you can set a custom browser screen resolution ratio to perform audit for a particular device;<br>if you use this field, you don't need to indicate <code>browser_preset</code> as it will be ignored;<p>minimum value: <code>0.5</code> <br>maximum value: <code>3</code>

full_page_screenshotboolean nullable

<em>take a screenshot of the full page</em><br>optional field<br>set to <code>false</code> if you want to capture only the part of the page displayed before scrolling<br>default value: <code>true</code>

disable_cookie_popupboolean nullable

<em>disable the cookie popup </em><br>optional field<br>set to <code>true</code> if you want to disable the popup requesting cookie consent from the user;<br>default value: <br><code>false</code>

switch_poolboolean nullable

<em>switch proxy pool</em><br>optional field<br>if <code>true</code>, additional proxy pools will be used to obtain the requested data;<br>the parameter can be used if a multitude of tasks is set simultaneously, resulting in occasional <code>rate-limit</code> and/or <code>site_unreachable</code> errors

ip_pool_for_scanstring nullable

<em>proxy pool</em><br>optional field<br>you can choose a location of the proxy pool that will be used to obtain the requested data;<br>the parameter can be used if page content is inaccessible in one of the locations, resulting in occasional <code>site_unreachable</code> errors<br>possible values: <code>us</code>, <code>de</code>

Example request

[
  {
    "url": "https://dataforseo.com/apis"
  }
]

Response

Successful operation

versionstring nullable

the current version of the API

status_codeinteger nullable

general status code you can find the full list of the response codes here

status_messagestring nullable

general informational message you can find the full list of general informational messages here

timestring nullable

total execution time, seconds

costnumber double nullable

total tasks cost, USD

tasks_countinteger nullable

the number of tasks in the tasks array

tasks_errorinteger nullable

the number of tasks in the tasks array returned with an error

Changes