API 参考

网站截图 API API 参考

在桌面或移动端将任意页面截取为图片或 PDF。 使用此参考选择操作,并集成其文档化的响应契约。

操作

GET /v1/screenshot 查看 API 参考

GET /v1/screenshot

操作: getScreenshot 积分和身份验证: 10 需要身份验证
GET /v1/screenshot 积分: 10

查询参数

参数 类型 必需
url string 必需
device string
允许的值 desktopmobile
默认值 desktop
可选
full_page boolean 可选
format string
允许的值 pngjpegwebppdf
默认值 png
可选
output string
允许的值 jsonbinary
默认值 json
可选

响应字段

字段 类型
url string
final_url string
status string
reason string | null
checked_at string
http_status integer | null
redirect_count integer
duration_ms integer
resource_limit_reached boolean
capture object
capture.format string
capture.mime_type string
capture.device string
capture.full_page boolean
capture.width integer | null
capture.height integer | null
capture.bytes integer
capture.format_fallback string | null
capture.data_base64 string

请求示例

curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/screenshot?url=https%3A%2F%2Fexample.com&device=desktop&full_page=false&format=png&output=json"
const response = await fetch("https://domscan.net/v1/screenshot?url=https%3A%2F%2Fexample.com&device=desktop&full_page=false&format=png&output=json", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
import os
import requests

response = requests.get(
    "https://domscan.net/v1/screenshot?url=https%3A%2F%2Fexample.com&device=desktop&full_page=false&format=png&output=json",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/screenshot?url=https%3A%2F%2Fexample.com&device=desktop&full_page=false&format=png&output=json", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	data, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp.Status, string(data))
}
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/screenshot?url=https%3A%2F%2Fexample.com&device=desktop&full_page=false&format=png&output=json")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end
puts JSON.pretty_generate(JSON.parse(response.body))

响应示例

{
  "url": "https://example.com/",
  "final_url": "https://example.com/",
  "status": "ok",
  "reason": null,
  "checked_at": "2026-10-13T12:00:00.000Z",
  "http_status": 200,
  "redirect_count": 0,
  "duration_ms": 4210,
  "resource_limit_reached": false,
  "capture": {
    "format": "png",
    "mime_type": "image/png",
    "device": "desktop",
    "full_page": false,
    "width": 1366,
    "height": 768,
    "bytes": 182340,
    "data_base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="
  }
}

HTTP 状态码

  • 200 成功
  • 400 请求错误
  • 401 未授权
  • 402 需要付款
  • 429 请求过多

参考资源