{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/qelka-com/json-schema/qelka-com-url-result-schema.json",
  "title": "UrlResult",
  "description": "Safety signals of a link. Results are cached 60 minutes.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/qelka-com-openapi.yml#/components/schemas/UrlResult",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^lkp_[0-9A-HJKMNP-TV-Z]{10,26}$",
      "description": "Unique identifier of this lookup."
    },
    "object": {
      "type": "string",
      "const": "url"
    },
    "input": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "description": "URL that was checked, with a scheme added when the input had none."
    },
    "final_url": {
      "description": "Last URL of the redirect chain that answered, null when nothing answered.",
      "type": [
        "string",
        "null"
      ]
    },
    "host": {
      "type": "string",
      "description": "Host of the final URL, or of the URL sent when nothing answered."
    },
    "domain": {
      "description": "Registrable domain of host, null for an IP address.",
      "type": [
        "string",
        "null"
      ]
    },
    "tld": {
      "type": [
        "string",
        "null"
      ]
    },
    "verdict": {
      "type": "string",
      "enum": [
        "safe",
        "suspicious",
        "malicious"
      ],
      "description": "malicious: a critical signal was found (a listing in a threat feed, or a homoglyph of a brand domain). suspicious: no critical signal, but the points add up to 30 or more. safe: neither; it means no warning sign was found, not that the page is harmless."
    },
    "score": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Sum of the points of every reason, capped at 100."
    },
    "reasons": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "listed_threat_feed",
              "homoglyph_brand",
              "typosquat_brand",
              "brand_in_subdomain",
              "credentials_in_url",
              "domain_not_registered",
              "brand_with_keyword",
              "mixed_scripts",
              "ip_address_host",
              "new_domain",
              "brand_other_tld",
              "punycode_host",
              "risky_tld",
              "no_https",
              "young_domain",
              "brand_in_path",
              "brand_in_domain",
              "url_shortener",
              "free_hosting",
              "cross_domain_redirect",
              "long_redirect_chain",
              "suspicious_keywords",
              "deep_subdomains",
              "unreachable",
              "http_error"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "low",
              "medium",
              "high",
              "critical"
            ],
            "description": "Weight class of the signal, from its points: critical 90 and more, high 40 to 89, medium 20 to 39, low 1 to 19, info 0."
          },
          "points": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Points added to score by this signal."
          },
          "message": {
            "type": "string",
            "description": "Plain-English explanation of the signal."
          }
        },
        "required": [
          "code",
          "severity",
          "points",
          "message"
        ],
        "additionalProperties": false
      },
      "description": "Every signal found, strongest first."
    },
    "reachable": {
      "type": "boolean"
    },
    "http_status": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "https": {
      "type": "boolean",
      "description": "True when the final URL was served over HTTPS."
    },
    "redirects": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "status": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTP status the URL answered, null when it was not requested (not a public host) or did not answer."
          },
          "via": {
            "type": "string",
            "enum": [
              "request",
              "redirect",
              "meta_refresh"
            ],
            "description": "request: the URL sent. redirect: a Location header. meta_refresh: a meta refresh tag of the previous page."
          }
        },
        "required": [
          "url",
          "host",
          "status",
          "via"
        ],
        "additionalProperties": false
      },
      "description": "Every URL of the chain, in order, at most 11. Only public hosts are requested."
    },
    "domain_age": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "domain": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "enum": [
                "found",
                "not_found",
                "unsupported",
                "error"
              ],
              "description": "found: the registry answered with the registration. not_found: the registry says the domain is not registered. unsupported: the TLD has no public RDAP service. error: the registry did not answer."
            },
            "created_at": {
              "type": [
                "string",
                "null"
              ]
            },
            "age_days": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "registrar": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "domain",
            "status",
            "created_at",
            "age_days",
            "registrar"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "Registration of domain over RDAP, null for an IP address."
    },
    "unicode_host": {
      "description": "Host decoded from punycode, when it has xn-- labels.",
      "type": [
        "string",
        "null"
      ]
    },
    "punycode": {
      "type": "boolean"
    },
    "mixed_scripts": {
      "type": "boolean",
      "description": "True when a label mixes Latin letters with Cyrillic, Greek or another script."
    },
    "lookalike": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "brand": {
              "type": "string"
            },
            "official_domain": {
              "type": "string",
              "description": "Main official domain of the brand."
            },
            "technique": {
              "type": "string",
              "enum": [
                "homoglyph",
                "typosquat",
                "brand_in_subdomain",
                "brand_with_keyword",
                "brand_other_tld",
                "brand_in_domain",
                "brand_in_path"
              ]
            },
            "similarity": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "description": "How closely the technique imitates the brand: 1 for a homoglyph, 0.9 for a typo, down to 0.3 for a brand name in the path."
            }
          },
          "required": [
            "brand",
            "official_domain",
            "technique",
            "similarity"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "Strongest imitation of a brand found in the host or path, null when none."
    },
    "official_brand": {
      "description": "Brand whose official domain this is, null otherwise.",
      "type": [
        "string",
        "null"
      ]
    },
    "risky_tld": {
      "type": "boolean",
      "description": "True for the 20 TLDs with the highest phishing domain score in Phishing Activity in Top-level Domains (TLDs), May 1, 2025 - April 30, 2026, by Interisle Consulting Group, Cybercrime Information Center."
    },
    "shortener": {
      "type": "boolean",
      "description": "True when a URL of the chain is on a link shortener."
    },
    "free_hosting": {
      "type": "boolean",
      "description": "True when the final host is on a platform where anyone can publish a site."
    },
    "threats": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "feed": {
            "type": "string",
            "enum": [
              "destroylist",
              "phishing_database",
              "urlhaus"
            ]
          },
          "host": {
            "type": "string",
            "description": "Host the feed lists."
          },
          "url": {
            "description": "Exact URL the feed lists, when it lists URLs.",
            "type": [
              "string",
              "null"
            ]
          },
          "match": {
            "type": "string",
            "enum": [
              "host",
              "parent_domain",
              "url"
            ],
            "description": "host: the host of a URL in the chain is listed. parent_domain: a parent domain of that host is listed. url: the exact URL is listed."
          },
          "threat": {
            "type": "string",
            "enum": [
              "phishing",
              "malware_download"
            ]
          },
          "reference": {
            "description": "Link to the entry at the feed, when it has one.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "feed",
          "host",
          "url",
          "match",
          "threat",
          "reference"
        ],
        "additionalProperties": false
      }
    },
    "feeds": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "destroylist",
              "phishing_database",
              "urlhaus"
            ]
          },
          "entries": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Entries loaded from the feed, null for a feed queried live."
          },
          "loaded_at": {
            "description": "When the feed was last loaded, ISO 8601.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "entries",
          "loaded_at"
        ],
        "additionalProperties": false
      },
      "description": "Threat feeds consulted, with their size and load time."
    },
    "credits_used": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "Credits debited for this call. Cached results cost the same; failed upstream calls cost 0."
    },
    "cached": {
      "type": "boolean",
      "description": "True when the result was served from the 7-day result cache. Send `fresh: true` to bypass it."
    }
  },
  "required": [
    "id",
    "object",
    "input",
    "url",
    "final_url",
    "host",
    "domain",
    "tld",
    "verdict",
    "score",
    "reasons",
    "reachable",
    "http_status",
    "https",
    "redirects",
    "domain_age",
    "unicode_host",
    "punycode",
    "mixed_scripts",
    "lookalike",
    "official_brand",
    "risky_tld",
    "shortener",
    "free_hosting",
    "threats",
    "feeds",
    "credits_used",
    "cached"
  ],
  "additionalProperties": false
}