Website Category API: Get a Website's Category

October 25, 2026
Website Category API: Get a Website's Category

You need to reliably identify a website’s category so you can take action: block gambling on a network, enrich a signup with industry data, or audit where ads are running. In this guide you’ll integrate a production-ready workflow that classifies a URL, reads IAB-aligned categories and confidence, and uses company, logo, social, and tech fields for enrichment—end to end—with the Klazify Website Category API.

Why Klazify is the right fit when you just need a website’s category you can trust

When your pipeline depends on correct categories—whether for brand safety, content filtering, or CRM enrichment—the mechanics matter: how content is analyzed, how fresh the data is, and how granular the taxonomy gets. Klazify focuses on real-time content analysis and IAB taxonomy mapping so you can make deterministic allow/deny or enrichment decisions without stitching multiple sources.

Illustration: Website Category API: Get a Website's Category
  • Accurate website categorization using AI: Klazify analyzes page content (not only metadata) to determine categories. This gives you the context needed to tell, for example, a news publisher from an unrelated blog, or a tutorials site from a product landing page.
  • Global coverage: Multilingual analysis supports pipelines that run across regions and TLDs, so your filters and enrichment don’t degrade outside English-language sites.
  • Real-time classification: Categories are derived at request time rather than relying solely on a static database, which helps when you encounter newly launched or frequently updated sites.
  • Industry-level categories (IAB): Direct IAB taxonomy mapping enables immediate use in ad tech and brand safety scenarios without custom heuristics.
  • Simple API integration: A single REST call returns categories, confidence, logo URL, company data, technology tags, and related signals you can wire into your workflow.
  • Compliance and filtering: Detect, filter, or whitelist relevant sites by reading categories and confidence, keeping policies consistent across traffic analysis, parental control, and ad placement.

If you’re building domain intelligence into ad platforms, SSO and signup enrichment, or cybersecurity controls, the single-call response structure makes operationalizing easy. Explore the platform at klazify.com, or create a free account to try it with your domains.

What you will build: classify a URL and take action on the result

We’ll cover a minimal but production-ready path:

  1. Send a POST request to the categorization endpoint with a URL.
  2. Parse the returned categories and confidence to make an allow/deny or tagging decision.
  3. Pull the logo, company data, social links, tech stack, and similar domains for enrichment.
  4. Cache results per domain and set retry policies for unknown or unreachable domains.
  5. Map Klazify categories to your internal taxonomy where needed.

Endpoint and authentication

Endpoint: POST https://www.klazify.com/api/categorize

Authentication: Bearer token in the Authorization header.

Body: JSON with a single field url specifying the page or domain to classify.

Failed or unreachable calls are not billed. For pricing, the Starter plan is $39.99/mo with a 7-day trial. You can Register and test immediately.

Try it: cURL request you can paste into your terminal

curl -X POST "https://www.klazify.com/api/categorize" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://cbsnews.com"}'

This request classifies the supplied URL and returns categories, confidence, and enrichment fields in a single JSON.

Code sample: Python integration

The snippet below shows how to call the same endpoint, parse categories and confidence scores, and prepare a decision object that your app can use downstream.

import json
import time
import requests

API_URL = "https://www.klazify.com/api/categorize"
API_KEY = "YOUR_API_KEY"

def categorize_url(target_url: str) -> dict:
    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json",
    }
    payload = {"url": target_url}
    r = requests.post(API_URL, headers=headers, data=json.dumps(payload), timeout=20)
    # Handle transient network errors conservatively
    r.raise_for_status()
    return r.json()

def to_policy_decision(resp: dict, blocklist: set) -> dict:
    """
    Map Klazify response to a simple decision.
    - Reads domain.categories[].name and confidence
    - Normalizes category names for internal matching
    - Returns decision plus enrichment fields
    """
    domain = resp.get("domain", {})
    cats = domain.get("categories", []) or []
    logo_url = domain.get("logo_url")
    social = domain.get("social_media")
    company = (resp.get("objects") or {}).get("company")
    registration = resp.get("domain_registration_data")
    similar = resp.get("similar_domains", [])

    # Choose the top category by confidence
    top = max(cats, key=lambda c: c.get("confidence", 0), default=None)
    top_name = top.get("name") if top else None
    top_conf = top.get("confidence") if top else None
    iab_code = None
    if top and any(k.startswith("IAB-") for k in top.keys()):
        # Pick the first IAB key present
        for k, v in top.items():
            if k.startswith("IAB-"):
                iab_code = v
                break

    normalized = (top_name or "").lower()
    action = "allow"
    reason = "no_match"

    # Example: block if the normalized name is in a blocklist
    # Use your organization’s mapping for production policies
    if any(b in normalized for b in blocklist):
        action = "block"
        reason = "category_blocklist_match"

    return {
        "action": action,
        "reason": reason,
        "category": top_name,
        "confidence": top_conf,
        "iab_mapping": iab_code,
        "logo_url": logo_url,
        "social_media": social,
        "company": company,
        "domain_registration_data": registration,
        "similar_domains": similar,
        "timestamp": int(time.time()),
    }

if __name__ == "__main__":
    # Example usage
    url_to_check = "https://cbsnews.com"
    resp = categorize_url(url_to_check)

    # Blocklist terms based on your policy (example only)
    block_terms = {"gambling", "adult", "malware", "hate", "piracy"}

    decision = to_policy_decision(resp, block_terms)
    print(json.dumps(decision, indent=2))

Official example response and how to use it

Below is the official JSON example. Use it to validate your parser and to understand where each field lives in the payload.


{
    "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"
    ]
}

How to use these fields in practice:

  • domain.categories: Array of categories with confidence; pick the highest-confidence item for a primary label, or retain multiple for multi-label tagging. name is your human-readable category; if present, IAB-… is the IAB taxonomy mapping to align with ad safety rules.
  • domain.logo_url: Use to render a recognizable logo in your CRM profile or UI without additional scraping.
  • objects.company: Enrich signups or leads with company name, location, employeesRange, revenue (as provided in the sample), high-level tags, and tech—ideal for routing, scoring, or personalization.
  • domain_registration_data: Incorporate domain age and expiration into risk models (e.g., very young domains may warrant additional checks).
  • similar_domains: Build lookups for competitor analysis, suggest contextual targeting expansions, or schedule future crawls.

Turn categories into actions: block, enrich, or audit

Categories and confidence determine what you do next. The patterns below are directly powered by the fields you saw above.

  • Block/allow for network filtering: If domain.categories[].name contains a blocked class (e.g., “/Gambling” or “/Adult Content”), deny access. Use a minimum confidence threshold (e.g., 0.85) before blocking. If multiple categories are returned, block if any match a sensitive set.
  • Enrich a signup: Use objects.company fields to prefill CRM records, append employeesRange and tags for lead scoring, and render domain.logo_url for better UX.
  • Audit ad placements: Match IAB-… mappings to your brand safety list. Keep a log of category, confidence, and timestamp for compliance reviews.

Working with IAB, internal taxonomies, and multi-label sites

Some organizations maintain a custom taxonomy that does not align one-to-one with IAB. A simple mapping table will bridge this gap: map Klazify name or IAB-… keys to your internal codes. For sites spanning multiple topics, treat the highest-confidence category as primary and include lower-confidence categories as secondary tags.

Klazify Field What it tells you How to use it
domain.categories[].name Human-readable category path Render in UI; map to internal codes; policy checks
domain.categories[].confidence Model certainty for each category Thresholding, tie-breaking between multiple labels
IAB-… key in category IAB taxonomy mapping Brand safety, ad targeting, contextual rules
domain.logo_url Logo image URL CRM and dashboard enrichment
objects.company.* Company name, location, tags, tech Lead routing, scoring, personalization
domain_registration_data.* Age and expiration of domain Risk assessment, compliance signals
similar_domains Related sites Lookalike targeting, competitive research

Operational details that save time in production

Caching and TTLs

Classification for a given domain won’t change minute-to-minute. Cache results per domain for hours to days depending on your risk tolerance. Common patterns:

  • Static cache: 7 days for stable corporate sites; 24 hours for publishers or frequently updated content.
  • Stale-while-revalidate: Serve the cached category immediately; refresh asynchronously to keep latency low.
  • Cache by domain and, if you classify deep URLs, by normalized URL (lowercase scheme/host, trimmed path) for page-level granularity.

Batching and throughput

If you need to classify many domains quickly, use parallel workers and a queue. Since the endpoint is single-URL per request, batch at the transport layer: send concurrent POSTs while observing your plan’s rate limits. Implement exponential backoff with jitter on HTTP 429 or 5xx and retry after a short delay.

Unknown or new domains

For newly registered or thin-content sites, categories may be limited. Recommended handling:

  • If categories array is empty or confidence is below your threshold, mark as “review” or “uncertain” and fall back to objects.company, domain_registration_data, or similar_domains for a second pass.
  • Schedule a retry later; content and signals often improve over time.
  • Log the first-seen timestamp to track freshness.

Latency and timeouts

Use client timeouts (e.g., 20–30s) and circuit breakers in your integration so a slow upstream does not stall your application. For synchronous user flows (signup forms), resolve from cache first and defer background refresh.

Versioning and schema stability

Parse defensively: check fields’ existence (e.g., social_media may be null). Avoid hard-coding array positions. Keep a small contract test that validates your parser using the official sample payload above.

Plug into your pipeline: ad tech, filtering, and enrichment

Ad tech and brand safety

Use IAB mappings for straightforward rules. For example, treat any category mapped to your disallowed IAB nodes as “do not bid,” while whitelisting educational or news categories for contextual placements. Log category, IAB mapping, confidence, and URL for audits.

Network filtering

Normalize category names (lowercase, strip punctuation) and compare them against a curated list. Maintain a minimum confidence; if below threshold, allow temporarily and queue a review. Include domain_registration_data in your decision to add risk-weighting for very young domains.

CRM and lead enrichment

Enrich accounts or signups by writing back:

  • Primary category and IAB code
  • Company name, location, employeesRange
  • Tags and selected tech signals
  • Logo URL for profile rendering

Store enrichment with a refresh timestamp. When data is older than your TTL, refresh asynchronously to avoid UI latency.

End-to-end example: from category to decision

Below is a compact outline of how a microservice would process a URL:

  1. Receive URL; normalize and check cache.
  2. If cache miss, POST to the API with the normalized URL.
  3. Parse domain.categories; pick the top confidence entry; read any IAB-… mapping present.
  4. Compute action:
    • block if category matches your denylist and confidence ≥ threshold
    • allow otherwise, but tag with category and confidence
  5. Write enrichment: logo_url, objects.company, domain_registration_data, similar_domains.
  6. Persist the decision and response; set cache TTL depending on site type.

Practical tips for production readiness

  • Normalization: Always trim schemes (http/https), lowercase hostnames, and strip “www.” when caching by domain.
  • Observability: Log request duration, HTTP status, decision, category, and confidence for later tuning.
  • Data minimization: Store just the fields your system needs (category, confidence, IAB mapping, logo_url, company basics) to keep payloads light.
  • Graceful degradation: If categorization is temporarily unavailable, serve cached data or default-safe decisions.
  • Security: Keep the Bearer token encrypted at rest and out of client-side code.

Where to go next

Review the API reference for request/response details and optional fields in depth: Documentation. For platform-level information and compatibility, see MCP. You can also explore the site at klazify.com to understand broader capabilities.

FAQ

  • Can I classify a specific page URL, not just a root domain?
    Yes. Send the full URL in the url field. Use page-level classification when different sections of a site cover distinct topics.
  • How should I set a confidence threshold?
    Start with a conservative threshold for blocking scenarios and a lower threshold for tagging-only scenarios. Log outcomes and iterate based on false-positive and false-negative rates in your environment.
  • What happens if the site doesn’t return a category?
    Treat it as “uncertain,” allow or queue for review depending on your policy, and retry later. You can still use company, domain age, and similar_domains to guide interim decisions.
  • How do I map Klazify categories to my internal taxonomy?
    Maintain a lookup table from domain.categories[].name and IAB mappings to your internal codes. Keep it versioned and test it as part of your deployment pipeline.
  • Can I enrich users or accounts with the non-category fields?
    Yes. Use logo_url, objects.company (name, location, employeesRange, tags, tech), and domain_registration_data to power CRM profiles, routing, and scoring.

Ready to classify your own URLs? Start with the 7-day trial on the Starter plan ($39.99/mo) and wire the categorization response into your stack today. Register and test your first request in minutes.

Ready to use Klazify?

Start classifying websites, enriching company data, and exploring web intelligence.

Get Started Free