urlstringจำเป็น
page url required field absolute URL of the page to capture a screenshot of example: https://dataforseo.com/apis
https://api.sandbase.ai/v1/api/dataforseo/v3/on_page/page_screenshotCapture 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.
[
{
"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
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.
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"}'
| Name | Type | Required | Description |
|---|---|---|---|
url | string | Yes | page url required field absolute URL of the page to capture a screenshot of example: https://dataforseo.com/apis |
switch_pool | boolean | No | switch proxy pool optional field if true, additional proxy pools will be used to obtain the requested data |
browser_preset | string | No | preset for browser screen parameters optional field possible values: desktop, mobile, tablet desktop: 1920x1080, scale … |
accept_language | string | No | language header for accessing the website optional field all locale formats are supported (xx, xx-XX, xxx-XX, etc.) Not… |
ip_pool_for_scan | string | No | proxy pool location optional field possible values: us, de |
custom_user_agent | string | No | custom user agent optional field custom user agent for crawling a website default value: Mozilla/5.0 (compatible; RSite… |
browser_screen_width | integer | No | browser screen width in pixels optional field minimum value: 240 maximum value: 9999 if set, browser_preset is ignored |
disable_cookie_popup | boolean | No | disable the cookie popup optional field set to true to dismiss cookie consent dialogs default value: false |
full_page_screenshot | boolean | No | take a screenshot of the full page optional field set to false to capture only the visible viewport default value: true |
browser_screen_height | integer | No | browser screen height in pixels optional field minimum value: 240 maximum value: 9999 if set, browser_preset is ignored |
browser_screen_scale_factor | number | No | browser screen scale factor optional field minimum value: 0.5 maximum value: 3 if set, browser_preset is ignored |
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"
}
]
}
]
}
]
}
browser_preset: desktop (1920×1080), mobile (390×844) or tablet.disable_cookie_popup to true to hide consent banners.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.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
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://static.sandbase.ai/examples/46031d8f-5e94-4e1f-be8d-c5fa08a87c0d/input/5de63a4b-cc40-4bad-b86c-d9afc7795d54.md",
"accept_language": "en",
"browser_preset": "desktop",
"disable_cookie_popup": true,
"full_page_screenshot": false
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
urlstringจำเป็นpage url required field absolute URL of the page to capture a screenshot of example: https://dataforseo.com/apis
switch_poolbooleanswitch proxy pool optional field if true, additional proxy pools will be used to obtain the requested data
browser_presetstringpreset for browser screen parameters optional field possible values: desktop, mobile, tablet desktop: 1920x1080, scale 1 mobile: 390x844, scale 3 tablet: 1024x1366, scale 2
accept_languagestringlanguage 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
ip_pool_for_scanstringproxy pool location optional field possible values: us, de
custom_user_agentstringcustom user agent optional field custom user agent for crawling a website default value: Mozilla/5.0 (compatible; RSiteAuditor)
browser_screen_widthintegerbrowser screen width in pixels optional field minimum value: 240 maximum value: 9999 if set, browser_preset is ignored
disable_cookie_popupbooleandisable the cookie popup optional field set to true to dismiss cookie consent dialogs default value: false
full_page_screenshotbooleantake a screenshot of the full page optional field set to false to capture only the visible viewport default value: true
browser_screen_heightintegerbrowser screen height in pixels optional field minimum value: 240 maximum value: 9999 if set, browser_preset is ignored
browser_screen_scale_factornumberbrowser screen scale factor optional field minimum value: 0.5 maximum value: 3 if set, browser_preset is ignored
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
[
{
"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"
}
]สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
DataForSEO | เริ่มต้นที่ $0.0048 ต่อครั้ง | JSON |
DataForSEO | เริ่มต้นที่ $0.0102 ต่อครั้ง | JSON |
DataForSEO | เริ่มต้นที่ $0.000724 ต่อครั้ง | JSON |
DataForSEO | $0.004 ต่อการเรียก | JSON |
DataForSEO | เริ่มต้นที่ $0.00162 ต่อครั้ง | JSON |
DataForSEO | เริ่มต้นที่ $0.001105 ต่อครั้ง | JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/dataforseo/v3/on_page/page_screenshot โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
เริ่มต้นที่ $0.0048 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: 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 ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น DataForSEO Website Screenshot ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง DataForSEO API แยกต่างหาก