How to Get Estimated Revenue in PHP
You need to take an email signup, a referral URL, or a list of domains, look up the associated company, and store an estimated revenue range—then use that data to qualify leads, route accounts, or flag large prospects automatically. By the end of this guide, you’ll be able to call Klazify’s company data endpoint, extract a revenue range plus headcount and location, and plug those fields into your PHP-centric pipeline without slowing it down.
Why Klazify for extracting estimated revenue from a domain
Estimating revenue from a domain is only valuable if the data is accurate, current, and easy to automate. Klazify was built to analyze real website content and unify it with business attributes so you can enrich domains at scale.
- Accurate website-driven company profiling: Klazify analyzes live site content and signals, letting you tie a domain to the right company and retrieve business attributes like employeesRange and revenue.
- Global coverage: Works across many languages and regions, so one integration can enrich domains from your entire funnel.
- Real-time analysis: Data is derived from current site content and refreshed, helping you avoid stale mappings between domains and businesses.
- IAB taxonomy alignment: When you also need categorization for brand safety or routing, categories are mapped to IAB, so the same call can power multiple use cases.
- Simple REST integration: A single POST with a URL gives you the company object fields you need (name, city, stateCode, countryCode, employeesRange, revenue, raised, tags).
- Compliance and filtering: Combine revenue ranges with categories and tags to qualify, suppress, or route domains in ad tech, content filtering, or CRM enrichment flows.
If your workflow is PHP-based, the API remains language-agnostic and straightforward to call. You can manage authentication and JSON parsing with standard PHP libraries and still benefit from Klazify’s domain intelligence capabilities. Explore more at Documentation.
What you’ll build: enrichment with a revenue range you can act on
The workflow below lets you post a domain to Klazify, parse the company block, and persist the revenue range along with employeesRange, tags, and location. You can then:
- Score new signups: Prioritize accounts with larger revenue ranges and employee bands.
- Route leads: Send high-revenue prospects to enterprise SDRs while auto-nurturing small businesses.
- Segment datasets: Split cohorts by employeesRange and tags to tailor onboarding or outreach.
We’ll use the company data endpoint and show how to connect the response to your data model, including guardrails for unknowns and caching for scale.
The endpoint you need and the fields to persist
Use the company data endpoint to enrich a domain with business attributes:
- HTTP method: POST
- Endpoint: https://www.klazify.com/api/domain_company
- Auth: Bearer token in the Authorization header
- Body: JSON with the url you want to classify/enrich
The response’s company object includes the following fields (store what you need for your pipeline):
- name: Company name
- city, stateCode, countryCode: Location fields
- employeesRange: A size band such as “1-10”, “11-50”, “100K+”
- revenue: An estimated revenue range (store it as-is to avoid rounding or precision issues)
- raised: Capital raised (if applicable)
- tags: Business-relevant descriptors derived from the site
Make a request
Below is a copy-pasteable curl request using a sample URL. Replace YOUR_API_KEY with your token and change the url value for your target domains.
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:
- Use HTTPS and a JSON body with a single url value per request for simple integrations. For batch processing, loop over your list and apply caching (explained below).
- Failed or unreachable calls are not billed.
Code you can adapt (JavaScript) and how to use the fields
This JavaScript example posts a domain to the company endpoint and extracts business fields that matter for qualification, scoring, and routing. You can call the same endpoint from PHP (see the PHP sketch further below) using the same headers and JSON payload.
async function fetchCompanyFromDomain(domainUrl) {
const response = await fetch("https://www.klazify.com/api/domain_company", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({ url: domainUrl })
});
if (!response.ok) {
// Non-2xx status: log and decide whether to retry or skip
throw new Error(`Klazify error: ${response.status} ${response.statusText}`);
}
const data = await response.json();
// Defensive parsing: only reference fields if present
const company = data && data.objects && data.objects.company ? data.objects.company : null;
if (!company) return null;
// Extract the attributes you will persist
const result = {
url: company.url || domainUrl,
name: company.name || null,
city: company.city || null,
stateCode: company.stateCode || null,
countryCode: company.countryCode || null,
employeesRange: company.employeesRange || null,
revenue: company.revenue || null, // Treat as a range. Store as string if returned as "10M-50M"
raised: company.raised || null,
tags: Array.isArray(company.tags) ? company.tags : []
};
return result;
}
// Example usage
fetchCompanyFromDomain("https://cbsnews.com")
.then(data => {
if (!data) {
console.log("No company object returned.");
return;
}
// Example routing logic:
// - If employeesRange indicates a large org or revenue is in your enterprise band, escalate
// - Otherwise, assign to SMB queue
console.log("Company enrichment:", data);
})
.catch(err => {
console.error(err);
});
Recommended handling in your pipeline:
- Store revenue exactly as returned by the API (it is an estimated range). Avoid casting to numeric if it’s a range string.
- Normalize employeesRange to a bounded set you support and map to your lead score model.
- Persist raised and tags for future segmentation and audience building.
Official example response and how to read it
Below is an official example JSON response structure you should expect when using Klazify. It includes categorization and a company object so you can see where to read company fields like revenue, employeesRange, and tags. Do not modify this sample when testing your parsers.
{
"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"
]
}
Fields you’ll actually use for enrichment:
- objects.company.name: For CRM Account or Company Name.
- objects.company.employeesRange: For lead score and routing.
- objects.company.revenue: For estimated revenue handling. In the company data endpoint discussed above, revenue is returned as a range—store as provided.
- objects.company.tags: For segmenting accounts by business theme.
- objects.company.city, stateCode, countryCode: For territory routing and geo segmentation.
PHP-centric integration notes
Even if your backend is PHP, the same request structure applies. Here’s a minimal PHP sketch you can adapt. Keep robust error handling, timeouts, and retries based on your environment.
<?php
$ch = curl_init("https://www.klazify.com/api/domain_company");
$payload = json_encode(["url" => "https://cbsnews.com"]);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 20
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_errno($ch)) {
// Network error: log and decide whether to retry
error_log("cURL error: " . curl_error($ch));
}
curl_close($ch);
if ($httpCode >= 200 && $httpCode < 300) {
$data = json_decode($response, true);
$company = $data["objects"]["company"] ?? null;
if ($company) {
$record = [
"url" => $company["url"] ?? null,
"name" => $company["name"] ?? null,
"city" => $company["city"] ?? null,
"stateCode" => $company["stateCode"] ?? null,
"countryCode" => $company["countryCode"] ?? null,
"employeesRange" => $company["employeesRange"] ?? null,
"revenue" => $company["revenue"] ?? null, // treat as a range string if returned as such
"raised" => $company["raised"] ?? null,
"tags" => $company["tags"] ?? []
];
// Persist $record to your DB
}
} else {
// Non-2xx responses: decide on retry/backoff
error_log("Klazify HTTP $httpCode: $response");
}
Implementation tips:
- Timeouts: Set sensible timeouts (e.g., 10–20s) and a retry strategy for transient network failures.
- JSON parsing: Treat revenue as a non-numeric range in your schema so you can store both lower and upper bounds when present.
- Idempotency: De-duplicate by normalized domain (lowercase, strip scheme and path) before calling the API.
How to use the returned revenue range
Because revenue is an estimated range rather than an exact figure, plan for flexible mapping to your internal tiers. A common approach is to store the raw range string and also map it to your internal band identifiers for scoring.
- Store-as-returned: Keep the original range string verbatim in your data warehouse.
- Map-to-tier: Use a lookup table to convert ranges into internal tiers for consistent lead scoring, e.g., “RANGE_1”, “RANGE_2”.
- Automation: Use the tier to power CRM workflows (assignment rules, SLAs, sequences).
Field selection: what to persist and why
| Field | Why it matters | Common usage |
|---|---|---|
| name | Human-friendly company label | CRM Account.Name |
| employeesRange | Proxy for company size | Lead score, routing to SMB/Enterprise |
| revenue | Estimated revenue band | Account tiering, pricing guidance |
| raised | Signals stage and growth | Prospecting and nurturing |
| tags | Immediate business descriptors | Segmentation, targeting, suppression rules |
| city/stateCode/countryCode | Territory and compliance | Geo-routing, localization |
Operational details that will save you time
Caching and TTLs
- Cache by registrable domain (e.g., example.com) for 7–30 days, depending on your data freshness requirements.
- Invalidate sooner if you detect material changes (e.g., significant content change or major rebrand).
Batching and throughput
- For large lists, distribute requests across workers and respect backoff on non-2xx responses.
- Persist interim states (queued, processing, enriched, failed) to make retries idempotent and observable.
Unknown or new domains
- If a domain returns minimal fields or no company object, store a null company_id and a “pending” status to retry later.
- Provide a manual review queue for high-value leads when enrichment is inconclusive.
Latency and UX
- Avoid blocking user-facing flows. For signups, queue enrichment post-submit and update the CRM asynchronously.
- Show optimistic UI and reconcile later with enriched data from your background job.
Mapping to your taxonomy
- When you also use categorization, map returned IAB categories to your internal categories via a lookup table maintained in your codebase or DB.
- Keep mappings versioned so downstream analytics stay reproducible.
Adding categorization alongside revenue
If your use case spans both enrichment and brand safety (or contextual targeting), combine the company data with categorization. The example response above shows how categories come with confidence scores and IAB taxonomy mapping keys. That lets you:
- Block or allow based on category while still logging employeesRange and revenue for analytics.
- Create audience segments by tags and IAB categories for targeted onboarding or ad placement.
Error handling and billing notes
- Non-2xx responses: Log status and body, then apply exponential backoff for transient errors.
- Network timeouts: Retry a limited number of times with jitter.
- Billing: Failed or unreachable calls are not billed, so implement clear success/failure accounting in your job logs.
Environment management and observability
- Keep your API token in environment variables or a secret manager.
- Emit metrics: requests, successes, failures, median/95th latency, and cache hit rates.
- Write structured logs for each call, including the normalized domain and whether enrichment filled revenue/employeesRange.
Pricing and getting started quickly
You can start enriching domains with the Starter plan at $39.99/mo and a 7-day trial. Create your token and start testing in minutes. Use this link to Register. You can also explore account controls and models in the MCP.
Quality checks before shipping
- Schema: Ensure your database supports revenue as a string (range) and employeesRange as a string or enumerated type.
- Normalization: Lowercase and canonicalize domains before calling the API to avoid duplicates.
- Retry policy: Backoff on non-2xx codes and stop after a small number of attempts to avoid unnecessary load.
- Caching: Implement domain-level caching to reduce latency and cost for frequently seen domains.
Putting it together in your pipeline
- Receive a domain from a signup form, referral param, or CSV.
- Normalize the domain and check your cache/DB for a recent enrichment.
- If a fresh record doesn’t exist, POST to https://www.klazify.com/api/domain_company with your token.
- On success, upsert the company record with name, employeesRange, revenue, raised, city, stateCode, countryCode, and tags.
- Map revenue and employeesRange to your scoring and routing tiers.
- Log latency and any fields that were missing to tune your retry strategy.
- Asynchronously update CRM and analytics stores; avoid blocking user flows.
FAQ
Does Klazify return an exact revenue number?
No. The company data endpoint returns an estimated revenue range. Store it as-is and map ranges to your internal tiers.
How should I handle domains without enough data?
Treat them as pending. Cache the attempt, schedule a retry, and optionally route high-value leads for manual review.
Can I enrich both revenue and categories in one integration?
Yes. Use the company object for revenue and employeesRange, and use domain categories (with IAB mapping) when you also need filtering or targeting. Both are available from Klazify’s API responses.
What about batch processing and rate limits?
Distribute calls across workers, implement backoff on non-2xx, and add caching to minimize repeated lookups. Consult the Documentation for endpoint behavior and best practices.
Are failed calls billed?
Failed or unreachable calls are not billed.
Ready to enrich domains with estimated revenue and size in your PHP workflow? Create your API key and start testing now: Register. For full specs and response formats, see the Documentation.
Ready to use Klazify?
Start classifying websites, enriching company data, and exploring web intelligence.
Get Started Free