📅 2026-06-16 · 快照API技术博客
网站截图API入门指南:5分钟快速上手
网站截图API入门指南:5分钟快速上手
2026-06-16 · 阅读约需 5分钟
什么是截图API?
截图API是一种云服务,让你通过简单的HTTP请求就能对任意网址进行高清截图、PDF导出和文字提取。告别笨重的Selenium和Puppeteer配置,一行代码搞定所有截图需求。
为什么选择快照API?
快照API专为国内开发者优化,国内服务器极速响应,注册即送每月100次免费额度。
一行命令开始截图
curl -H "x-api-key: 你的密钥" \
"http://chuangyuanhb.top/api/v1/screenshot?url=https://example.com&width=800&height=600" \
-o screenshot.png
没错,就这么简单。一个HTTP GET请求就能获取高清网页截图。
多语言快速集成
Python
import requests
r = requests.get("截图URL", headers={"x-api-key": "你的密钥"})
with open("my_screenshot.png", "wb") as f:
f.write(r.content)
Node.js
const fs = require('fs');
const https = require('https');
// 使用内置http模块即可,无需额外依赖
download("截图URL", "screenshot.png");
常用参数说明
- PDF导出:将url参数改为 /api/v1/pdf 即可
- 全页面截图:添加参数 full_page=true
- 移动端截图:设置 width=375&height=812