# Link safety

> POST /url follows a link's redirect chain, checks every host against public phishing feeds, reads the domain age and spots brand look-alikes, with a verdict and every reason.

`POST https://api.qelka.com/v1/url`

Check a link before your users open it. The API follows the redirect chain hop by hop, checks every host against public phishing feeds, reads the registration date of the final domain from its registry, and looks for imitations of brand domains, punycode, risky TLDs, link shorteners and plain HTTP. It answers with a verdict, a score from 0 to 100 and every reason with its points. Each check costs 1 credit.

## Request

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `url` | string | Yes | none | The link to check, 1 to 2,048 characters: a full `http` or `https` URL, or a bare domain such as `example.com`. A bare domain is requested over HTTPS first, then over HTTP if HTTPS does not answer. |
| `fresh` | boolean | No | `false` | `true` skips the 60-minute result cache and checks the link again. |

Only `http` and `https` links are accepted. A private IP address, `localhost`, or a host under `.local`, `.internal`, `.test`, `.invalid`, `.example`, `.home.arpa`, `.onion`, `.lan`, `.intranet` or `.corp` is a `422 unprocessable_input`. A user name or password inside the URL is removed before any request, and reported as a reason.

The API requests each URL of the chain without running scripts, with a 5-second limit per hop, and stops after 10 redirects or meta refreshes. A redirect to a host that is not public is listed in the chain but never requested. Every snippet sets a 60-second client timeout.

```bash title="cURL"
curl https://api.qelka.com/v1/url \
  --max-time 60 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "http://github.com"}'
```
```javascript title="Node.js"
const response = await fetch('https://api.qelka.com/v1/url', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ url: 'http://github.com' }),
  signal: AbortSignal.timeout(60_000),
})
const result = await response.json()
console.log(result.verdict, result.reasons)
```
```python title="Python"
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/url",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"url": "http://github.com"},
    timeout=60,
)
result = response.json()
print(result["verdict"], result["reasons"])
```
```php title="PHP"
<?php
$ch = curl_init('https://api.qelka.com/v1/url');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('QELKA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode(['url' => 'http://github.com']),
    CURLOPT_TIMEOUT => 60,
]);
$result = json_decode(curl_exec($ch), true);
echo $result['verdict'], PHP_EOL;
```
```go title="Go"
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"time"
)

func main() {
	payload, _ := json.Marshal(map[string]any{"url": "http://github.com"})
	request, _ := http.NewRequest(http.MethodPost, "https://api.qelka.com/v1/url", bytes.NewReader(payload))
	request.Header.Set("Authorization", "Bearer "+os.Getenv("QELKA_API_KEY"))
	request.Header.Set("Content-Type", "application/json")

	client := &http.Client{Timeout: 60 * time.Second}
	response, err := client.Do(request)
	if err != nil {
		panic(err)
	}
	defer response.Body.Close()

	var result map[string]any
	if err := json.NewDecoder(response.Body).Decode(&result); err != nil {
		panic(err)
	}
	fmt.Println(result["verdict"], result["reasons"])
}
```
```ruby title="Ruby"
require 'json'
require 'net/http'

uri = URI('https://api.qelka.com/v1/url')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{ENV.fetch('QELKA_API_KEY')}"
request['Content-Type'] = 'application/json'
request.body = JSON.generate({ url: 'http://github.com' })

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true, read_timeout: 60) do |http|
  http.request(request)
end
result = JSON.parse(response.body)
puts result['verdict']
```

## Response

Every accepted link gets a `200`, even when it does not answer: `reachable` is then `false`. Read `verdict` first, then `reasons`.

| Field | Type | Description |
|---|---|---|
| `id` | string | Identifier of this check: `lkp_` followed by 26 characters. |
| `object` | string | Always `url`. |
| `input` | string | The `url` you sent, without surrounding spaces. |
| `url` | string | The URL that was checked, with `https://` added to a bare domain and any credentials removed. |
| `final_url` | string or null | The last URL of the chain that answered. `null` when nothing answered. |
| `host` | string | Host of `final_url`, or of `url` when nothing answered. |
| `domain` | string or null | Registrable domain of `host`, such as `example.co.uk` for `www.example.co.uk`. `null` for an IP address. |
| `tld` | string or null | Last label of `host`. `null` for an IP address. |
| `verdict` | string | `malicious` when one reason weighs 90 points or more, `suspicious` when the score reaches 30, `safe` otherwise. `safe` means no warning sign was found, not that the page is harmless. |
| `score` | integer | Sum of the points of every reason, capped at 100. |
| `reasons` | array of objects | Every signal found, strongest first. Empty for a link with no warning sign. |
| `reasons.code` | string | One of the codes listed below. |
| `reasons.severity` | string | `critical` (90 points or more), `high` (40 to 89), `medium` (20 to 39), `low` (1 to 19) or `info` (0). |
| `reasons.points` | integer | Points this signal adds to `score`. |
| `reasons.message` | string | A plain-English explanation you can show to a user. |
| `reachable` | boolean | `true` when at least one URL of the chain answered. |
| `http_status` | integer or null | HTTP status of `final_url`. |
| `https` | boolean | `true` when `final_url` was served over HTTPS. |
| `redirects` | array of objects | Every URL of the chain in order, at most 10 redirects after the first request. |
| `redirects.url` | string | The URL. |
| `redirects.host` | string | Its host. |
| `redirects.status` | integer or null | The HTTP status it answered. `null` when it did not answer or was not requested because its host is not public. |
| `redirects.via` | string | `request` for the URL sent, `redirect` for a `Location` header, `meta_refresh` for a meta refresh tag of the previous page. |
| `domain_age` | object or null | The registration of `domain` over RDAP. `null` for an IP address. |
| `domain_age.status` | string | `found`, `not_found` (the registry says the domain is not registered), `unsupported` (the TLD has no public RDAP server) or `error` (the registry did not answer). |
| `domain_age.created_at` | string or null | Registration date, ISO 8601. |
| `domain_age.age_days` | integer or null | Whole days since the registration. |
| `domain_age.registrar` | string or null | Name of the registrar. |
| `unicode_host` | string or null | `host` decoded from punycode, when it has `xn--` labels. |
| `punycode` | boolean | `true` when `host` has `xn--` labels. |
| `mixed_scripts` | boolean | `true` when a label mixes Latin letters with Cyrillic, Greek or another script. |
| `lookalike` | object or null | The strongest imitation of a brand domain found in the host or path. |
| `lookalike.brand` | string | The brand imitated. |
| `lookalike.official_domain` | string | Its main official domain. |
| `lookalike.technique` | string | `homoglyph`, `typosquat`, `brand_in_subdomain`, `brand_with_keyword`, `brand_other_tld`, `brand_in_domain` or `brand_in_path`. |
| `lookalike.similarity` | number | From 0 to 1: 1 for look-alike characters, 0.9 for a typo, down to 0.3 for a brand name in the path. |
| `official_brand` | string or null | The brand whose official domain this is, such as `GitHub` for `github.com`. |
| `risky_tld` | boolean | `true` for the 20 TLDs with the highest phishing domain score in the Interisle Consulting Group study of May 2025 to April 2026. |
| `shortener` | boolean | `true` when a URL of the chain is on a link shortener. |
| `free_hosting` | boolean | `true` when the final host is on a platform where anyone can publish a site. |
| `threats` | array of objects | Feed listings that match a host of the chain. |
| `threats.feed` | string | `destroylist`, `phishing_database` or `urlhaus`. |
| `threats.host` | string | The host the feed lists. |
| `threats.url` | string or null | The exact URL the feed lists, for feeds that list URLs. |
| `threats.match` | string | `host`, `parent_domain` (a parent domain of a chain host is listed) or `url`. |
| `threats.threat` | string | `phishing` or `malware_download`. |
| `threats.reference` | string or null | Link to the entry at the feed, when it has one. |
| `feeds` | array of objects | The feeds consulted, with `id`, `entries` (the number of entries loaded, `null` for a feed queried live) and `loaded_at`. |
| `credits_used` | integer | 1 with a live key, `0` with a test key or from the cache. |
| `cached` | boolean | `true` when the answer came from the 60-minute cache. |

```json title="Response"
{
  "id": "lkp_01M8CES6KC81Y0WGTHW7AKBQTJ",
  "object": "url",
  "input": "http://github.com",
  "url": "http://github.com/",
  "final_url": "https://github.com/",
  "host": "github.com",
  "domain": "github.com",
  "tld": "com",
  "verdict": "safe",
  "score": 0,
  "reasons": [],
  "reachable": true,
  "http_status": 200,
  "https": true,
  "redirects": [
    { "url": "http://github.com/", "host": "github.com", "status": 301, "via": "request" },
    { "url": "https://github.com/", "host": "github.com", "status": 200, "via": "redirect" }
  ],
  "domain_age": { "domain": "github.com", "status": "found", "created_at": "2007-10-09T18:20:50.000Z", "age_days": 6987, "registrar": "MarkMonitor Inc." },
  "unicode_host": null,
  "punycode": false,
  "mixed_scripts": false,
  "lookalike": null,
  "official_brand": "GitHub",
  "risky_tld": false,
  "shortener": false,
  "free_hosting": false,
  "threats": [],
  "feeds": [
    { "id": "destroylist", "entries": 234357, "loaded_at": "2026-11-26T17:34:44.558Z" },
    { "id": "phishing_database", "entries": 385332, "loaded_at": "2026-11-26T17:34:44.558Z" }
  ],
  "credits_used": 1,
  "cached": false
}
```

This answer was captured on 26 November 2026. The feed sizes change at every load.

## Reasons

Each reason adds its points to the score. The [link risk score](https://qelka.com/docs/link-risk-score) page lists the exact weight of every code, generated from the code that computes it.

| Code | When it is raised |
|---|---|
| `listed_threat_feed` | A host of the chain, or one of its parent domains, is listed in a phishing feed |
| `homoglyph_brand` | Look-alike characters imitate a brand domain, such as a Cyrillic letter in place of a Latin one |
| `typosquat_brand` | The domain is one typo away from a brand domain |
| `brand_in_subdomain` | A brand domain is used as a subdomain of another domain, such as `paypal.com.account-check.top` |
| `credentials_in_url` | The URL holds a user name or password, a trick that hides the real host |
| `domain_not_registered` | The registry says the domain is not registered |
| `brand_with_keyword` | A brand name is joined to a word such as `login`, `verify` or `refund` |
| `mixed_scripts` | A label mixes Latin letters with another script |
| `ip_address_host` | The host is a bare IP address |
| `new_domain` | The domain was registered less than 30 days ago |
| `brand_other_tld` | A brand name on a TLD the brand does not use |
| `punycode_host` | The host is written in punycode |
| `risky_tld` | The TLD is one of the 20 with the highest phishing domain score |
| `no_https` | The final page is served over plain HTTP |
| `young_domain` | The domain was registered less than 180 days ago |
| `brand_in_path` | A brand name in the path of an unrelated site |
| `brand_in_domain` | A brand name inside an unrelated domain |
| `url_shortener` | A link shortener hides the destination |
| `free_hosting` | The page is on a free hosting platform |
| `cross_domain_redirect` | The chain lands on another domain than the one sent |
| `long_redirect_chain` | The chain has many redirects |
| `suspicious_keywords` | The host holds words such as `login`, `verify` or `refund` |
| `deep_subdomains` | The host has many subdomain levels |
| `unreachable` | The link did not answer (0 points: information only) |
| `http_error` | The final page answered with an error (0 points: information only) |

## Threat feeds

| Feed | What it lists | License | Refresh |
|---|---|---|---|
| Destroylist | Phishing and scam domains | MIT | Every 6 hours |
| Phishing.Database | Active phishing domains | MIT | Every 6 hours |
| URLhaus | Malware distribution URLs, queried live | abuse.ch terms | Only when the account has a key configured |

A listing of a whole platform, such as a site builder, a link shortener or a brand's official domain, is ignored, so that one bad page does not flag every site on the platform. On free hosting platforms, only the site's own host is compared, never the platform domain. The [data sources page](https://qelka.com/data-sources) credits each feed.

## Errors

| Status | Type | When |
|---|---|---|
| `400` | `invalid_request` | The body is not JSON, `url` is missing or an unknown field is sent. |
| `422` | `unprocessable_input` | The link is not `http` or `https`, is not a valid host name, or points to a host that is not public. |
| `502` | `upstream_unavailable` | The phishing feeds could not be read. Nothing is billed; retry later. |

Errors are never billed. See [Errors](https://qelka.com/docs/errors) for the shape of an error body.

## Test mode

A test key fetches nothing and queries no feed or registry. A host containing `malicious` is listed in a feed, a domain containing `new` was registered days ago, one containing `unregistered` is not registered, one containing `unreachable` does not answer, and a known shortener redirects to `https://example.com/landing`. Look-alike, punycode, TLD and HTTPS signals are computed for real. See [Test mode](https://qelka.com/docs/test-mode).

## Related

- [Link risk score](https://qelka.com/docs/link-risk-score): the weight of every reason.
- [Signup fraud check](https://qelka.com/docs/api-reference/signup-check): score a whole sign-up in one call.
- [Domain lookup](https://qelka.com/docs/api-reference/domain): the full registration and DNS of a domain.
- Free tools: [link safety checker](https://qelka.com/tools/link-safety-checker), [phishing link checker](https://qelka.com/tools/phishing-link-checker), [website legit checker](https://qelka.com/tools/website-legit-checker) and [scam checker](https://qelka.com/tools/scam-checker).
