Sand AISand AI MAGI-2MAGI-2 現已登上 SandBase:支援原生音訊的 1080p 影片立即試用

DataForSEO Website Screenshot

API 文件
https://api.sandbase.ai/v1/api/dataforseo/v3/on_page/page_screenshot

Capture a full-page or viewport screenshot of any URL in desktop, mobile or tablet view. Options for custom screen size, language, user agent and dismissing cookie pop-ups.

價格
自 $0.0048 起美元/次呼叫
方法
POST
回應
JSON
參數
1 個必填 · 10 個選填

Playground

輸入
page url required field absolute URL of the page to capture a screenshot of example: https://dataforseo.com/apis
switch proxy pool optional field if true, additional proxy pools will be used to obtain the requested data
preset for browser screen parameters optional field possible values: desktop, mobile, tablet desktop: 1920x1080, scale 1 mobile: 390x844, scale 3 tablet: 1024x1366, scale 2
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
proxy pool location optional field possible values: us, de
custom user agent optional field custom user agent for crawling a website default value: Mozilla/5.0 (compatible; RSiteAuditor)
browser screen width in pixels optional field minimum value: 240 maximum value: 9999 if set, browser_preset is ignored
take a screenshot of the full page optional field set to false to capture only the visible viewport default value: true
browser screen height in pixels optional field minimum value: 240 maximum value: 9999 if set, browser_preset is ignored
browser screen scale factor optional field minimum value: 0.5 maximum value: 3 if set, browser_preset is ignored
輸出範例
回應outputs · 1.2 KB · 47 行
[
  {
    "cost": 0.0048,
    "status_code": 20000,
    "status_message": "Ok.",
    "tasks": [
      {
        "cost": 0.0048,
        "data": {
          "accept_language": "en",
          "api": "on_page",
          "browser_preset": "desktop",
          "disable_cookie_popup": true,
          "full_page_screenshot": false,
          "function": "page_screenshot",
          "url": "https://github.com/google/agents-cli/blob/main/skills/google-agents-cli-workflow/SKILL.md"
        },
        "id": "08200442-2190-0444-0000-d4b83fc6e516",
        "path": [
          "v3",
          "on_page",
          "page_screenshot"
        ],
        "result": [
          {
            "crawl_progress": "finished",
            "error_message": null,
            "items": [
              {
                "image": "https://api.dataforseo.com/cdn/screenshot/08200442-2190-0444-0000-d4b83fc6e516"
              }
            ],
            "items_count": 1
          }
        ],
        "result_count": 1,
        "status_code": 20000,
        "status_message": "Ok.",
        "time": "8.4504 sec."
      }
    ],
    "tasks_count": 1,
    "tasks_error": 0,
    "time": "8.4868 sec.",
    "version": "0.1.20260806"
  }
]

範例

選擇一個範例,將其輸入與結果載入 playground。

API README

Website Screenshot API

Pass a URL and get back a hosted screenshot image of the rendered page. Choose a device preset or exact screen size, and capture the full page or only the visible viewport.

Use cases

  • Generate thumbnails and previews of web pages.
  • Visually monitor competitor landing pages or SERP features.
  • Archive how a page looked at a point in time.

Request

curl -X POST "https://api.sandbase.ai/v1/api/dataforseo/v3/on_page/page_screenshot" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://dataforseo.com/apis"}'

Parameters

NameTypeRequiredDescription
urlstringYespage url required field absolute URL of the page to capture a screenshot of example: https://dataforseo.com/apis
switch_poolbooleanNoswitch proxy pool optional field if true, additional proxy pools will be used to obtain the requested data
browser_presetstringNopreset for browser screen parameters optional field possible values: desktop, mobile, tablet desktop: 1920x1080, scale …
accept_languagestringNolanguage header for accessing the website optional field all locale formats are supported (xx, xx-XX, xxx-XX, etc.) Not…
ip_pool_for_scanstringNoproxy pool location optional field possible values: us, de
custom_user_agentstringNocustom user agent optional field custom user agent for crawling a website default value: Mozilla/5.0 (compatible; RSite…
browser_screen_widthintegerNobrowser screen width in pixels optional field minimum value: 240 maximum value: 9999 if set, browser_preset is ignored
disable_cookie_popupbooleanNodisable the cookie popup optional field set to true to dismiss cookie consent dialogs default value: false
full_page_screenshotbooleanNotake a screenshot of the full page optional field set to false to capture only the visible viewport default value: true
browser_screen_heightintegerNobrowser screen height in pixels optional field minimum value: 240 maximum value: 9999 if set, browser_preset is ignored
browser_screen_scale_factornumberNobrowser screen scale factor optional field minimum value: 0.5 maximum value: 3 if set, browser_preset is ignored

Example response

Real response for the request above, trimmed to the main fields. User names and long IDs are masked.

{
  "status_code": 20000,
  "tasks": [
    {
      "status_message": "Ok.",
      "data": {
        "api": "on_page",
        "function": "page_screenshot",
        "url": "https://dataforseo.com/apis"
      },
      "result": [
        {
          "crawl_progress": "finished",
          "items_count": 1,
          "items": [
            {
              "image": "https://api.dataforseo.com/cdn/screenshot/10060902-2190-0444-0000-91f534c360ca"
            }
          ]
        }
      ]
    }
  ]
}

Notes

  • browser_preset: desktop (1920×1080), mobile (390×844) or tablet.
  • Set disable_cookie_popup to true to hide consent banners.

Pricing

Billed at the actual cost of each call, about $0.0048 for the request above. The cost grows with the number of rows, targets or pages a call returns. Failed calls are not charged. Searches with no results are billed at their actual cost.

探索更多

相關 APIs

所有 APIs
API價格回應
DataForSEO每次呼叫 $0.0048 起JSON
DataForSEO每次呼叫 $0.0102 起JSON
DataForSEO每次呼叫 $0.000724 起JSON
DataForSEO每次呼叫 $0.004JSON
DataForSEO每次呼叫 $0.00162 起JSON
DataForSEO每次呼叫 $0.001105 起JSON

問題

常見問題

我要如何使用 DataForSEO Website Screenshot API?

使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/dataforseo/v3/on_page/page_screenshot。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。

DataForSEO Website Screenshot API 的費用是多少?

每次起 $0.0048,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。

DataForSEO Website Screenshot API 接受哪些參數?

必要:url (string)。 選填:switch_pool (boolean), browser_preset (string), accept_language (string), ip_pool_for_scan (string), custom_user_agent (string) 和 browser_screen_width (integer),以及另外 4 個。 本頁的 Parameters 表格與 Playground 會列出每個欄位。

DataForSEO Website Screenshot API 會回傳什麼?

在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。

我需要 DataForSEO 開發者帳號或 API 金鑰嗎?

不需要。DataForSEO Website Screenshot 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 DataForSEO API 存取權。