Docs
截图 API
截图 API
捕捉网站截图
Usage
API URL:
https://qf.edu.kg/api/v1/scraping/screenshot?url=https://vmail.dev&key=your_api_key查询参数
- url`(必填): 要捕获的有效 URL。
- width
(可选): 输出截图的宽度。默认为250`。 - height
(可选): 输出截图的高度: 输出截图的高度。默认为250`。 - viewportWidth
(可选): 渲染视口的宽度。默认为1080`。 - viewportHeight
(可选): 呈现视口的高度。默认为1080`。 - forceReload
(可选): 强制重新加载缓存图像。默认为false`。 - isMobile
(可选): 为用户代理添加移动标志。默认为false`。 - isFullPage
(可选): 渲染完整页面,而不是视口裁剪。默认为false`。 - isDarkMode
(可选): 首选深色方案。默认为false`。 - deviceScaleFactor
(可选): 指定设备比例因子(可视为 DPR)。默认为1`。
例如
https://qf.edu.kg/api/v1/scraping/screenshot?url=https://vmail.dev&key=example_key
下面是一些查询参数组合示例:
https://qf.edu.kg/api/v1/scraping/screenshot?url=https://vmail.dev&key=example_key
https://qf.edu.kg/api/v1/scraping/screenshot?url=https://vmail.dev&key=example_key&width=500&height=500
https://qf.edu.kg/api/v1/scraping/screenshot?url=https://vmail.dev&key=example_key&viewportWidth=1920&viewportHeight=1080&isFullPage=true
https://qf.edu.kg/api/v1/scraping/screenshot?url=https://vmail.dev&key=example_key&viewportWidth=1920&viewportHeight=1080&isFullPage=true&isDarkMode=true在 HTML 中使用
<img
src="https://qf.edu.kg/api/v1/scraping/screenshot?url=https://oiov.dev&key=example_key"
alt="Oiov's personal home page screenshot"
/>