Felo API PlatformFelo API Platform

資料 API / DataForSEO / On Page

OnPage API Page Screenshot

Renders any url and returns a screenshot, with full_page_screenshot for the whole scroll height and browser_screen_width and browser_screen_height setting the viewport. Standalone - no crawl needed. Wrapped in DataForSEO's envelope: data in tasks[0].result, outcome in tasks[0].status_code - a rejected request still returns HTTP 200. ⚠️ An image is a large tool result even before an agent can do anything with it; ask for a screenshot only when the visual is the point, and use post_dataforseo_on_page_content_parsing_live when the text is.

參數

沒有路徑、查詢或請求標頭參數。

請求主體

  • urlstring必填

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

  • accept_languagestring選填

    language header for accessing the website optional field all locale formats are supported (xx, xx-XX, xxx-XX, etc.) 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 array

  • custom_user_agentstring選填

    custom user agent optional field custom user agent for crawling a website example: 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 default value: Mozilla/5.0 (compatible; RSiteAuditor)

  • browser_presetstring選填

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

  • browser_screen_widthinteger選填

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

  • browser_screen_heightinteger選填

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

  • browser_screen_scale_factornumber選填

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

  • full_page_screenshotboolean選填

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

  • disable_cookie_popupboolean選填

    disable the cookie popup optional field set to true if you want to disable the popup requesting cookie consent from the user; default value: false

  • switch_poolboolean選填

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

  • ip_pool_for_scanstring選填

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

請求範例

curl -X POST "https://openapi.felo.ai/v1/beta/dataforseo/on_page/page_screenshot" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "<string>",
  "accept_language": "<string>",
  "custom_user_agent": "<string>",
  "browser_preset": "<string>",
  "browser_screen_width": 0,
  "browser_screen_height": 0,
  "browser_screen_scale_factor": 0,
  "full_page_screenshot": false
}'

回應

回應欄位

  • versionstring選填

    the current version of the API

  • status_codeinteger選填

    general status code you can find the full list of the response codes here Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions

  • status_messagestring選填

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

  • timestring選填

    execution time, seconds

  • costnumber選填

    total tasks cost, USD

  • tasks_countinteger選填

    the number of tasks in the tasks array

  • tasks_errorinteger選填

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

  • tasksstring[]選填

    array of tasks

  • idstring選填

    task identifier unique task identifier in our system in the UUID format

  • status_codeinteger選填

    status code of the task generated by DataForSEO; can be within the following range: 10000-60000 you can find the full list of the response codes here

  • status_messagestring選填

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

  • timestring選填

    execution time, seconds

  • costnumber選填

    cost of the task, USD

  • result_countinteger選填

    number of elements in the result array

  • pathstring[]選填

    URL path

  • dataobject選填

    contains the same parameters that you specified in the POST request

  • resultstring[]選填

    array of results

  • crawl_progressstring選填

    status of the crawling session possible values: in_progress, finished

  • error_messagestring選填

    error message if the url you indicated returns a 404 status code or is not a valid URL, you will obtain "error_message":"Screenshot is empty" if no error is encountered, the value will be null

  • items_countinteger選填

    number of items in the results array

  • itemsstring[]選填

    items array

  • imagestring選填

    screenshot of the requested page URL of the page screenshot on the DataForSEO storage