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.
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
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| 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
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| 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
curl curl -s "https://urlcategorizationdatabase.com/api/v1/health"
Response Format
All responses are JSON. Each classification result includes the following fields:
Classification Methods
The method field indicates how the domain was classified:
| Method | Description | Confidence |
|---|---|---|
| root_domain_direct | Domain found directly in our 120M+ domain database | 1.0 |
| root_domain_represents | Subdomain inherits category from its root domain | 1.0 |
| sni_multi_lookup | Exact match with multi-category data | 1.0 |
| extension | TLD/extension-based statistical inference | 0.5 - 1.0 |
| not_found | Domain not in database | 0.0 |
Rate Limits & Quotas
API usage is credit-based. Each domain lookup consumes one credit. Your monthly allocation depends on your plan:
| Plan | Price | Monthly Credits | Batch Size |
|---|---|---|---|
| Free Trial | Free | 100 | up to 100 |
| Pro | $99/mo | 10,000 | up to 1,000 |
| Pro Plus | $249/mo | 250,000 | up to 1,000 |
| Advanced | $499/mo | 500,000 | up to 1,000 |
| Advanced Plus | $999/mo | 1,000,000 | up 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:
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]