How to Get the IAB Category for a Website
You need to automatically assign IAB categories to websites so you can block risky content, enrich new signups with standardized topics, or audit where ads are running. By the end of this guide, you will be able to call the Klazify IAB endpoint, extract the IAB category codes from the response, and plug the result into your filtering or enrichment pipeline.
Why Klazify is the best fit for assigning IAB categories at scale
Getting IAB categories right determines whether you block or allow traffic, approve publishers, or route leads correctly. Klazify focuses on end-to-end domain understanding so you can rely on its IAB mapping in production workflows.
- Accurate category mapping using AI: Klazify analyzes page content, not just metadata, leading to precise IAB mapping even for niche or mixed-content sites.
- Global coverage: Multilingual analysis lets you classify international sites consistently against the same IAB taxonomy.
- Real-time classification: Categories are computed from live content, reducing drift from outdated lists.
- IAB taxonomy alignment: Results map to industry-standard IAB categories, letting you align targeting and brand safety policies to a known standard.
- Simple API integration: A straightforward REST design works well in edge proxies, data pipelines, and serverless backends.
- Compliance and filtering: Granular categories support strict policy enforcement without overblocking.
If you’re building ad placement controls, parental filtering, or CRM enrichment based on the IAB taxonomy, Klazify’s response structure makes it easy to detect and act on relevant categories.
What you will build
You will:
- Send a URL to Klazify’s IAB endpoint and receive its IAB category codes and names.
- Parse the categories array to collect the IAB keys present on each item.
- Map the returned IAB codes to your own policy rules (block, allow, score) or enrichment fields.
- Add caching and batching considerations for production traffic.
Step 1 — Get an API key
Create a free account to obtain your API key. The Starter plan is $39.99/mo with a 7-day trial, and failed or unreachable calls are not billed. Keep your key secure and never expose it in client-side code.
Step 2 — Request IAB categories for a URL
Use the IAB-focused endpoint. This call accepts a JSON payload with the URL you want to classify and returns categories where IAB IDs are present as sibling keys alongside the category name.
curl -X POST "https://www.klazify.com/api/domain_iab_categories" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://cbsnews.com"}'
Notes:
- HTTP method: POST
- Auth: Bearer token in the Authorization header
- Body: JSON with the "url" you want to classify
- IAB IDs appear as sibling keys on each category object (for example, IAB12 or IAB-324-XXXXXX). There is no top-level IAB object.
Step 3 — Understand the response structure
Below is the official sample format from the categorization API. It illustrates the categories array, where a category may include IAB keys as siblings. Use this structure to guide your parsing, and apply the same logic to the dedicated IAB endpoint responses.
{
"domain": {
"categories": [
{
"confidence": 0.92,
"name": "/Computers & Electronics/Consumer Electronics",
"IAB-632-596": "Consumer Electronics/Technology & Computing/Consumer Electronics"
},
{
"confidence": 0.89,
"name": "/Internet & Telecom/Mobile & Wireless/Mobile Phones"
}
],
"social_media": null,
"logo_url": "https://klazify.s3.amazonaws.com/2110787991611585019600ed5fb1d1300.04730104.png"
},
"success": true,
"objects": {
"company": {
"url": "https://www.apple.com/",
"name": "Apple",
"city": "Cupertino",
"stateCode": "CA",
"countryCode": "US",
"employeesRange": "100K+",
"revenue": 274515000000,
"raised": null,
"tags": [
"E-commerce",
"Consumer Electronics",
"Mobile",
"B2C"
],
"tech": [
"omniture_adobe_analytics",
"atlassian_confluence",
"successfactors",
"apache_apex",
"talend",
"oracle_peoplesoft",
"salesforce",
"stripe",
"dell_boomi_atomsphere",
"gigya",
"sage_50cloud",
"quickbooks",
"webmethods",
"apache_tomcat",
"alteryx",
"tibco_rendezvous",
"atlassian_jira",
"..."
]
}
},
"domain_registration_data": {
"domain_age_date": "1987-02-19",
"domain_age_days_ago": "13026",
"domain_expiration_date": "2030-02-20",
"domain_expiration_days_left": "123"
},
"similar_domains": [
"bestbuy.com",
"icloud.com",
"microsoft.com",
"macrumors.com",
"google.com",
"samsung.com",
"twitter.com",
"hp.com",
"bhphotovideo.com",
"dell.com"
]
}
Key fields to use for IAB policy and enrichment:
- domain.categories: Array of category objects. Each item has:
- name: Human-readable category path.
- confidence: Floating-point confidence score you can use for thresholds.
- IAB… keys: One or more IAB identifiers as sibling fields (e.g., IAB-632-596) with their taxonomy path value. Detect keys that start with "IAB" to collect them.
- domain.logo_url: Useful for UI enrichment in admin consoles or CRMs.
- objects.company: Additional company context when you call the main categorization endpoint. You can join this with IAB categories to power lead scoring or routing.
- domain_registration_data: Dates and counters to support trust decisions or prioritization.
- similar_domains: Helpful for expanding blocklists or building lookalike allowlists.
Step 4 — Parse IAB categories in code
The example below calls the IAB endpoint, extracts the categories array, then scans each category for keys that start with "IAB". It returns a flattened list of IAB IDs and paths you can feed into your rules engine.
import os
import json
import requests
API_KEY = os.getenv("KLAZIFY_API_KEY", "YOUR_API_KEY")
ENDPOINT = "https://www.klazify.com/api/domain_iab_categories"
def get_iab_categories(url):
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
payload = {"url": url}
resp = requests.post(ENDPOINT, headers=headers, json=payload, timeout=15)
resp.raise_for_status()
data = resp.json()
results = []
# domain.categories is a list of category objects
for cat in (data.get("domain", {}) or {}).get("categories", []) :
# extract confidence and human-friendly name
name = cat.get("name")
confidence = cat.get("confidence")
# any key that starts with IAB is an IAB mapping
for k, v in cat.items():
if k.startswith("IAB"):
results.append({
"iab_id": k,
"iab_path": v,
"name": name,
"confidence": confidence
})
return results, data
if __name__ == "__main__":
iab_results, raw = get_iab_categories("https://example.com")
print(json.dumps(iab_results, indent=2))
How to act on these fields:
- iab_id: Your primary policy key. Use it for block/allow lookups.
- iab_path: Useful for analytics or exporting taxonomy paths to BI.
- name: A non-IAB path you can store for human review or UI display.
- confidence: Apply thresholds; e.g., require at least one category above a minimum value before enforcing a block.
Integrate into your pipeline
Block/allow at the edge
At a proxy or gateway, call the IAB endpoint on cache miss and store category results keyed by registrable domain. On subsequent requests, enforce allow/deny instantly from cache. Use the confidence score and your business rules to avoid overblocking.
Enrich a signup or domain intake
When a publisher or lead submits a website, call the IAB endpoint to store iab_id(s) alongside the account. Use the result to power routing, compliance checks, or targeting groups. Optionally call the main categorization endpoint for logos, company info, and similar domains to further enrich profiles.
Audit ad placements
For a list of landing pages, run a batch job that requests IAB categories and flags placements that violate brand safety policies. Export iab_id, iab_path, and confidence to your data warehouse for reporting.
Operational details that save time
- Caching: Cache by effective domain (eTLD+1) and, for high-variance sites, consider caching by full URL for page-level classification. Set a TTL that matches your review cadence; refresh on cache miss or periodically for top domains.
- Batching: For large lists, run asynchronous workers that read domains from a queue and write results to a key-value store. Parallelize within your concurrency budget.
- Handling unknown or new domains: If categories are sparse or confidence is low, retry later or fall back to a manual review queue. You can also examine similar_domains from the general categorization endpoint to suggest a provisional policy.
- Custom taxonomy mapping: Maintain a lookup table mapping from iab_id to your internal policy groups. Keep it versioned so you can quickly roll back changes.
- Rate limits: Design for backoff and retry with jitter. Queue requests and throttle workers so you do not exceed your plan’s throughput. Consult the API docs for plan-specific details.
- Resilience: Time out requests, treat network failures as “defer decision” rather than “block,” and reprocess failed items. Failed or unreachable calls are not billed.
- Observability: Log iab_id(s), confidence, and outcome (blocked/allowed) per decision. Track cache hit rate and mean latency.
Comparing common integration patterns
| Pattern | Trigger | Input | Output | Primary Action |
|---|---|---|---|---|
| Edge filtering | HTTP request to external site | Requested domain or URL | IAB IDs + confidence from cache/API | Allow/Block decision |
| Signup enrichment | New domain submitted | Submitted URL | IAB IDs + optional logo/company from categorization endpoint | Route lead, compliance checks, targeting group assignment |
| Batch audit | Scheduled job | List of landing URLs | IAB IDs + paths + confidence written to warehouse | Flag violations, generate reports, update allowlists |
When to also call the general categorization endpoint
The IAB endpoint gives you the IAB mapping directly. If you also need broader enrichment, call the main categorization endpoint to obtain fields such as logo_url, objects.company details, domain_registration_data, and similar_domains (illustrated in the official sample). This lets you:
- Show logos and category names in review tools or admin consoles.
- Join IAB categories with company size, location, or tags to prioritize reviews.
- Expand a watchlist using similar_domains.
Refer to the Documentation for the full field list and request details across endpoints.
Security and data handling
- Do not expose your API key in client-side code. Call Klazify from your server or backend jobs.
- Log only what you need for debugging and audits. Mask tokens in logs.
- If user input provides the URL, normalize and validate it before sending to the API.
Deployment checklist
- Implement an HTTP client with timeouts and retries using exponential backoff.
- Parse categories by scanning for keys that start with "IAB". Do not rely on a single fixed key name.
- Store iab_id, iab_path, name, confidence, and retrieval timestamp.
- Apply a confidence threshold that fits your risk tolerance.
- Cache per domain and set TTLs; implement a warmup job for your top N domains.
- Add observability: success rate, latency, cache hit rate, and decision metrics.
FAQ
-
Where are the IAB categories in the response?
Inside domain.categories. Each item can include one or more IAB keys as sibling fields (any key that starts with “IAB”), alongside name and confidence. -
Do I need a separate endpoint for IAB categories?
Use the dedicated IAB endpoint for direct IAB mapping. You can also call the general categorization endpoint if you need broader enrichment like company details, logo_url, or similar_domains. -
How should I handle low-confidence results?
Apply a minimum confidence threshold, defer decisions to a review queue, or recheck later. Logging and manual overrides help for edge cases. -
How do I map Klazify’s IAB codes to my own taxonomy?
Maintain a lookup table from iab_id to your internal category or policy group. Keep the table versioned and test new mappings against a sample set before rollout. -
What happens if the request fails?
Implement retries with backoff and treat failed lookups as “no decision” rather than an automatic block. Failed or unreachable calls are not billed.
Ready to implement IAB categorization in your stack? Create your account and get an API key to start classifying domains today: Register. For endpoint details and response fields, see the MCP and full Documentation on klazify.com.
Ready to use Klazify?
Start classifying websites, enriching company data, and exploring web intelligence.
Get Started Free