How to Get the Industry Tags in Python

November 13, 2026
How to Get the Industry Tags in Python

You need to enrich a stream of signups or inbound leads with industry tags so your product can auto-route accounts, score prospects, or block/allow categories in real time. By the end of this guide, you’ll request company data from a domain, parse industry tags in Python, and operationalize the results in your pipeline using Klazify.

Why Klazify for extracting industry tags in Python

When your workflow depends on acting quickly and accurately on a domain (e.g., classify at signup, score a lead, or filter web traffic), you need tags that reflect the live content and business focus of the site. Klazify analyzes full site content and structure, not just a domain string, which helps it identify granular industry-level context. Here’s how that helps when your goal is “get the tags and use them in Python”:

Illustration: How to Get the Industry Tags in Python
  • Accurate content-derived tags: Tags are inferred from on-page signals, enabling precise detection of niche verticals you care about for routing or filtering.
  • Global coverage: Content analysis works across geographies and languages, useful when your user base or ad inventory spans multiple regions.
  • Real-time classification: Data reflects the current state of the website, so updates to content or positioning propagate to your enrichment logic without manual recategorization.
  • IAB taxonomy alignment: Use tags alongside IAB categories for brand safety, contextual targeting, or policy-driven filtering.
  • Simple REST API: A single POST returns company fields, including tags, that slot into Python ETL jobs, serverless functions, or backend services.
  • Compliance and filtering: Combine tags and categories to block or allow domains according to your policies for ad placement, content moderation, or corporate network usage.

You can get started quickly, then scale: the Starter plan is $39.99/mo with a 7-day trial, and failed or unreachable calls are not billed. Create a free account at Register, or read the Documentation.

What you’ll build: enrich a domain to get industry tags

We’ll call the company data endpoint with a domain and extract the tags field. You can then:

  • Match tags against your internal taxonomy for routing and scoring.
  • Use tags to permit or block certain industries during onboarding.
  • Feed tags into analytics for segmentation, dashboards, and alerts.

If you’re classifying at page level or require IAB categories in addition to business tags, you can also use the main categorization endpoint for content analysis. For tags from a company profile, the company endpoint below is the most direct path.

Endpoint you will use

  • POST https://www.klazify.com/api/domain_company — returns company information and tags for a given URL or domain.

Related capability you may combine later:

  • GET/POST https://www.klazify.com/api/categorize — returns website and content categories (mapped to IAB), social links, logo URL, domain registration data, similar domains, and more.

Make your first request to fetch industry tags

Send a POST with your Bearer token and a JSON payload containing the URL you want to analyze.

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

Notes:

  • Authorization uses the Bearer scheme; replace YOUR_API_KEY with your token.
  • Payload accepts a URL or domain string.
  • Failed or unreachable calls are not billed, which helps during development and retries.

Python: extract the tags field and put it to work

The snippet below posts a domain, then reads objects.company.tags. Use these tags to make routing decisions, enrich CRM profiles, or flag categories to block.

import os
import json
import requests
from typing import List, Dict, Any, Optional

API_KEY = os.getenv("KLAZIFY_API_KEY", "YOUR_API_KEY")
API_URL = "https://www.klazify.com/api/domain_company"

def get_company_tags(domain_or_url: str) -> Dict[str, Any]:
    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json",
    }
    payload = {"url": domain_or_url}

    resp = requests.post(API_URL, headers=headers, data=json.dumps(payload), timeout=12)
    # Handle non-2xx without assuming billable usage
    if not resp.ok:
        return {"success": False, "status": resp.status_code, "error": resp.text}

    data = resp.json()
    company = (data.get("objects") or {}).get("company") or {}
    tags = company.get("tags") or []
    name = company.get("name")
    location = {
        "city": company.get("city"),
        "stateCode": company.get("stateCode"),
        "countryCode": company.get("countryCode"),
    }
    # Revenue is provided by the API; treat it as a range/estimate for enrichment logic
    revenue = company.get("revenue")
    employees = company.get("employeesRange")

    return {
        "success": True,
        "name": name,
        "tags": tags,
        "employeesRange": employees,
        "revenue": revenue,
        "location": location,
        "raw": data,
    }

def route_by_tags(tags: List[str]) -> str:
    # Map tags to your internal segments or policies
    tag_set = {t.lower() for t in tags}
    if "b2b" in tag_set:
        return "assign_to_outbound_b2b_queue"
    if "consumer electronics" in tag_set:
        return "auto_qualify_consumer_segment"
    if "adult" in tag_set or "gambling" in tag_set:
        return "block_or_manual_review"
    return "default_queue"

if __name__ == "__main__":
    result = get_company_tags("https://cbsnews.com")
    if not result["success"]:
        print("Request failed:", result)
    else:
        print("Company:", result["name"])
        print("Tags:", result["tags"])
        action = route_by_tags(result["tags"])
        print("Next action:", action)

Integration tips:

  • Cache the result keyed by the registered domain (e.g., cbsnews.com) to avoid repeat calls in short intervals.
  • Store tags as a normalized, lowercase array for consistent matching.
  • Create a mapping layer from Klazify tags to your internal taxonomy or lifecycle stages.

Official example response and how to use it

The example below shows what a full categorization payload can look like when using the categorization endpoint. It includes categories, company fields (with tags), and related data. Use the objects.company.tags value for industry tags, and domain.categories for IAB-aligned categories when you need both business tags and content taxonomy.


{
    "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 from the response:

  • objects.company.tags: The business tags you’ll store and match in your pipeline.
  • objects.company.name, city, stateCode, countryCode, employeesRange, revenue, raised: Enrichment fields for CRM, scoring, or personalization.
  • domain.categories: Content categories with confidence and IAB mapping for brand safety and contextual rules.
  • domain.logo_url: Display branding in admin tools or CRMs.
  • similar_domains: Expand your prospecting set or run competitive analysis.

Turn tags into routing, filtering, and enrichment

Common ways to act on tags right after you parse them in Python:

  • Scoring: Increase lead score when tags match your ICP (e.g., “B2B”, “SaaS”). Decrease when tags indicate misalignment (e.g., “Adult”).
  • Routing: Auto-assign to the correct SDR/AE team based on tags like “Enterprise”, “B2C”, or verticals you prioritize.
  • Blocking/allowing: Deny signups or restrict features for disallowed categories to maintain policy compliance.
  • Personalization: Tailor onboarding steps or educational content by industry tags.
  • Analytics: Segment funnels and retention dashboards by tags to find high-performing verticals.

Map tags to your own taxonomy

Most teams maintain an internal industry list that differs from source tags. Create a simple rules engine to translate tags into your canonical taxonomy:

  • String normalization: Lowercase, strip punctuation, and de-duplicate.
  • Exact and fuzzy match: Match known tags directly and apply fuzzy matching for near-misses.
  • Priority weighting: If multiple tags match, pick the highest-priority internal category.
  • Fallback: When no rules match, assign “Unknown” or queue for human review.

For brand safety or contextual ads, combine business tags with IAB categories from categorization results, using IAB mapping to drive policy decisions at scale.

Operational guidance: scale, performance, and reliability

Batching and concurrency

  • Send requests concurrently with bounded workers to avoid saturating your network or hitting account limits. Use a small pool per process and exponential backoff on transient errors.
  • Group domains to process in short-lived batches so you can checkpoint progress and retry only failed ones.

Caching and TTLs

  • Cache by registrable domain (e.g., example.co.uk) rather than full URL to avoid duplicate lookups.
  • Set a reasonable TTL: tags and categories change less frequently than page content, but still update over time. Refresh on cache-miss, explicit user action, or scheduled revalidation.

Unknown or new domains

  • Handle null or empty tags gracefully. Apply a default route, queue for review, or retry later.
  • Log incomplete results separately to monitor what percentage of traffic requires a fallback path.

Idempotency and retries

  • Implement safe retries with backoff for network timeouts. Avoid aggressive retry storms to keep latency predictable.
  • Failed or unreachable calls are not billed, which simplifies retry policies during outages.

Security and privacy

  • Store API keys securely (environment variables, secrets manager). Never commit keys to source control.
  • Log only what you need for audit and debugging; avoid storing raw responses beyond necessary retention.

Choosing fields and how to apply them

Field What it tells you How to use it
objects.company.tags Business-relevant industry tags Routing, scoring, blocking/allowing, segmentation
objects.company.name Company display name Show in admin tools; use for dedupe and CRM merge
objects.company.employeesRange Workforce size range ICP filters, lead scoring, territory assignment
objects.company.revenue Revenue figure or range Scoring and ICP fit; do not treat as exact accounting
objects.company.city/stateCode/countryCode Geography Regional routing, compliance checks, licensing regions
domain.categories Content categories with confidence and IAB mapping Brand safety, contextual targeting, content filtering
domain.logo_url Logo image URL Better UX in admin/CRM views
similar_domains Related domains Prospecting, competitive research, clustering

Quality checks before production

  • Schema validation: Assert that objects.company.tags is present and is an array; handle nulls.
  • Determinism: Re-run a small sample daily to catch shifts in tags and categories; compare diffs.
  • Backfills: For historical leads, run bulk enrichment and store normalized tags in your warehouse.
  • Observability: Track request latency, success rate, and tag coverage to plan concurrency and caching.

Where to go next

  • Create an account to get an API key: Register
  • Read endpoint details and field definitions: Documentation
  • Explore models and capabilities overview: MCP

Visit the homepage at klazify.com to see the full platform and how it fits your stack.

FAQ

How do I handle domains that return no tags?
Treat missing tags as an “Unknown” state. Apply a default route, schedule a retry, and consider a manual review queue for high-value accounts.

Can I get both tags and IAB categories?
Yes. Use the company endpoint for tags and the categorization endpoint for IAB-aligned categories. Store both for combined routing and brand safety rules.

How should I cache results?
Cache by registrable domain with a TTL that aligns to your revalidation needs. Invalidate on key events (e.g., user upgrades) or refresh on schedule to reflect site changes.

What about rate limits and batching?
Send requests concurrently with a bounded worker pool and backoff. If you process large lists, break them into batches and checkpoint progress to retry only failures.

Are failed calls charged?
Failed or unreachable calls are not billed, which simplifies your retry strategy during intermittent issues.

Ready to enrich domains with industry tags and ship this to production? Create your account at Klazify Register and start integrating. You can always return to klazify.com for updates and platform details.

Ready to use Klazify?

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

Get Started Free