---
title: "Website Safety API"
method: GET
path: "/api/v1/domain/safety"
tags: ["Domain"]
---

# Website Safety API

`GET /api/v1/domain/safety`

## Request

- Base URL: `https://xranks.com`
- URL: `https://xranks.com/api/v1/domain/safety`
- Auth: API key in header `Authorization`

Check the reputation of a domain before you link to it, send traffic to it or let users visit it. The API returns one of four verdicts: safe, warning, danger or unknown.

Use cases: Screen user-submitted links; Keep ads off risky sites; Flag risky domains in a list.

## Query parameters

- `domain` string, required

## Response `200`

Data for the domain. May instead be an Error object (HTTP 200) when the domain is unknown.

- union
  - SafetyResponse
    - `domain` string, required: The domain you asked for.
    - `safety` string, required: "safe", "warning", "danger", or "unknown" when there is no verdict.
  - Error
    - `error` string, required: Human-readable message.
    - `code` 'missing_api_key' | 'invalid_api_key' | 'inactive_api_key' | 'quota_exceeded' | 'invalid_domain' | 'domain_not_found' | 'no_data' | 'unknown_service' | 'too_many_domains' | 'invalid_request': Stable machine-readable code.

## Other responses

- `401`: Missing, invalid or inactive API key.
- `429`: Quota used up for the rolling 30 days (or the batch needs more lookups than are left).

---

[API](https://skmtc.dev/xranks/apis/xranks-domain-data-api.md) · [All operations](https://skmtc.dev/xranks/apis/xranks-domain-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/xranks/apis/xranks-domain-data-api/revisions/c1c3388c4b34?raw)
