# TLD (Top-Level Domain) API
> Every top-level domain in the IANA root zone as an API — the authoritative list a registrar, domain validator or analytics tool needs. For each TLD: whether it is a country-code TLD (ccTLD), a generic TLD (gTLD) or an internationalized (IDN) domain, its A-label, its Unicode form (e.g. xn--p1ai resolves to .рф) and, for ccTLDs, the country it belongs to. Validate a TLD or whole domain, find a country's ccTLD, filter by type, search, or list the entire root zone. Sourced from IANA's official tlds-alpha-by-domain.txt and served from memory — always fast.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/tld-api/..."
```

## Pricing
- **Free** (Free) — 30,000 calls/Mo, 3 req/s
- **Starter** ($4/Mo) — 300,000 calls/Mo, 10 req/s
- **Pro** ($11/Mo) — 1,500,000 calls/Mo, 25 req/s
- **Mega** ($28/Mo) — 7,000,000 calls/Mo, 60 req/s

## Endpoints

### Lookup

#### `GET /v1/country` — ccTLD for a country

**Parameters:**
- `code` (query, required, string) — Country name or ISO 3166-1 alpha-2 code Example: `de`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tld-api/v1/country?code=de"
```

**Response:**
```json
{
    "data": {
        "tlds": [
            {
                "idn": false,
                "tld": "de",
                "type": "cctld",
                "country": "Germany",
                "unicode": "de"
            }
        ],
        "count": 1,
        "country": "Germany"
    },
    "meta": {
        "timestamp": "2026-06-08T18:25:11.849Z",
        "request_id": "baa3b79c-9838-435d-a8ea-343fae02c371"
    },
    "status": "ok",
    "message": "Country ccTLD retrieved successfully",
    "success": true
}
```

#### `GET /v1/tld` — Look up / validate a TLD

**Parameters:**
- `tld` (query, required, string) — A TLD or full domain Example: `com`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tld-api/v1/tld?tld=com"
```

**Response:**
```json
{
    "data": {
        "tld": {
            "idn": false,
            "tld": "com",
            "type": "gtld",
            "country": null,
            "unicode": "com"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:25:11.967Z",
        "request_id": "f2bf4649-d0a2-4701-9519-4e8b9a22a9f2"
    },
    "status": "ok",
    "message": "TLD retrieved successfully",
    "success": true
}
```

### List

#### `GET /v1/list` — List TLDs (optionally by type)

**Parameters:**
- `type` (query, optional, string) — Filter: cctld, gtld or idn Example: `cctld`
- `limit` (query, optional, string) — Page size (1-2000) Example: `100`
- `offset` (query, optional, string) — Offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tld-api/v1/list?type=cctld&limit=100&offset=0"
```

**Response:**
```json
{
    "data": {
        "tlds": [
            {
                "idn": false,
                "tld": "ac",
                "type": "cctld",
                "country": "Ascension Island",
                "unicode": "ac"
            },
            {
                "idn": false,
                "tld": "ad",
                "type": "cctld",
                "country": "Andorra",
                "unicode": "ad"
            },
            {
                "idn": false,
                "tld": "ae",
                "type": "cctld",
                "country": "United Arab Emirates",
                "unicode": "ae"
            },
            {
                "idn": false,
                "tld": "af",
                "type": "cctld",
                "country": "Afghanistan",
                "unicode": "af"
            },
            {
                "idn": false,
                "tld": "ag",
                "type": "cctld",
                "country": "Antigua & Barbuda",
                "unicode": "ag"
            },
            {
                "idn": false,
                "tld": "ai",
                "type": "cctld",
                "country": "Anguilla",
                "unicode": "ai"
            },
            {
                "idn": false,
                "tld": "al",
                "type": "cctld",
                "country": "Albania",
                "unicode": "al"
            },
            {
                "idn": false,
                "tld": "am",
                "ty
…(truncated, see openapi.json for full schema)
```

### Search

#### `GET /v1/search` — Search TLDs by label or country

**Parameters:**
- `q` (query, required, string) — Search query Example: `app`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tld-api/v1/search?q=app"
```

**Response:**
```json
{
    "data": {
        "tlds": [
            {
                "idn": false,
                "tld": "app",
                "type": "gtld",
                "country": null,
                "unicode": "app"
            },
            {
                "idn": false,
                "tld": "apple",
                "type": "gtld",
                "country": null,
                "unicode": "apple"
            },
            {
                "idn": false,
                "tld": "zappos",
                "type": "gtld",
                "country": null,
                "unicode": "zappos"
            }
        ],
        "count": 3,
        "query": "app",
        "total": 3
    },
    "meta": {
        "timestamp": "2026-06-08T18:25:12.228Z",
        "request_id": "9149a816-06cf-413d-8165-2fd27b674b5b"
    },
    "status": "ok",
    "message": "Search results retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tld-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "idn": 151,
        "gtld": 1038,
        "cctld": 248,
        "service": "tld-api",
        "endpoints": {
            "GET /v1/tld": "Look up / validate a TLD (tld=, e.g. com — also accepts a full domain).",
            "GET /v1/list": "List TLDs, optionally by type (type=cctld|gtld|idn, limit, offset).",
            "GET /v1/meta": "This document.",
            "GET /v1/search": "Search TLDs by label or country (q=).",
            "GET /v1/country": "ccTLD for a country (code=, e.g. de or Germany)."
        },
        "total_tlds": 1437,
        "description": "IANA root-zone TLD reference: every current top-level domain with its type (ccTLD / gTLD / IDN), A-label, Unicode form and, for ccTLDs, the country. Source: IANA tlds-alpha-by-domain.txt. No key.",
        "iana_version": "2026060800"
    },
    "meta": {
        "timestamp": "2026-06-08T18:25:12.326Z",
        "request_id": "1c7ed8c3-41df-4ba3-9b52-7c019bab1016"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/tld-api
OpenAPI spec: https://www.oanor.com/api/tld-api/openapi.json
