Website Classification API for Crime & Justice URLs — quality sample 28 Sep 2026
You need to determine whether a URL belongs to the Crime & Justice category so you can block it for certain audiences, keep ads off sensitive inventory, or enrich a customer’s signup domain inside your CRM. By the end of this guide, you will be able to call Klazify’s categorize endpoint for a Crime & Justice URL, read the returned category fields, make a yes/no decision, and operate this at scale with caching and batching.
Why classify Crime & Justice URLs in real systems
Here are three common, concrete workflows where Crime & Justice classification is required:
- Brand safety: exclude Crime & Justice inventory from ad delivery if your policy avoids legal/crime-related content.
- Content filtering: block Crime & Justice news or resources on corporate networks or in kid-safe environments.
- Enrichment: flag Crime & Justice domains during user signup or lead ingestion to route to the right compliance flow.
Each of these use cases needs the same building block: a fast call that returns whether a domain or URL is categorized as Crime & Justice, plus enough context to log or audit the decision.
Klazify provides a single endpoint to get this answer. You can integrate it directly into your pipeline and cache the results per domain to keep latency low and throughput high. See the Documentation for full request details and field definitions.
Endpoint to call: POST /api/categorize
Use the categorize endpoint with Bearer authorization. Send the URL you want to classify in the JSON body.
Example curl for a Crime & Justice URL
The following request classifies the United States Department of Justice website (a clear Crime & Justice domain):
curl -X POST "https://www.klazify.com/api/categorize" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.justice.gov"}'
This request is copy-pasteable. Replace YOUR_API_KEY with your actual token. The body contains the url you want to inspect. The endpoint responds with categories that you can map into your policy logic (e.g., block if Crime & Justice is present).
What the response looks like and how to read it
The example below is minimal and illustrative. Field names are representative of the categorize response and focus on the category data you will actually consume for Crime & Justice decisions.
{
"domain": "justice.gov",
"categories": ["Crime & Justice"]
}
How to use these fields:
- domain: Normalize and cache by this string (e.g., justice.gov). You will use it as the cache key and for logging.
- categories: Check if "Crime & Justice" is present. If yes, apply your blocking, exclusion, or enrichment workflow.
If you maintain a custom taxonomy, store the returned category list alongside your mapping table. For example, map "Crime & Justice" to your internal tag crime_justice and persist both for transparency and audits.
Python example: turn Crime & Justice into a yes/no decision
Below is a small Python snippet that calls the categorize endpoint, checks the returned categories, and emits a boolean decision for the Crime & Justice policy.
import json
import os
import requests
from urllib.parse import urlparse
API_KEY = os.getenv("KLAZIFY_API_KEY", "YOUR_API_KEY")
API_URL = "https://www.klazify.com/api/categorize"
CRIME_JUSTICE_LABEL = "Crime & Justice"
def normalize_domain(input_url: str) -> str:
# Normalize to a stable cache key
parsed = urlparse(input_url)
host = parsed.netloc or parsed.path
return host.lower().strip().lstrip("www.")
def classify_crime_justice(input_url: str) -> dict:
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
payload = {"url": input_url}
resp = requests.post(API_URL, headers=headers, data=json.dumps(payload), timeout=10)
resp.raise_for_status()
data = resp.json()
# Expected minimal structure; handle unknowns safely
domain = data.get("domain") or normalize_domain(input_url)
categories = data.get("categories") or []
is_crime_justice = CRIME_JUSTICE_LABEL in categories
return {
"domain": domain,
"categories": categories,
"is_crime_justice": is_crime_justice,
"decision": "block" if is_crime_justice else "allow"
}
if __name__ == "__main__":
result = classify_crime_justice("https://www.justice.gov")
print(json.dumps(result, indent=2))
Drop this function into your enrichment or policy service. In production, add retries for transient HTTP errors and cache the result keyed by the normalized domain to avoid repeated API calls for the same site.
Making policy decisions for Crime & Justice
Once you have the category, the decision is typically straightforward. However, you will probably want to make the logic explicit and auditable:
- Blocklist approach: If categories contains "Crime & Justice", block or exclude. Otherwise, allow.
- Allowlist approach: Allow only categories you explicitly approve; treat all others, including Crime & Justice, as restricted.
- Enrichment tags: For lead/company enrichment, tag the account as crime_justice and route through a legal/compliance review.
Keep a decision log that includes request time, normalized domain, returned categories, and final action. This helps with downstream audits, especially when explaining why ad delivery or content access was blocked.
How to operate at scale
As soon as you move beyond a single URL check, the operational details matter. The following practices keep your integration fast, cost-effective, and predictable.
Caching results per domain
- Cache key: Use the normalized domain (strip protocol, ports, and leading www.).
- Cache TTL: Set a TTL that balances freshness and efficiency. Many teams start with days-to-weeks for categorization unless policy requires faster recrawls.
- Scope: Cache at the eTLD+1 (e.g., justice.gov) if your policy applies across subdomains consistently. If not, key by full host.
Handling unknown or new domains
- Fallback policy: If categories are empty or unavailable, choose a safe default (e.g., “allow with monitoring” or “temporarily block until classified”).
- Requeue: Put unknowns into a background job to retry classification later and backfill your cache.
- Observability: Emit a metric for unknown classifications so you can alert if the rate spikes (e.g., new signups or referral spam).
Batching and throughput
- Batching: If your ingestion pipeline receives many URLs at once (e.g., daily ad inventory audits), aggregate by domain and deduplicate before calling the endpoint.
- Concurrency: Use a modest worker pool and exponential backoff on HTTP 429/5xx responses. Respect guidance in the Documentation for request best practices.
- Idempotency: Treat retries as idempotent reads. Your cache layer can short-circuit duplicates during spikes.
Error handling and resilience
- Timeouts: Set client-side timeouts and surface partial failures to your logs with domain context.
- Circuit breaking: If upstream latency rises, serve cached results and delay recomputations.
- Auditability: Persist the last known categories per domain with a timestamp to replay decisions.
Mapping Klazify categories to your internal taxonomy
Many organizations already have a policy vocabulary. To connect it with Klazify’s category value for Crime & Justice, introduce a small mapping table. Keep it versioned so you can roll updates without changing application code.
| Klazify category | Your internal tag | Policy action | Notes |
|---|---|---|---|
| Crime & Justice | crime_justice | block or review | Tag consistently for reporting and audit logs |
For multi-label cases (if a domain can be assigned multiple categories), your mapping can either be “any match blocks” or “priority-ordered.” If you prioritize Crime & Justice as sensitive, check it first and short-circuit the decision when present.
Integrating into pipelines: ad tech, filtering, and enrichment
Different teams wrap the same categorize call into different systems. The scaffolding is similar across them:
- Ad tech: Build a pre-bid or pre-flight step that resolves the landing page to a normalized domain, looks up the category, and filters out Crime & Justice inventory before spending.
- Content filtering: Insert a proxy or middleware layer that classifies the requested host and blocks Crime & Justice with a user-facing reason code.
- Lead enrichment: On form submit or list imports, call categorize, tag Crime & Justice prospects, and route to compliance review queues.
The operational levers (cache, retries, and mapping) remain the same. What changes is the action taken once you detect Crime & Justice.
Security, governance, and audit readiness
Treat category-based decisions as policy decisions. Store an immutable record that includes:
- Normalized domain
- Returned categories
- Decision taken (block/allow/review)
- Timestamps and the service or user that triggered the decision
This record makes it straightforward to justify why an ad never served on a Crime & Justice site or why a user’s access was limited to internal reviewers.
Going from prototype to production
Here is a pragmatic checklist to move from the examples above to a production deployment:
- Implement the POST /api/categorize call with Bearer auth, plus retry/backoff.
- Normalize domains consistently and cache results with a TTL aligned to your policy refresh needs.
- Encode your mapping from “Crime & Justice” to your internal tag and decision rule.
- Add metrics: request rate, latency, error rate, cache hit rate, and unknown-category count.
- Wrap the decision in an audit log and include the categories in user-visible explanations if applicable.
If you also need company data, logos, or social links in the same workflow, review the broader platform overview at Klazify and integrate additional endpoints as needed.
Why this approach is predictable for Crime & Justice detection
The core benefit of the categorize endpoint for Crime & Justice use cases is that you reduce your logic to a small, deterministic set of steps: normalize, lookup, map, decide. Everything else—batching, caching, retries—wraps around those steps and is infrastructure you already operate in other parts of your stack.
Because Crime & Justice is often treated as a sensitive category for brand and legal reasons, keeping this logic tight and auditable is usually more important than adding complex heuristics. Start simple: if categories contains “Crime & Justice,” take your configured action and log it.
Next steps
Set up an account and run the curl from this article in your environment. Then integrate the Python function in your pipeline and wire in your caching layer. You can explore advanced fields and options in the Documentation and assess model behavior with the MCP. When you are ready, create your free account here: Register.
FAQ
Does categorization work on both domains and full URLs?
Yes. Send the url in the request body. Your normalization step can standardize to a domain for caching, but you can pass a full URL to the endpoint.
How should I treat subdomains (e.g., news.justice.gov)?
If your policy applies to the entire site, cache and key by eTLD+1 (justice.gov). If subdomains vary in content, key by full host and keep separate cache entries.
What should I do if the response has no categories?
Apply your fallback policy (temporary allow or block), log the event, and schedule a retry. Keep a metric for unknown classifications so you notice anomalies.
Can I map Crime & Justice to my own categories?
Yes. Maintain a simple mapping table from Klazify’s category string to your internal policy tags. Version the mapping and store both values in your logs for audits.
How do I minimize latency in production?
Cache by normalized domain with a sensible TTL, deduplicate inputs before calling the endpoint, and use a small concurrent worker pool with backoff for spikes.
Ready to use Klazify?
Start classifying websites, enriching company data, and exploring web intelligence.
Get Started Free