Integrate the Company Industry API in Python
A new user signs up with a company website, but your CRM has no reliable industry or company-size information. With Klazify’s company endpoint and Python, you can submit that website, read the returned company fields, and map its business tags to the segments your team uses for routing and analysis.
Why use domain intelligence for industry enrichment?
A domain is a useful starting point when a signup form does not ask for industry, or when users choose inconsistent labels. Documentation describes Klazify’s domain intelligence capabilities, including company information, business tags, website categorization, and IAB taxonomy mapping.
Klazify analyzes website content rather than relying only on metadata. That can provide useful context when a company’s domain name does not clearly describe its business. Its multilingual analysis also makes it relevant to enrichment pipelines that receive websites from different markets.
For this integration, company tags are the starting point for an industry mapping. Website categories and IAB mappings serve a related but different purpose: they describe content and can support advertising or filtering decisions. Klazify can analyze current website content, but an enrichment result should still be treated as a snapshot rather than a permanent company attribute.
The company endpoint gives a Python application a straightforward REST integration. Submit the website, inspect the company object, and retain enough of the original response to review how an internal industry label was assigned. Unlike a domain-name keyword rule, this approach can use returned business context such as tags and company size.
Send a company lookup
Create an account and obtain an API key before calling the endpoint. The request is a POST to https://www.klazify.com/api/domain_company, with the key in a Bearer authorization header and the website in the JSON url field.
Replace YOUR_API_KEY with your key when running this request:
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"}'
Keep the API key on your server or in a secrets manager rather than embedding it in client-side code. The website is the input to the lookup; the returned company information is enrichment data, not proof that the person signing up works for that company.
Call the endpoint from Python
This example uses Python’s standard library. Set KL_API_KEY to your API key and DOMAIN_URL to the website you want to enrich, then run the script in an environment that can reach the API.
import json
import os
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
api_key = os.environ["KL_API_KEY"]
website = os.environ["DOMAIN_URL"]
payload = json.dumps({"url": website}).encode("utf-8")
request = Request(
"https://www.klazify.com/api/domain_company",
data=payload,
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
method="POST",
)
try:
with urlopen(request, timeout=10) as response:
result = json.load(response)
except HTTPError as exc:
raise RuntimeError(f"Company lookup failed: HTTP {exc.code}") from exc
except URLError as exc:
raise RuntimeError("Company lookup could not reach the API") from exc
except (TimeoutError, json.JSONDecodeError) as exc:
raise RuntimeError("Company lookup timed out or returned invalid JSON") from exc
if result.get("success") is False:
raise RuntimeError("Company lookup did not succeed")
objects = result.get("objects") or {}
company = objects.get("company") or {}
if not company:
print("No company information returned; retain for review.")
else:
fields = (
"name",
"city",
"stateCode",
"countryCode",
"employeesRange",
"revenue",
"raised",
"tags",
)
for field in fields:
print(f"{field}: {company.get(field)}")
The timeout is a local client setting, not an API guarantee. The script treats a missing company object as a review case and uses get so that an absent field does not stop the rest of the enrichment. In production, send the selected fields to your CRM or data store instead of printing them.
Separate request failures from successful lookups that lack usable company data. A network error may be retryable; an empty company object is a data-quality outcome that may need a later lookup or human review. Avoid logging the authorization header when recording failures.
Read the company fields and related signals
The following documented response illustrates the broader Klazify response structure. It includes company information alongside categorization and other domain signals; the fields returned for an individual company lookup can vary. It should not be read as the response to the request above.
{
"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"
]
}
For a CRM enrichment workflow, start with objects.company. The name field can help identify the organization, while city, stateCode, and countryCode provide location context. Keep the original values alongside your normalized CRM fields so that a reviewer can trace any transformation.
employeesRange is a size band, not an exact employee count. The company data includes revenue as a range rather than an exact figure, although the documented example above shows a numeric revenue value. Preserve the returned representation and check its interpretation before using it in financial calculations; the example does not establish a currency or a unit.
raised is null in the example. Treat that as unavailable information, not as evidence that the company raised nothing. Apply the same distinction to missing fields and empty tag lists: unknown data should not silently become a negative answer.
The tags array provides business labels that can inform your own industry assignment. In this example, Consumer Electronics is relevant to an industry-oriented segment, while B2C is useful as a business-model label. A company can have several tags, so avoid assuming that the first tag is its single definitive industry.
The separate domain.categories array describes website content. Its entries can include a category name, a confidence value, and an IAB mapping. Those signals can help an ad-placement audit or content-filtering workflow, but a content category is not automatically interchangeable with a company’s CRM industry.
Map results into a production pipeline
Define a mapping before enriching records
Start with the industry labels your CRM already supports. Create a versioned mapping from returned tags to those labels, and decide whether your application permits multiple industries or needs one primary segment. For example, your team might map the returned Consumer Electronics tag to its own equivalent industry label while storing B2C separately.
Keep unmapped tags in the source record rather than discarding them. Route records with no applicable tag to an “unknown” or review state in your own system, and measure how often that happens. When you revise the mapping, retaining the raw tags lets you reprocess existing records without necessarily making another API call.
Use category confidence as a decision input only when categories are present; do not treat it as a company-level accuracy guarantee. For a filtering or advertising decision, define a separate policy for the relevant website categories and review borderline or missing results. Categorization can assist those decisions, but it does not by itself establish compliance or identify a malicious site.
Control throughput and reuse results
For signup enrichment, place lookups on a background queue if the signup flow should not wait for an external request. Store the signup immediately, then attach enrichment when the lookup completes. If the result affects immediate routing, define what happens when the request fails or takes longer than your application can wait.
For a backfill, group work in your own queue and control concurrency rather than launching a request for every CRM record at once. Check your account’s current rate limits and plan terms before choosing worker settings. Reduce concurrency when requests are throttled, and use bounded retries with backoff for transient failures.
Cache results per normalized domain so repeated signups from the same company can reuse an existing lookup. Store the lookup time, the source response or relevant source fields, and the mapping version with the cached record. Choose a refresh policy based on how quickly your company data needs to change; cached information can become stale when a website or business changes.
Normalize domains consistently before using them as cache keys, but retain the original submitted URL for troubleshooting. A domain-level cache is appropriate for company enrichment; it may not be appropriate for a separate page-level content classification workflow, where different URLs on the same site can discuss different topics.
Handle unknown and unreachable sites
New domains, unavailable websites, and incomplete company profiles need an explicit path through the pipeline. Mark the enrichment as pending or unknown, preserve the submitted website, and allow a later retry or manual correction. Do not assign a default industry merely to fill a required CRM field.
Klazify states that failed or unreachable calls are not billed. That does not remove the need to monitor errors: repeated failures can still delay enrichment and consume worker capacity. Track request failures separately from successful responses with missing fields, so operations teams can distinguish connectivity problems from data gaps.
For teams also building assistant-driven workflows, MCP provides another place to explore integration options. The Python example above remains a direct REST request and does not require an assistant workflow.
FAQ
Can I assign an industry from one returned tag?
You can map a tag to an internal industry when your business rules support it, but keep the original tags and handle multiple or unmapped values. Review the mapping with the people who use the resulting CRM segments.
What should I do if company information is missing?
Keep the record and its submitted website, mark enrichment as unknown or pending, and retry later where appropriate. Missing information is not the same as a confirmed absence of employees, revenue, funding, or industry.
Can I use website categories as company industries?
Not automatically. Website categories describe content, while company tags provide business context. Use separate mappings for content policies and CRM industries, even when a category and a tag have similar names.
How should I budget for testing?
The Starter plan is $39.99 per month with a 7-day trial, and failed or unreachable calls are not billed. Check current account terms and limits before running a large backfill.
Ready to enrich your first domain? Register for a free account, obtain an API key, and connect the Python request to your signup or CRM pipeline.
Ready to use Klazify?
Start classifying websites, enriching company data, and exploring web intelligence.
Get Started Free