> For the complete documentation index see https://domscan.net/llms.txt. Markdown versions of every docs page are available by appending .md to the page URL.

Source: https://domscan.net/pl/docs/products/security-txt

# API API security.txt

Waliduj kontakty, termin ważności i pola RFC 9116 w security.txt. Użyj tej referencji, aby wybrać operację i zintegrować jej udokumentowany kontrakt odpowiedzi.

[Zobacz stronę produktu](https://domscan.net/pl/security-txt-api)

## Operacje

GET `/v1/security-txt` [Otwórz referencję API](https://domscan.net/pl/docs/products/security-txt#getSecurityTxt)

## GET `/v1/security-txt`

Operacja: `getSecurityTxt`
Kredyty i uwierzytelnianie: 1
Wymagane uwierzytelnianie

GET /v1/security-txt Kredyty: 1

#### Parametry zapytania

| Parametr | Typ | wymagane |
| --- | --- | --- |
| domain | string | opcjonalne |
| url | string | opcjonalne |

#### Pola odpowiedzi

| Pole | Typ |
| --- | --- |
| `classification` | object |
| `classification.status` | string |
| `classification.reason` | string |
| `classification.evidence` | object |
| `classification.evidence.source` | string |
| `classification.evidence.method` | string |
| `classification.evidence.observed_at` | string |
| `classification.evidence.detail` | string |
| `classification.checked_at` | string |
| `domain` | string |
| `status` | string |
| `location` | string \| null |
| `checked_at` | string |
| `fetch[]` | object[] |
| `fetch[]` | object |
| `fetch[].location` | string |
| `fetch[].checked_url` | string |
| `fetch[].http_status` | integer \| null |
| `fetch[].final_url` | string \| null |
| `fetch[].via_proxy` | boolean \| null |
| `fetch[].content_type` | string \| null |
| `fetch[].bytes` | integer \| null |
| `fetch[].truncated` | boolean |
| `fetch[].outcome` | string |
| `fetch[].error` | string \| null |
| `fields` | object |
| `fields.contact[]` | string[] |
| `fields.expires` | string \| null |
| `fields.expires_in_days` | integer \| 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[].name` | string |
| `fields.other_fields[].value` | string |
| `signed` | boolean |
| `issues[]` | object[] |
| `issues[]` | object |
| `issues[].code` | string |
| `issues[].severity` | string |
| `issues[].field` | string \| null |
| `caveats[]` | string[] |

#### Przykładowe żądanie

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/security-txt?domain=example.com&url=https%3A%2F%2Fexample.com"
```

```javascript
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);
```

```python
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())
```

```go
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))
}
```

```ruby
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))
```

#### Przykładowa odpowiedź

```json
{
  "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:security@example.com",
      "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": []
}
```

#### Kody statusu HTTP

- `200` OK
- `400` Nieprawidłowe żądanie
- `401` Nieautoryzowany
- `402` Wymagana płatność
- `429` Zbyt wiele żądań
- `502` Błędna odpowiedź bramy

## Materiały referencyjne

[OpenAPI 3.0](https://domscan.net/v1/openapi.json)
[Postman](https://domscan.net/v1/postman.json)
[MCP](https://domscan.net/pl/mcp-domain-checker)
