Skip to main content
POST
OnPage API 页面截图
渲染任意 url 并返回截图,full_page_screenshot 截整页,browser_screen_width 和 browser_screen_height 设置视口。独立可用,不需要先爬取。响应包在信封里:数据在 tasks[0].result,成败在 tasks[0].status_code——请求被拒时 HTTP 仍是 200。 ⚠️ 图片即使 agent 还没法处理,本身也已经是很大的一份工具结果;只有当「看起来什么样」就是问题本身时才要截图,问的是文字就用 post_dataforseo_on_page_content_parsing_live。

示例

第一次用? 把任意 MCP 客户端指向 https://mcp.aisa.one/mcp —— Claude Code、 Codex、Cursor、VS Code 都可以。鉴权走 OAuth:客户端打开浏览器,你点一次 Allow,不需要粘贴任何 key。各客户端的具体命令和每次调用的价格见 aisa.one/zh-cn/mcp。
在你的 agent 里把这个端点跑起来 → 当前未启用。

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
url
string

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_language
string | null

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_agent
string | null

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_preset
string | null

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_width
integer<int64> | null

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_height
integer | null

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_factor
number | null

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_screenshot
boolean | null

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 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_pool
boolean | null

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_scan
string | null

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

示例:

响应

object | null

Successful operation

version
string | null

API 的当前版本

status_code
integer | null

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

status_message
string | null

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

time
string | null

total execution time, seconds

cost
number<double> | null

任务总成本(美元)

tasks_count
integer<int64> | null

tasks 数组中的任务数量

tasks_error
integer<int64> | null

返回错误的 tasks 数组中的任务数量

tasks
(object | null)[] | null

array of tasks