مرجع API

API الخاص بـ واجهة برمجة ملف security.txt للتواصل الأمني

تحقق من جهات الاتصال وتاريخ الانتهاء وحقول RFC 9116 في security.txt. استخدم هذا المرجع لاختيار نقطة النهاية المناسبة ومعرفة ما تعيده بالضبط.

العمليات

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 OK
  • 400 طلب غير صالح
  • 401 غير مصرح
  • 402 الدفع مطلوب
  • 429 طلبات كثيرة جداً
  • 502 بوابة غير صالحة

موارد المرجع