← 返回网页截图首页
在线网页截图 API 接口文档
开发者可以通过 API 接口将网页截图功能集成到自己的应用中。
1. 接口说明与鉴权
POST https://www.cuobiezi.net/api/v4/tools/image/website/snapshot

接口描述: 传入目标网页 URL 及渲染参数,接口将直接返回生成的截图图片流(Content-Type: image/png)。

请求鉴权

所有接口均需在 HTTP Header 中携带 Bearer Token 进行鉴权:

Authorization: Bearer <your_api_key>

API Token 可在 字根秀秀后台 申请。

2. 请求参数

支持 application/jsonapplication/x-www-form-urlencoded 格式提交数据。

参数名类型是否必填说明与枚举值
urlString目标网址,必须以 https:// 开头。例如:https://www.google.com
screenshot_modeString截图方式。
- viewport: (默认) 仅截取首屏可见区域
- fullpage: 截取整个网页长图
device_typeString模拟设备类型,决定浏览器视口分辨率。
- desktop: (默认) 桌面端,1920x1080
- tablet: 平板端,768x1024
- mobile: 手机端,375x812
- custom: 自定义尺寸
custom_xInteger自定义视口宽度(仅当 device_type=custom 时有效,最小值 100)
custom_yInteger自定义视口高度(仅当 device_type=custom 时有效,最小值 100)
3. 请求示例 (cURL)

以下示例使用 cURL 请求 API,并将返回的二进制图片流保存为 output.png

curl -X POST "https://www.cuobiezi.net/api/v4/tools/image/website/snapshot" \ -H "Authorization: Bearer YOUR_API_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "url": "https://www.github.com", "screenshot_mode": "fullpage", "device_type": "desktop" }' \ --output output.png