Integrate the Tech Stack API in PHP

November 16, 2026
Integrate the Tech Stack API in PHP

You need to reliably detect which CMS, analytics, CDNs, frameworks, and ad networks are running on the domains your product touches—so you can block specific vendors, enrich signups, or audit where ads run. By the end of this guide, you’ll have a working PHP integration that calls Klazify’s Tech Stack API, extracts the objects.company.tech array, and plugs it into your pipeline with caching, batching, and sensible fallbacks.

Why Klazify is the right fit for technology stack detection

Teams often combine tech stack detection with brand safety and enrichment, which means you need a single API that’s accurate, current, and simple to wire into backend services.

Illustration: Integrate the Tech Stack API in PHP
  • Accurate technology detection using AI: Klazify analyzes real site content, not only headers or meta tags, so it can surface technologies embedded across templates and pages (e.g., analytics tags, tag managers, CDNs).
  • Global coverage: It works across languages and localized sites, which is vital when you classify multi-region properties.
  • Real-time classification: You get up-to-date results instead of outdated lookups, useful when vendors are swapped or tags are removed.
  • Industry-level categories with IAB mapping: If your workflow also requires page or domain classification, the same API returns IAB-aligned categories for consistent policy and ad controls.
  • Simple API integration: A clean REST interface makes it straightforward to add to a PHP service, a data pipeline, or a serverless function.
  • Compliance and filtering: Use the returned tech identifiers to whitelist or block analytics providers, ad networks, or frameworks at scale.

If you’re new to Klazify, skim the product overview at klazify.com, then create a free account to get your API key. The Starter plan is $39.99/mo with a 7-day trial, and failed or unreachable calls are not billed.

What you’ll build

We’ll create a PHP function that calls the Tech Stack endpoint, parses objects.company.tech, and returns a normalized list of technology identifiers your systems can act on. We’ll also cover:

  • How to batch requests and cache per domain to control latency and cost.
  • How to deal with unknown or new domains gracefully.
  • How to map Klazify’s tech identifiers and IAB categories to your internal taxonomy.
  • How to integrate results into enrichment and brand safety workflows.

For reference and deeper options, see the Documentation. You can explore models and capabilities at MCP and the homepage at klazify.com.

Endpoints you will use

Klazify provides multiple endpoints. For technology detection you’ll primarily call:

  • POST https://www.klazify.com/api/domain_tech — returns the technologies detected for a given URL or domain in objects.company.tech.

When you also need content categorization, logos, social signals, or IAB taxonomy mapping, use:

  • POST https://www.klazify.com/api/categorize — returns categories, logo_url, social links when available, company data, and the same tech stack array in objects.company.tech.
Endpoint Primary purpose Key fields Typical use Recommended cache key
/api/domain_tech Detect site technologies objects.company.tech Vendor whitelists/blocks, third-party script audits Registered domain (e.g., example.com)
/api/categorize Website categorization and enrichment domain.categories, domain.logo_url, objects.company.tech, similar_domains Brand safety, contextual targeting, CRM enrichment Canonical URL or domain

Authentication and a working curl you can paste

Authenticate with a Bearer token. Replace YOUR_API_KEY with your key.

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

Request body:

  • url: A full URL or bare domain. Use the canonical domain when possible to maximize cache hits.

On success, parse objects.company.tech — an array of technology identifiers suitable for strict matching (e.g., "omniture_adobe_analytics").

PHP implementation

This snippet posts a domain to the Tech Stack endpoint, handles a basic timeout, and normalizes the tech list for downstream processing.

<?php
function fetchKlazifyTech(string $domainOrUrl, string $apiKey, int $timeoutMs = 5000): array {
    $payload = json_encode(['url' => $domainOrUrl], JSON_UNESCAPED_SLASHES);

    $ch = curl_init('https://www.klazify.com/api/domain_tech');
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POST => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . $apiKey,
            'Content-Type: application/json'
        ],
        CURLOPT_POSTFIELDS => $payload,
        CURLOPT_CONNECTTIMEOUT_MS => $timeoutMs,
        CURLOPT_TIMEOUT_MS => $timeoutMs
    ]);

    $raw = curl_exec($ch);
    $errno = curl_errno($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    if ($errno !== 0) {
        // Network error: not billed per Klazify policy on failed/unreachable calls.
        return ['ok' => false, 'error' => 'network_error', 'tech' => []];
    }

    if ($httpCode < 200 || $httpCode >= 300) {
        // Non-success HTTP. Avoid retries on 4xx unless you validate input.
        return ['ok' => false, 'error' => 'http_' . $httpCode, 'tech' => []];
    }

    $json = json_decode($raw, true);
    if (!is_array($json)) {
        return ['ok' => false, 'error' => 'invalid_json', 'tech' => []];
    }

    $tech = [];
    if (isset($json['objects']['company']['tech']) && is_array($json['objects']['company']['tech'])) {
        // Normalize technology identifiers to lowercase for matching
        foreach ($json['objects']['company']['tech'] as $t) {
            if (is_string($t) && $t !== '') {
                $tech[] = strtolower($t);
            }
        }
    }

    return ['ok' => true, 'tech' => $tech, 'raw' => $json];
}

// Example usage:
$result = fetchKlazifyTech('https://cbsnews.com', 'YOUR_API_KEY');

if ($result['ok']) {
    // Store in cache keyed by effective domain, e.g., cbsnews.com
    // Then apply your policy: block/allow or enrich.
    foreach ($result['tech'] as $id) {
        // Example match: if ($id === 'omniture_adobe_analytics') { ... }
        // Map $id to your internal categories as needed.
    }
} else {
    // Log and schedule retry if appropriate.
}

Node.js example and reading the tech array

If you’re prototyping or building tooling, here’s a minimal Node.js example using native fetch (Node 18+). It prints the technology identifiers you’ll feed into your policy engine.

import fetch from 'node-fetch';

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

  if (!res.ok) {
    console.error('HTTP error', res.status);
    return [];
  }

  const data = await res.json();
  const tech = (data?.objects?.company?.tech ?? []).map(t => String(t).toLowerCase());
  return tech;
}

const tech = await getTech('https://cbsnews.com', 'YOUR_API_KEY');
console.log('Detected technologies:', tech);

To validate your parser and see additional enrichment fields, use the official sample below.

Official sample response and fields you’ll use


{
    "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 for tech stack workflows:

  • objects.company.tech: Array of technology identifiers. Use these for precise allow/block rules and vendor-level analytics.
  • domain.categories[]: Optional categories you can map to IAB or your taxonomy when running brand safety and contextual operations alongside tech detection.
  • domain.logo_url: Helpful for CRM enrichment and UI presentation.
  • similar_domains: Useful for competitive or cluster analysis.

How to act on the returned technology identifiers

Each entry in objects.company.tech is a machine-friendly identifier (e.g., "omniture_adobe_analytics"). Build a policy layer that maps these to your preferences:

  • Blocklist: Disallow domains that use certain ad networks or analytics vendors before a campaign runs.
  • Whitelist: Approve only domains running a set of vetted frameworks or CDNs.
  • Enrichment: Append detected tech fields to company or lead records to route to the right sales playbook.
  • Alerting: Notify when a monitored partner adds or removes a third-party script.

For consistency across systems, store the raw tech ID alongside your normalized label (e.g., "analytics:adobe_analytics") to avoid ambiguity and simplify future reprocessing.

Batching, rate limits, and throughput

When classifying large domain lists:

  • Batch in small groups per second to stay within rate limits. If you don’t know your ceiling, implement an adaptive limiter and monitor response times.
  • Pipeline: Queue new domains, dedupe by registered domain, and drain workers with a concurrency cap.
  • Backoff: On transient errors (network timeouts), apply exponential backoff with jitter. Avoid retrying 4xx errors without input changes.
  • Parallelize responsibly: Keep concurrent connections bounded to protect latency and stability.

Failed or unreachable calls are not billed, but you should still cap retries and log enough context to debug upstream failures.

Caching and freshness

Cache results per registered domain (e.g., example.com) to reduce latency and spend:

  • Recommended TTL: 1–7 days for most ad tech and analytics audits. For highly dynamic partners, shorten TTL.
  • Keying: Normalize to lowercase and strip schemes/subdomains unless your use case specifically needs page-level granularity.
  • Revalidation: When policy-critical vendors are involved, set shorter TTL and proactively refresh for priority domains.

Handling unknown or new domains

If a domain is brand-new or intermittently reachable, you may receive an empty or partial tech array:

  • Soft-fail: Treat as "unknown_tech" and route to manual review or a retry queue.
  • Grace period: For onboarding flows, proceed with reduced privileges until the next refresh populates tech data.
  • Not billed: Network failures and unreachable targets are not billed, so you can safely retry within reason.

Mapping Klazify data to your taxonomy

Two common mappings you may need:

  • Technology taxonomy: Map objects.company.tech identifiers to your internal categories, such as "analytics", "tag_manager", "cdn", "ad_network". Store both the raw and normalized forms.
  • Content categories: When you also call /api/categorize, map domain.categories to your policy classes. IAB-aligned values are included for interoperability.
Source field Example value Internal mapping Action
objects.company.tech omniture_adobe_analytics analytics.adobe_analytics Block if analytics not allowed in region X
objects.company.tech apache_tomcat server.tomcat Enrich infrastructure profile
domain.categories[].name /Internet & Telecom/Mobile & Wireless/Mobile Phones iab.mobile Allow contextual ads for mobile-only campaigns

Quality gates and monitoring

Put lightweight checks around your integration so it remains predictable:

  • Schema guards: Assert that objects.company.tech is an array before processing.
  • Latency SLOs: Track P95 request time and flag spikes. Cache hit rates should grow over time.
  • Drift detection: Alert if a key partner’s tech profile changes (e.g., new ad network added).

Putting it together in your pipeline

Typical flow

  • Deduplicate and normalize incoming domains (lowercase, registered domain).
  • Check cache. If miss, call /api/domain_tech with a modest timeout.
  • On success, persist raw JSON and normalized tech list. Update last_seen timestamp.
  • Evaluate policy: block/allow/enrich based on your mapping rules.
  • Schedule refresh based on TTL and business criticality.

When to also call /api/categorize

  • Brand safety or contextual controls require domain.categories and IAB-aligned mappings.
  • UI/CRM needs logo_url or similar_domains to give users context.

Operational notes you will care about

  • Authentication: Use the Authorization: Bearer header; don’t hardcode keys in client apps.
  • Timeouts: Set both connect and total timeouts to bound tail latencies.
  • Idempotency: Classifying the same normalized domain returns consistent data; cache aggressively.
  • Storage: Save the raw JSON for reprocessing if your taxonomy evolves.
  • Security: Sanitize inputs; accept only valid domain/URL characters.

Next steps

With the PHP and Node.js snippets above, you can drop tech stack detection into ad approval workflows, signup enrichment, partner audits, or security reviews. To move to production, add caching, a retry policy with backoff, and the taxonomy mapping layer described here. You can create a free account to get your key and start testing: Register.

FAQ

  • Can I classify a full URL or just a domain?

    Send either. For caching and policy decisions, prefer the canonical domain unless page-level specificity is required.

  • What does the tech array contain?

    objects.company.tech is an array of machine-friendly technology identifiers detected on the site (e.g., analytics, CDNs, frameworks, ad networks).

  • How do I handle network timeouts?

    Mark the attempt as a soft failure, apply exponential backoff, and retry later. Failed or unreachable calls are not billed.

  • How fresh are results?

    Klazify analyzes live site content. Choose a cache TTL that matches how fast your partner sites change (commonly 1–7 days) and refresh priority domains more often.

  • Where can I see all fields and options?

    Review the Documentation and explore capabilities at MCP.

Ready to use Klazify?

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

Get Started Free