API v1.0 — Production Ready

API Documentation

Classify domains and URLs into IAB taxonomy categories and Web Filtering categories using our enterprise-grade API.

120M+
Domains
99.9%
Uptime SLA
<50ms
Avg Latency
1,000
Batch Size

Overview

The URL Categorization API enables you to classify any domain or URL into IAB taxonomy categories (up to 4-tier hierarchical paths) and Web Filtering categories in a single request. Our database covers 120M+ domains, representing over 99% of active web traffic.

Dual Classification
IAB taxonomy + Web Filtering categories in one call
Instant Results
Sub-50ms response time for single lookups
Batch Processing
Classify up to 1,000 domains per request
Enterprise Ready
99.9% SLA, credit-based billing, full audit trail

Authentication

All API requests require an API key. You can pass your key using either method below:

Option 1: HTTP Header (Recommended)

Pass your API key in the X-API-Key header for maximum security.

HTTP
GET /api/v1/classify?url=google.com
Host: urlcategorizationdatabase.com
X-API-Key: YOUR_API_KEY

Option 2: Query Parameter

Pass your API key as the api_key query parameter.

HTTP
GET /api/v1/classify?url=google.com&api_key=YOUR_API_KEY

Get an API key by signing up for a free trial or choosing a plan from our pricing page.

Base URL

All API endpoints are relative to the following base URL:

URL
https://urlcategorizationdatabase.com/api/v1

Single Domain Lookup

GET /api/v1/classify Classify a single domain or URL

Parameters

ParameterTypeRequiredDescription
url string Required The domain name or URL to classify (e.g. google.com, blog.example.com)
api_key string Optional API key (alternative to X-API-Key header)

Example Request

curl
curl -X GET "https://urlcategorizationdatabase.com/api/v1/classify?url=google.com" \
  -H "X-API-Key: YOUR_API_KEY"

Example Response

JSON
{
  "sni": "google.com",
  "root_domain": "google.com",
  "category": "Technology & Computing > Computing > Internet > Search",
  "multiple_categories": "Technology & Computing > Computing > Internet > Search (1.0)",
  "web_filtering_category": "AI / LLM Tools|Search Engines & Platforms|Streaming Media",
  "method": "root_domain_direct",
  "confidence": 1.0,
  "credits": {
    "used_this_request": 1,
    "remaining": 9999,
    "total": 10000
  }
}

Batch Classification

POST /api/v1/classify Classify up to 1,000 domains in a single request

Request Body

FieldTypeRequiredDescription
urls array[string] Required Array of domains/URLs to classify (max 1,000 per request)

Example Request

curl
curl -X POST "https://urlcategorizationdatabase.com/api/v1/classify" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["google.com", "amazon.com", "bbc.co.uk", "github.com"]
  }'

Example Response

JSON
{
  "results": [
    {
      "sni": "google.com",
      "category": "Technology & Computing > Computing > Internet > Search",
      "web_filtering_category": "Search Engines & Platforms|AI / LLM Tools",
      "confidence": 1.0
    },
    {
      "sni": "amazon.com",
      "category": "Shopping",
      "web_filtering_category": "Shopping|Business|Streaming Media",
      "confidence": 1.0
    }
  ],
  "count": 4,
  "credits": {
    "used_this_request": 4,
    "remaining": 9996,
    "total": 10000
  }
}

Health Check

GET /api/v1/health Check API service status (no authentication required)
curl
curl -s "https://urlcategorizationdatabase.com/api/v1/health"

Response Format

All responses are JSON. Each classification result includes the following fields:

sni string The queried domain (normalized to lowercase)
root_domain string Extracted root domain (e.g. "google.com" from "mail.google.com")
category string Primary IAB taxonomy category (hierarchical: Tier1 > Tier2 > Tier3 > Tier4)
multiple_categories string Semicolon-separated list of all matching IAB categories with confidence scores
web_filtering_category string Pipe-separated web filtering categories (e.g. "Shopping|Business|Streaming")
method string Classification method used (see Classification Methods below)
confidence float Confidence score from 0.0 to 1.0
credits object Credit usage info: used_this_request, remaining, total

Classification Methods

The method field indicates how the domain was classified:

MethodDescriptionConfidence
root_domain_directDomain found directly in our 120M+ domain database1.0
root_domain_representsSubdomain inherits category from its root domain1.0
sni_multi_lookupExact match with multi-category data1.0
extensionTLD/extension-based statistical inference0.5 - 1.0
not_foundDomain not in database0.0

Rate Limits & Quotas

API usage is credit-based. Each domain lookup consumes one credit. Your monthly allocation depends on your plan:

PlanPriceMonthly CreditsBatch Size
Free TrialFree100up to 100
Pro$99/mo10,000up to 1,000
Pro Plus$249/mo250,000up to 1,000
Advanced$499/mo500,000up to 1,000
Advanced Plus$999/mo1,000,000up to 1,000

Each response includes a credits object showing your remaining balance:

JSON
"credits": {
  "used_this_request": 1,
  "remaining": 9999,
  "total": 10000
}

Error Handling

The API uses standard HTTP status codes. Error responses include a JSON body with a detail field:

200 Successful classification
400 Bad request (missing parameters)
401 Invalid or missing API key
429 Credit limit exceeded
500 Internal server error
502 Service temporarily unavailable

Error Response Example

JSON
{
  "detail": "API credit limit exceeded. Please upgrade your plan.",
  "total_credits": 10000,
  "used": 10000,
  "remaining": 0
}

Code Examples

Python

Python
import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://urlcategorizationdatabase.com/api/v1"

# Single domain lookup
response = requests.get(
    f"{BASE_URL}/classify",
    params={"url": "google.com"},
    headers={"X-API-Key": API_KEY}
)
result = response.json()
print(f"IAB Category: {result['category']}")
print(f"Web Filtering: {result['web_filtering_category']}")
print(f"Credits remaining: {result['credits']['remaining']}")

# Batch classification (up to 1,000 domains)
domains = ["google.com", "amazon.com", "bbc.co.uk", "github.com"]
response = requests.post(
    f"{BASE_URL}/classify",
    json={"urls": domains},
    headers={"X-API-Key": API_KEY}
)
for r in response.json()["results"]:
    print(f"{r['sni']}: {r['category']}")

JavaScript / Node.js

JavaScript
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://urlcategorizationdatabase.com/api/v1';

// Single domain lookup
const response = await fetch(
  `${BASE_URL}/classify?url=google.com`,
  { headers: { 'X-API-Key': API_KEY } }
);
const data = await response.json();
console.log('IAB Category:', data.category);
console.log('Web Filtering:', data.web_filtering_category);

// Batch classification
const batchResponse = await fetch(`${BASE_URL}/classify`, {
  method: 'POST',
  headers: {
    'X-API-Key': API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    urls: ['google.com', 'amazon.com', 'bbc.co.uk']
  })
});
const results = await batchResponse.json();
results.results.forEach(r => console.log(`${r.sni}: ${r.category}`));

PHP

PHP
<?php
$apiKey = 'YOUR_API_KEY';
$baseUrl = 'https://urlcategorizationdatabase.com/api/v1';

// Single domain lookup
$ch = curl_init($baseUrl . '/classify?url=google.com');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['X-API-Key: ' . $apiKey],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);

echo "IAB Category: " . $response['category'] . "\n";
echo "Web Filtering: " . $response['web_filtering_category'] . "\n";
echo "Credits left: " . $response['credits']['remaining'] . "\n";

cURL

Bash
# Single domain
curl -s "https://urlcategorizationdatabase.com/api/v1/classify?url=google.com" \
  -H "X-API-Key: YOUR_API_KEY" | python3 -m json.tool

# Batch (up to 1,000 domains)
curl -s -X POST "https://urlcategorizationdatabase.com/api/v1/classify" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["google.com", "amazon.com"]}' | python3 -m json.tool

SDKs & Libraries

The API follows REST conventions and returns JSON, making it compatible with any HTTP client. Here are recommended libraries for popular languages:

🐍

Python

pip install requests — use the requests library with our REST endpoints.

Node.js

Use native fetch (Node 18+) or axios with our REST API.

🐘

PHP

Use built-in curl or Guzzle for HTTP requests.

Ruby

Use net/http or httparty gem for simple integration.

Go

Use the standard net/http package for API calls.

Java

Use HttpClient (Java 11+) or OkHttp library.

Need help integrating? Contact us at [email protected]

Ready to Get Started?

Sign up for a free trial and start classifying domains in minutes.

Start Free Trial View Pricing