How to Get a Website's Category

October 23, 2026
How to Get a Website's Category

You need to reliably detect what a website is about so you can block a category on your network, enrich a signup in your CRM, or audit where ads are running. By the end of this guide, you’ll have a working request that returns a website’s category (IAB taxonomy), plus logo, social, company details, tech stack, and related signals you can plug into your pipeline.

Why Klazify is the right API for getting a website’s category

When your job is to decide “permit or block,” “safe or unsafe,” or “which segment should this lead belong to,” the classification must be precise, current, and programmable. Here’s how Klazify fits that job:

Illustration: How to Get a Website's Category
  • Accurate website categorization using AI: Klazify analyzes full-page content, not only domain metadata. That helps correctly identify nuanced content and subtopics, which matters when one path should be blocked while another is allowed.
  • Global coverage: It works across languages, which is critical when your traffic, signups, or inventory span regions.
  • Real-time classification: The API inspects live content rather than relying on a stale lookup, so newly published material is reflected in categorization.
  • Industry-level categories (IAB): Output maps to the IAB taxonomy, so ad tech and brand safety workflows can act without bespoke rework.
  • Simple API integration: One POST request returns the category plus logo, social links, company metadata, tech stack, and related domains, streamlining enrichment.
  • Compliance and filtering: Consistent, machine-readable labels let you implement allowlists/denylists or tag content for policy enforcement with low latency.

Typical outcomes include blocking specific categories on WiFi, segmenting signups by industry in a CRM, and ensuring ads only appear beside content you’ve whitelisted.

The workflow you can implement now

  1. Get an API key from Klazify and store it securely (environment variable or secrets manager).
  2. Send a POST request to the categorize endpoint with the URL you want to evaluate.
  3. Parse the response to extract the primary category and confidence score, then collect optional fields like logo_url, social_media, company, tech, and similar_domains.
  4. Apply your policy:
    • Block or allow based on the category path (e.g., “/News”).
    • Enrich a lead with company name, size, location, or tags.
    • Audit placements by verifying the category against approved IAB groups.
  5. Cache results per domain and refresh on a schedule to reduce latency and API calls.

Make your first categorization request

Use the main endpoint with a Bearer token and a single JSON body. The following example uses a news site URL. In Klazify’s documentation, this domain categorizes under “/News” with confidence 0.97. The same call also returns logo, social, company, and tech stack data you can use for enrichment.

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"}'

Note:

  • Use a full URL or domain in the url field.
  • If a site is temporarily unreachable or the call fails, it isn’t billed.
  • Keep your API key secret; avoid embedding it in client-side code.

Understand the response structure you’ll work with

Below is an official sample response format. It includes categories, logo_url, social, company object, domain registration data, and similar_domains. Use it to guide your parsing and to design your persistence schema.


{
    "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 you will likely use:

  • domain.categories: An ordered list of category candidates. Use the top item’s name as the primary category and its confidence to decide thresholds.
  • domain.logo_url: A persistent logo URL you can display in UIs or emails.
  • domain.social_media: Social links if detected. Use them to augment CRM profiles.
  • objects.company: Enrichment data (name, location, size, revenue, tags, tech). Useful for lead scoring or routing.
  • domain_registration_data: Dates and derived “days” fields helpful in risk or lifecycle scoring.
  • similar_domains: Related domains you can use for expansion, competitive sets, or discovery.

A minimal Python example that extracts the category and enrichment

import os
import requests

API_KEY = os.getenv("KLAZIFY_API_KEY") or "YOUR_API_KEY"
URL = "https://www.klazify.com/api/categorize"

def categorize(target_url: str):
    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json",
    }
    payload = {"url": target_url}
    resp = requests.post(URL, headers=headers, json=payload, timeout=20)
    resp.raise_for_status()
    data = resp.json()

    # Extract the primary category and confidence
    categories = (data.get("domain") or {}).get("categories") or []
    primary = categories[0] if categories else None
    primary_name = primary.get("name") if primary else None
    primary_conf = primary.get("confidence") if primary else None

    # Optional enrichment
    logo_url = (data.get("domain") or {}).get("logo_url")
    company = (data.get("objects") or {}).get("company") or {}
    company_name = company.get("name")
    company_size = company.get("employeesRange")
    company_tags = company.get("tags") or []
    tech_stack = company.get("tech") or []

    # Registration and similar domains
    reg = data.get("domain_registration_data") or {}
    age_date = reg.get("domain_age_date")
    similar = data.get("similar_domains") or []

    return {
        "primary_category": primary_name,
        "confidence": primary_conf,
        "logo_url": logo_url,
        "company_name": company_name,
        "company_size": company_size,
        "company_tags": company_tags,
        "tech_stack": tech_stack,
        "domain_age_date": age_date,
        "similar_domains": similar[:5],
        "raw": data,
    }

if __name__ == "__main__":
    result = categorize("https://cbsnews.com")
    print("Category:", result["primary_category"])
    print("Confidence:", result["confidence"])
    print("Company:", result["company_name"], "-", result["company_size"])
    print("Logo:", result["logo_url"])
    print("Similar:", ", ".join(result["similar_domains"]))

In production, persist the raw JSON for traceability, store the normalized category path, and index by domain for de-duplication.

What to do with the returned fields

  • Block or allow: Use domain.categories[0].name as the canonical category string. Enforce policy by matching prefixes (e.g., an allowlist of “/News” and “/Education”). Apply a confidence threshold; for example, require the top category’s confidence to be above your selected cutoff to auto-allow.
  • Lead enrichment: Upsert objects.company (name, employeesRange, revenue, location, tags) into your CRM or CDP and use the category to set an “Industry” field (IAB-mapped) and score routing rules.
  • Ad placement verification: Compare the top category against your accepted IAB groups to audit where placements occur and flag out-of-policy pages.
  • UI polish: Display domain.logo_url in dashboards and analyst tools to speed reviews and investigations.
  • Discovery: Explore similar_domains to find candidate sites for outreach or for further blocking/allowlisting tests.

Mapping IAB categories to your own taxonomy

If your system uses custom segments, map Klazify’s IAB-aligned names to your internal labels. Keep the original Klazify path for traceability and rollups.

Klazify category path Example IAB code in response Your internal segment Policy action
/News (not always present) news Allowed (brand-safe list)
/Computers & Electronics/Consumer Electronics IAB-632-596 tech-hardware Allowed; exclude for B2B-only campaigns
/Internet & Telecom/Mobile & Wireless/Mobile Phones (not always present) mobile Allowed; prioritize in mobile-focused segment

Implementation tip: store both the “name” path and any accompanying IAB code so downstream teams can use whichever is standard for them.

Operational guidance: scaling, resilience, and latency

  • Batching: If you have large lists of domains, queue them and send sequentially or with controlled concurrency. Persist results per root domain to avoid classifying the same site repeatedly.
  • Caching: Cache by eTLD+1 (e.g., example.com) for domain-level use cases and by full URL when page-level variation matters. Consider a short TTL for newsy or fast-changing sites and a longer TTL for static corporate pages.
  • Rate limits: Treat limits as finite. Implement client-side throttling and backoff. Avoid bursts when syncing large inventories.
  • Retries: Use exponential backoff for transient errors. Do not retry indefinitely. Because failed or unreachable calls are not billed, retries are safe but keep them bounded.
  • Unknown or new domains: If categories is empty, re-queue after a short delay. You can temporarily mark the site as “unclassified” and apply a default policy (e.g., require manual review or use a conservative block/hold).
  • Normalization: Lowercase domain keys, strip URL fragments and query strings for domain-level caches, and retain canonical URL forms when you need page-level granularity.
  • Auditing: Log the response’s category and confidence along with a timestamp to demonstrate due diligence for brand safety or compliance audits.

A quick comparison of fields you’ll likely persist

Field Purpose Recommended storage How you’ll use it
domain.categories[0].name Primary category path Text (indexed) Policy checks and segmentation
domain.categories[0].confidence Model confidence Float Thresholding and fallbacks
domain.logo_url Brand identity Text URL UI, reports, emails
objects.company.* Business enrichment Structured JSON columns Lead routing, scoring, personalization
domain_registration_data.* Registration signals Structured fields Risk scoring and lifecycle analysis
similar_domains[] Discovery Array Expansion, competitive context

Policy patterns: from category to action

1) Network/content filtering

  • Classify the destination URL at request time or pre classify a known list.
  • Match the returned category path against your policy tree; decide allow/deny with a confidence threshold.
  • Cache the result to serve subsequent decisions instantly.

2) Signup enrichment

  • On form submit, classify the company domain from the email address.
  • Attach the IAB category, company name, employeesRange, revenue, tags, and tech to the lead record.
  • Route to the correct SDR team or lifecycle stage based on category and size.

3) Ad placement audit

  • Classify each placement URL and record the category path and confidence.
  • Compare against an allowlist of acceptable IAB categories.
  • Alert or pause placements that fall outside the approved set.

Handling edge cases

  • Mixed-content sites: Some domains host diverse sections. If you evaluate at page-level, use the specific page’s URL to capture the precise category for that content.
  • Redirects and tracking URLs: Resolve to the final destination before classification, or pass the final URL to the API, so the content’s category is accurate.
  • Minimal-content or parked domains: These may return low-confidence or empty categories. Apply your default policy and re-check later.

Security and privacy notes

  • Store API keys in environment variables or a secrets manager; never commit them to source control.
  • Encrypt at rest any logs that include user inputs or classified URLs.
  • When building user-facing features, disclose that third-party classification is used if required by your privacy policy.

Get access and start testing

The Starter plan is $39.99/month with a 7-day trial, suitable for integrating classification and enrichment in small to medium pipelines. To explore endpoints and payloads, see the Documentation and browse models in the MCP. When you’re ready to test live traffic, create a free account and get your API key here: Register.

FAQ

  • Does the API return IAB-aligned categories I can use in ad tech? Yes. The response includes category names aligned to IAB taxonomy, and may include an IAB code when applicable in the categories array.
  • What should I do when the confidence is low? Set a threshold and route low-confidence items to a fallback: manual review, secondary verification, or a conservative policy (e.g., hold or block until rechecked).
  • How should I cache results? Cache by domain (eTLD+1) for site-level policies and by full URL for page-level policies. Use shorter TTLs for frequently changing sites and longer TTLs for static corporate pages.
  • How do I handle rate limits? Implement client-side throttling and exponential backoff. Batch work and spread requests over time to avoid bursts.
  • Are failed or unreachable calls billed? No. Failed or unreachable calls are not billed, which makes bounded retries safe to implement.

Ship a working categorization pipeline today. Explore endpoints in the Documentation and create your free account to get an API key here: Register.

Ready to use Klazify?

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

Get Started Free