Integrate the Company Name API in PHP

November 06, 2026
Integrate the Company Name API in PHP

Your team needs to enrich signups and leads with a reliable company name, location, and size based on a domain, then route those records into your CRM and product analytics. By the end of this guide, you’ll be able to call Klazify’s Company endpoint from your backend, parse the response to capture company.name and location fields, cache results per domain, and safely handle unknown or new domains in production.

Why Klazify is the best fit for company data enrichment from domains

When you’re enriching leads or signups in PHP, accuracy and latency matter—especially if you need the company name and size as the user types their email or just after signup. Klazify analyzes full website content and connected signals, which helps resolve ambiguous domains and return consistent company details. This is particularly useful for enrichment flows, fraud checks, and routing logic (for example, auto-assigning enterprise leads based on employeesRange).

Illustration: Integrate the Company Name API in PHP
  • Accurate company detection from real content: Klazify’s models analyze on-page content (not just WHOIS or metadata) to identify a company and its business tags, improving match rates on content-heavy or newly redesigned sites.
  • Global coverage: Works across regions and languages, essential when your signups come from international domains.
  • Real-time classification: Fresh crawling and analysis means new or updated sites can be resolved to the correct company details.
  • IAB taxonomy support: If you also need industry classification for targeting or brand safety, the IAB mapping is available from the Categorization endpoint and pairs cleanly with company data in one pipeline.
  • Simple REST integration: Post a URL or domain and read the output—ideal for PHP backends, serverless functions, and data pipelines.
  • Compliance and filtering: Combine company enrichment with content categories to automatically flag or approve signups from domains in restricted industries.

All of this is accessible from a single API, so you can enrich records at signup and later augment them with categorization signals using the same domain key. Explore more at klazify.com or create a free account to test your integration.

What you will build: domain-to-company enrichment for signups

We’ll implement a backend step that accepts a user’s website (or extracts the domain from their email), calls Klazify to retrieve company.name, employeesRange, revenue, raised, location, and tags, then stores these on the lead or account record. Use cases include sales routing (employeesRange), territory assignment (countryCode/stateCode), analytics segmentation (tags), and fraud checks (mismatched domain vs. declared company name).

Core API endpoints you’ll use

  • Company from domain: POST https://www.klazify.com/api/domain_company
  • Website categorization (IAB): GET https://www.klazify.com/api/categorize

For this guide, we’ll focus on domain_company for enrichment and show how to interpret categorization fields as well (useful when you also need industry filters or brand safety checks in your pipeline).

Make your first request (curl)

The following request queries company details for a domain. Replace YOUR_API_KEY with your token. Failed or unreachable calls are not billed. The Starter plan is $39.99/mo with a 7-day trial, so you can validate accuracy and pipeline fit before committing.

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

Tip: Send the full URL if you have it. Otherwise, pass the bare domain (e.g., example.com). Store responses by domain key in your cache to avoid duplicate calls.

Official response example and how to use it

Below is the official JSON example from the Klazify documentation. It includes both categorization and company sections—many teams use both in the same pipeline. Your domain_company request returns the company object fields you’ll use to enrich your CRM or signup table. Use the domain and categories fields to add industry context when needed.


{
    "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 key fields:

  • objects.company.name: Store this as your canonical company name on the account/profile. Use for deduping or matching in CRM.
  • objects.company.city, stateCode, countryCode: Normalize lead territory and route to the correct team.
  • objects.company.employeesRange: Power routing (e.g., “100K+” to enterprise queue) and segmentation.
  • objects.company.revenue and raised: Enhance scoring and qualification. Treat these as metadata; do not assume currency conversions unless documented for your workflow.
  • objects.company.tags: Useful for quick industry or capability filters in product analytics.
  • domain.categories and IAB-… mapping: Use for industry classification, content filtering, and brand safety logic.
  • domain.logo_url: Display recognizable branding in your UI or CRM cards.
  • similar_domains: Recommend alternatives, find related properties, or flag typosquatting.
  • success: Check this boolean before reading fields. Handle any non-success response gracefully.

Implementing the call in PHP

This example shows a typical PHP backend script that enriches a signup using the domain_company endpoint. It accepts a domain, calls the API, and writes fields into your data model.

<?php
$apiKey = getenv('KLAZIFY_API_KEY'); // or hardcode for testing
$endpoint = 'https://www.klazify.com/api/domain_company';

function fetchCompanyFromDomain($domainOrUrl, $apiKey) {
    $payload = json_encode(['url' => $domainOrUrl]);

    $ch = curl_init($endpoint);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'Authorization: Bearer ' . $apiKey,
        'Content-Type: application/json'
    ]);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    // Reasonable timeout for signup flows; tune based on your SLOs
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);

    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $curlErr  = curl_error($ch);
    curl_close($ch);

    if ($curlErr) {
        // Network error: log and return null. Failed calls are not billed.
        error_log('Klazify curl error: ' . $curlErr);
        return null;
    }
    if ($httpCode < 200 || $httpCode >= 300) {
        // Non-2xx: log body for diagnostics
        error_log('Klazify HTTP ' . $httpCode . ' response: ' . $response);
        return null;
    }

    $json = json_decode($response, true);
    if (!isset($json['success']) || !$json['success']) {
        // API-level issue or unknown domain
        return null;
    }

    // Safely extract company fields if present
    $company = $json['objects']['company'] ?? null;
    if (!$company) return null;

    return [
        'name' => $company['name'] ?? null,
        'url' => $company['url'] ?? null,
        'city' => $company['city'] ?? null,
        'stateCode' => $company['stateCode'] ?? null,
        'countryCode' => $company['countryCode'] ?? null,
        'employeesRange' => $company['employeesRange'] ?? null,
        'revenue' => $company['revenue'] ?? null,
        'raised' => $company['raised'] ?? null,
        'tags' => $company['tags'] ?? [],
    ];
}

// Example usage
$domain = $_POST['website'] ?? 'https://cbsnews.com';
$company = fetchCompanyFromDomain($domain, $apiKey);

if ($company) {
    // Persist to your DB or CRM
    // e.g., save $company['name'], $company['employeesRange'], etc.
    echo 'Enriched company: ' . $company['name'];
} else {
    echo 'No company data found or request failed.';
}

Production note: If you also need categories and IAB taxonomy for the same domain, call the categorize endpoint and store category name and confidence. Cache both responses together under the same domain key.

Alternative: JavaScript example (Node.js)

If your enrichment runs in a serverless function or Node service, here’s a minimal example using fetch. Keep calls on the server side; avoid calling the API directly from the browser.

import fetch from 'node-fetch';

const API_KEY = process.env.KLAZIFY_API_KEY;

async function getCompany(domainOrUrl) {
  const res = await fetch('https://www.klazify.com/api/domain_company', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ url: domainOrUrl })
  });

  if (!res.ok) {
    const text = await res.text();
    console.error('Klazify error', res.status, text);
    return null;
  }

  const data = await res.json();
  if (!data.success) return null;

  const company = data.objects?.company;
  if (!company) return null;

  return {
    name: company.name,
    countryCode: company.countryCode,
    stateCode: company.stateCode,
    city: company.city,
    employeesRange: company.employeesRange,
    revenue: company.revenue,
    raised: company.raised,
    tags: company.tags || [],
    logoUrl: data.domain?.logo_url,
    categories: data.domain?.categories || []
  };
}

(async () => {
  const info = await getCompany('https://cbsnews.com');
  console.log(info);
})();

How to plug the response into your pipeline

1) Persist and cache by domain

  • Key your cache by the normalized registrable domain (e.g., example.com). Include a short TTL for fast-moving sites and a longer TTL for stable corporate domains.
  • Write-through strategy: On cache miss, call Klazify, store the result, and return it to the request path.
  • Backfill offline: For large datasets, run a background job to pre-enrich domains in bulk.

2) Use fields to route and score

  • company.name: Normalize capitalization and strip suffixes if needed to match your internal account naming. Use this to deduplicate incoming leads.
  • employeesRange: Define routing rules (e.g., “100K+” to enterprise queue) and tiering for support plans.
  • countryCode/stateCode/city: Map to territories. If you use ISO codes, these fields are immediately usable.
  • tags: Add quick filters in analytics dashboards (e.g., “B2C”, “Mobile”) or to trigger product tours.
  • logo_url: Improve SDR and CS workflows by rendering recognizable cards in your internal tools.

3) Combine with categorization (IAB) for policies

  • Use domain.categories.name for allow/deny lists (e.g., block certain verticals) or to personalize onboarding flows.
  • Store IAB codes when present to align with your advertising or brand-safety stack.
  • Leverage confidence to set thresholds; if confidence is low, fall back to manual review or secondary checks.

4) Handling unknown or new domains

  • Check success before reading fields. If success is false or the company object is missing, queue the domain for re-check later.
  • Implement exponential backoff and a maximum retry limit to avoid tight loops.
  • Gracefully degrade: keep the user’s flow moving and annotate the record as “pending enrichment.”

Batching, concurrency, and rate limits

If you’re processing many domains, run calls concurrently but cap parallelism to respect your plan’s guidelines. When building an internal enrichment service:

  • Use a worker queue with limited concurrency per region.
  • Cache hits first, then only call the API for cache misses.
  • Spread large backfills over time to keep interactive traffic snappy.

For exact limits and pagination behavior, review the Documentation. Unknown or unreachable calls are not billed, so you can implement retries where it makes sense without worrying about failed-call charges.

Mapping to your internal taxonomy

If your organization maintains a custom industry taxonomy or lead tiers, map them from Klazify’s returned values:

  • Industry: Use domain.categories and, when present, IAB mappings as the source of truth. Create a lookup table from IAB to your internal labels.
  • Company size: Map employeesRange values (e.g., “100K+”) into your CRM’s picklist tiers.
  • Geography: Use countryCode/stateCode to standardize regional ownership.
  • Tags: Adopt as-is or maintain a mapping to consolidated segments (e.g., “Mobile” → “Mobile-first”).

Operating in production

  • Timeouts and SLAs: For signup flows, keep timeouts tight (e.g., 5s connect, 10s total) and move enrichment off the critical path when possible.
  • Observability: Log success, latency, and error rates. Sample payloads for debugging, with PII removed.
  • Revalidation: Periodically refresh cached domains to catch org changes and rebrands.
  • Back-pressure: If rate limits approach, slow down background jobs first; keep interactive lookups prioritized.
  • Security: Send requests from the server. Store API keys in a secrets manager or environment variables.

End-to-end example: enriching a signup and gating features

  1. User enters email and company website on your signup form.
  2. Your backend extracts the domain and calls domain_company. If you also need industry rules, call categorize.
  3. Persist objects.company.name, employeesRange, countryCode, and tags on the account.
  4. Apply rules:
    • Route enterprise-sized accounts to a dedicated onboarding path.
    • Block or review signups when domain.categories match restricted industries in your policy.
    • Render logo_url on internal account cards and in the user’s dashboard.
  5. Cache by domain with a reasonable TTL, and enqueue re-check tasks for unknown or low-confidence results.

Pricing, trial, and setup

  • Starter is $39.99/mo with a 7-day trial.
  • Failed or unreachable calls are not billed.
  • Create your API key and test your flow in minutes.

Get started now: Register. You can also explore the MCP and read the full Documentation.

FAQ

  • Can I send either a URL or a domain? Yes. The domain_company endpoint accepts a URL or a bare domain. If you have the full URL, pass it; otherwise, normalize to the registrable domain (e.g., example.com).
  • How should I handle unknown or low-confidence results? Check success and the presence of objects.company. If missing, queue the domain for retry and mark the record as pending enrichment. Use categorization confidence to set thresholds for automated decisions.
  • What’s the best way to avoid duplicate lookups? Cache results per normalized domain with a TTL. Hit the cache first in request paths and refresh in the background for long-lived accounts.
  • Can I use IAB categories for ad targeting or brand safety? Yes. Use the categorize endpoint and read domain.categories and any IAB mappings to align with your ad stack or content filters.
  • How do I control concurrency for bulk enrichment? Use a worker queue with a concurrency cap, prefer cache-first logic, and prioritize interactive traffic over batch jobs. Consult the docs for plan-specific guidance.

Ready to enrich your signups and leads with clean company data? Create a free account, get your API key, and implement the domain-to-company flow in your backend today. Start here: Register. For full endpoint details, see the Documentation and explore more at klazify.com.

Ready to use Klazify?

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

Get Started Free