API 参考

安全联系文件验证 API API 参考

验证 security.txt 的联系方式、有效期和 RFC 9116 字段。 通过本参考选择合适的端点,并准确了解它返回的内容。

操作

GET /v1/security-txt 查看 API 参考

GET /v1/security-txt

操作: getSecurityTxt积分和身份验证: 1需要身份验证
GET/v1/security-txt积分: 1

查询参数

参数类型必需
domainstring可选
urlstring可选

响应字段

字段类型
classificationobject
classification.statusstring
classification.reasonstring
classification.evidenceobject
classification.evidence.sourcestring
classification.evidence.methodstring
classification.evidence.observed_atstring
classification.evidence.detailstring
classification.checked_atstring
domainstring
statusstring
locationstring | null
checked_atstring
fetch[]object[]
fetch[]object
fetch[].locationstring
fetch[].checked_urlstring
fetch[].http_statusinteger | null
fetch[].final_urlstring | null
fetch[].via_proxyboolean | null
fetch[].content_typestring | null
fetch[].bytesinteger | null
fetch[].truncatedboolean
fetch[].outcomestring
fetch[].errorstring | null
fieldsobject
fields.contact[]string[]
fields.expiresstring | null
fields.expires_in_daysinteger | null
fields.encryption[]string[]
fields.acknowledgments[]string[]
fields.preferred_languages[]string[]
fields.canonical[]string[]
fields.policy[]string[]
fields.hiring[]string[]
fields.csaf[]string[]
fields.other_fields[]object[]
fields.other_fields[]object
fields.other_fields[].namestring
fields.other_fields[].valuestring
signedboolean
issues[]object[]
issues[]object
issues[].codestring
issues[].severitystring
issues[].fieldstring | null
caveats[]string[]

请求示例

curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/security-txt?domain=example.com&url=https%3A%2F%2Fexample.com"
const response = await fetch("https://domscan.net/v1/security-txt?domain=example.com&url=https%3A%2F%2Fexample.com", {
  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/security-txt?domain=example.com&url=https%3A%2F%2Fexample.com",
    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/security-txt?domain=example.com&url=https%3A%2F%2Fexample.com", 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/security-txt?domain=example.com&url=https%3A%2F%2Fexample.com")
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))

响应示例

{
  "domain": "example.com",
  "status": "valid",
  "location": "well_known",
  "checked_at": "2026-10-09T10:00:00.000Z",
  "fetch": [
    {
      "location": "well_known",
      "checked_url": "https://example.com/.well-known/security.txt",
      "http_status": 200,
      "final_url": "https://example.com/.well-known/security.txt",
      "via_proxy": true,
      "content_type": "text/plain; charset=utf-8",
      "bytes": 279,
      "truncated": false,
      "outcome": "found",
      "error": null
    }
  ],
  "fields": {
    "contact": [
      "mailto:[email protected]",
      "https://example.com/report"
    ],
    "expires": "2027-01-01T00:00:00.000Z",
    "expires_in_days": 83,
    "encryption": [
      "https://example.com/pgp-key.txt"
    ],
    "acknowledgments": [],
    "preferred_languages": [
      "en",
      "es"
    ],
    "canonical": [
      "https://example.com/.well-known/security.txt"
    ],
    "policy": [
      "https://example.com/security-policy"
    ],
    "hiring": [],
    "csaf": [],
    "other_fields": []
  },
  "signed": false,
  "issues": [],
  "caveats": []
}

HTTP 状态码

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

参考资源