🎯 在线调试

🚀 API 接口

生成网页截图

GET /api/screenshot

📋 请求参数

参数 类型 必需 默认值 说明
url string - 要截图的网页URL
format string webp 图片格式 (webp, png)
width number 1920 视窗宽度 (100-3840)
height number 1080 视窗高度 (100-2160)

💡 使用示例

基础使用

GET /api/screenshot?url=https://example.com

自定义格式和尺寸

GET /api/screenshot?url=https://example.com&format=png&width=1920&height=1080

JavaScript 调用示例

// 获取截图
const response = await fetch('/api/screenshot?url=https://example.com&format=webp');
const imageBlob = await response.blob();

// 显示图片
const img = document.createElement('img');
img.src = URL.createObjectURL(imageBlob);
document.body.appendChild(img);
                    

✨ 特色功能

🚀 高性能

全球边缘计算架构,响应速度快,稳定可靠

💾 智能缓存

R2 存储桶缓存,支持 7 天缓存,大幅提升访问速度

🖼️ 多格式支持

支持 WebP 和 PNG 格式,WebP 体积更小,PNG 兼容性更好