IAB Category API: Get the IAB Category for a Website
You need to reliably identify a website’s IAB category so you can make a decision in your system: block a class of content for brand safety, enrich a lead with industry tags, or audit ad placements. In this walkthrough you’ll implement a production-ready path to fetch IAB categories for any URL, interpret the response fields you’ll actually use, and wire it into your pipeline with caching, batching, and fallback behavior.
Why Klazify fits IAB-based classification for real pipelines
When your workflow depends on IAB categories, you need a classifier that understands full-page content, works across languages, returns up-to-date categories, and is straightforward to integrate. Klazify is optimized for IAB-mapped classification that developers can plug into ad tech, filtering, and enrichment jobs with minimal glue code.
- Accurate Website Categorization Using AI: The API analyzes page content rather than just DNS or metadata. That matters when you’re differentiating nuanced editorial or commercial intent that drives IAB mapping.
- Global Coverage: Classifies multilingual content so you don’t need special handling for non-English websites.
- Real-Time Classification: Returns fresh analysis so your brand safety and targeting rules keep pace with content updates.
- Industry-Level Categories: Uses IAB taxonomy with granular, industry-standard categories designed for advertising, brand safety, and contextual targeting.
- Simple API Integration: A clean REST interface works for sync lookups, batch jobs, and enrichment queues.
- Compliance and Filtering: Enables precise allow/block rules for sensitive categories without bolting on custom parsing logic.
Starter is $39.99/mo with a 7-day trial, and failed or unreachable calls are not billed. You can explore endpoints and start testing with a free account via the Register page and browse the full Documentation.
The workflow you’ll implement
By the end of this guide you will:
- Call the IAB category endpoint with a URL.
- Read the category array and the IAB identifiers (available as sibling keys on each category object).
- Map IAB categories into your policy engine (allow/block) or enrichment schema.
- Cache per-domain results with sensible TTLs and retries for new or unknown domains.
- Handle batching and throughput constraints at a high level.
Endpoint for IAB categories
Use the dedicated IAB category endpoint to classify a URL and retrieve IAB-mapped categories:
- Method: POST
- URL: https://www.klazify.com/api/domain_iab_categories
- Auth: Bearer token
- Body (JSON): {"url": "https://example.com"}
Note on structure: IAB identifiers appear as sibling keys on each category object. There is no IAB_categories object in the response. You’ll read the category name and any IAB-... keys present on that category.
Copy-pasteable curl request
curl -X POST "https://www.klazify.com/api/domain_iab_categories" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
--data '{"url":"https://cbsnews.com"}'
Replace YOUR_API_KEY with your token. This request returns a JSON document containing a categories array. Each entry provides a category name, confidence score, and may include one or more IAB identifier fields like IAB-632-596.
The official JSON response format, and what to use from it
Below is the official example payload. Use this to understand the structure you’ll parse in your own integration. The categories array and the IAB identifier fields are the pieces you’ll plug into your policies and analytics.
{
"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"
]
}
What to use:
- domain.categories: Your primary signal. Each object includes:
- name: A hierarchical category path you can use for coarse filtering.
- confidence: A float to drive thresholds (e.g., require >= 0.8 to auto-allow/block).
- IAB-...: One or more sibling keys that carry IAB identifiers mapped to the category. Extract any field names that start with "IAB" to capture IAB taxonomy strings or codes.
- domain.logo_url: Useful for UI enrichment or CRM profiles.
- objects.company: Optional enrichment data that can power sales intelligence, lead scoring, or display in admin consoles.
- domain_registration_data: Timestamps in ISO-8601 date format and integer-like strings for age/TTL; helpful for trust heuristics and fraud rules.
- similar_domains: A lightweight list to expand audits or build adjacency intelligence.
Python example: extracting IAB categories and applying a decision
import os
import requests
API_KEY = os.getenv("KLAZIFY_API_KEY", "YOUR_API_KEY")
ENDPOINT = "https://www.klazify.com/api/domain_iab_categories"
def classify_url(url):
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
payload = {"url": url}
resp = requests.post(ENDPOINT, json=payload, headers=headers, timeout=30)
resp.raise_for_status()
data = resp.json()
return data
def extract_iab_categories(data):
out = []
categories = (data.get("domain") or {}).get("categories") or []
for cat in categories:
# name and confidence are stable keys
name = cat.get("name")
conf = cat.get("confidence")
# IAB identifiers appear as sibling keys on the category object
iab_fields = {k: v for k, v in cat.items() if k.startswith("IAB")}
out.append({
"name": name,
"confidence": conf,
"iab": iab_fields # may be empty if not returned for a category
})
return out
def should_block(iab_entries, min_conf=0.8, blocked_iab_prefixes=None):
# Example policy: block if any IAB path starts with a restricted prefix
if blocked_iab_prefixes is None:
blocked_iab_prefixes = []
for entry in iab_entries:
if (entry["confidence"] or 0) < min_conf:
continue
for _, iab_value in (entry["iab"] or {}).items():
if any(str(iab_value).startswith(p) for p in blocked_iab_prefixes):
return True
return False
if __name__ == "__main__":
url_to_check = "https://example.com"
data = classify_url(url_to_check)
iab_entries = extract_iab_categories(data)
# Example: treat "Consumer Electronics" subtree as allowed; block nothing here
decision = "block" if should_block(iab_entries, min_conf=0.8, blocked_iab_prefixes=["SensitiveCategory"]) else "allow"
print({"url": url_to_check, "decision": decision, "iab_entries": iab_entries})
This script:
- Calls the IAB endpoint and parses domain.categories.
- Collects any IAB-... keys present per category into a single iab map.
- Implements a simple policy function to demonstrate how you’d check prefixes or exact matches in your own block/allow lists.
How to act on the result in real systems
- Brand safety filtering: Keep a table of IAB paths or IDs you allow or block. Extract IAB-... fields and compare to your policy, gated by confidence.
- Ad placement auditing: Log the IAB categories next to each impression URL. Aggregate by publisher or campaign to verify targeting and compliance.
- Lead enrichment: Write the top category names and IAB identifiers to CRM fields. Add domain.logo_url for sales views.
- Content filtering: Use the hierarchical name for quick rollups (e.g., everything under “/Internet & Telecom”). Use IAB-... for standardized reporting.
Mapping to your taxonomy
Many teams maintain an internal taxonomy. To map Klazify output:
- Normalize: Convert category name and IAB strings to lowercase and trim whitespace for matching.
- Prefer IAB IDs: Match first on IAB-... values, which are stable and designed for ad tech interoperability.
- Fallback to name: If no IAB field is present for a category entry, map using name with longest-prefix logic (e.g., match highest-depth path first).
- Create a lookup table: InternalCategory → {iab_prefixes: [...], klazify_names: [...]}. Deploy this as a static artifact in your ETL or edge filter.
Batching, throughput, and retries
Throughput needs vary by workload. If you’re processing large lists of domains:
- Batch orchestration: Parallelize POST requests with bounded concurrency to avoid exceeding rate limits. Capture and retry transient 5xx/timeout responses with exponential backoff.
- Deduplicate per run: Hash or sort-unique your input URLs before calling the API to reduce cost and latency.
- Queue architecture: For continuous flows (signups, ad scans), put URLs into a durable queue, process via worker pools, and persist results for reuse.
For precise limits and recommended patterns, refer to the Documentation.
Caching and freshness
Domain-level categories generally change slower than page-level content. Practical guidance:
- Cache key: Use the registrable domain (e.g., example.com) or the normalized URL if you require page-level analysis.
- Suggested TTLs:
- Domain-level IAB category: hours to days, depending on your risk tolerance.
- New or volatile domains: shorter TTL initially; extend if stable over time.
- Stale reads: Serve cached results on soft failures and schedule a background refresh to keep UX responsive.
- Validation: If your decisioning is high-stakes, require a minimum confidence and trigger re-checks when results drift.
Handling new or unknown domains
Not every domain will return a fully populated set of fields immediately. Implement these fallbacks:
- No categories returned: Assign “Unknown” internally, enqueue for re-crawl later, and avoid hard failure.
- Low confidence: If confidence is below your threshold, route to a manual review queue or apply conservative policy defaults.
- Network errors: Since failed or unreachable calls are not billed, retry with backoff. On repeated failure, serve cached results or neutral policy.
Comparing fields to decisions you’ll make
| Field | What it tells you | Common Actions |
|---|---|---|
| domain.categories[].name | Hierarchical category path | Roll-up matching for allow/block; analytics grouping |
| domain.categories[].confidence | Model certainty for category | Threshold gating (e.g., require 0.8+ for automatic decisions) |
| domain.categories[].IAB-... | IAB taxonomy mapping | Standardized reporting, ad targeting, brand safety policy checks |
| domain.logo_url | Logo asset URL | CRM enrichment, dashboards, review tooling |
| objects.company.* | Company profile and tech signals | Lead scoring, segmentation, sales ops enrichment |
| domain_registration_data.* | Creation/expiration dates and age | Risk scoring, fraud heuristics, recheck cadence |
| similar_domains[] | Adjacent sites | Coverage expansion and competitive/contextual analysis |
End-to-end example decisions
Blocking a category for brand safety
- Call the endpoint with the landing page URL from an impression log.
- Collect all IAB-... fields from the categories list where confidence ≥ 0.8.
- Check against your blocklist (exact matches or prefix matches for entire subtrees).
- Block immediately for positive matches; otherwise allow. Cache the result keyed by domain for N hours.
Enriching a signup form with industry tags
- When a user enters a business email, resolve the domain (e.g., example.com).
- Fetch IAB categories and store the top category name and any IAB-... identifiers.
- Write these into CRM fields (e.g., company_industry_iab, company_category_path) to power routing and scoring.
Auditing where ads run
- Batch process publisher URLs from ad delivery logs.
- Aggregate counts by IAB category to surface anomalies versus your targeting rules.
- Export a report with domain, category path, IAB identifiers, and confidence for compliance review.
Troubleshooting and observability
- Logging: Log the URL, HTTP status, success boolean, top category, top IAB id, and confidence for each call.
- Metrics: Track cache hit rate, average latency, and distribution of confidence scores to tune thresholds.
- Alerts: Notify when the share of “Unknown” or low-confidence results spikes, or when error rates exceed a baseline.
Governance with MCP
If your organization needs centralized control over models and prompts across teams, review the MCP page for governance options that complement domain intelligence workflows.
Security and compliance considerations
- Secrets management: Store the API key in a secure vault or environment variable. Rotate regularly.
- PII avoidance: Send only the URL needed for categorization; do not include user identifiers in API calls.
- Access controls: Restrict who can query the API or read enriched results within your org.
Putting it into production
Use a lightweight service layer that accepts URLs, consults your cache, calls Klazify on cache miss, normalizes the response into your internal schema (IAB identifiers and category path), persists it, and returns the decision and metadata. Apply feature flags to pilot confidence thresholds and policy rules. As usage grows, scale horizontally with worker pools and a message queue.
FAQ
- Where do I find the IAB category in the response? The IAB identifiers appear as sibling keys on each object inside domain.categories (for example, a key like IAB-632-596). There is no separate IAB_categories object.
- How do I handle results without an IAB-... field? Use the category name and confidence for your decision, and fall back to your internal mapping table. You can also schedule a recheck later.
- What should I cache, and for how long? Cache by domain or URL. Domain-level categories can be cached for hours to days based on your risk tolerance; shorten TTL for new or fast-changing sites.
- Can I enrich my CRM with company data too? Yes. The response includes objects.company fields such as name, location, employeesRange, revenue, and tags that you can store for lead scoring or segmentation.
- What happens if the request fails? Failed or unreachable calls are not billed. Implement retries with backoff and serve cached results when available.
Ready to classify at scale with IAB taxonomy? Create a free account to start testing the API and ship your integration: visit Register. For full endpoint details, parameters, and examples, see the Documentation and learn more about Klazify at https://www.klazify.com.
Ready to use Klazify?
Start classifying websites, enriching company data, and exploring web intelligence.
Get Started Free