Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:7onez Cti expert Whois Enrich Whois Summary

From Leeroopedia
Knowledge Sources
Domains OSINT, WHOIS
Last Updated 2026-10-28 14:00 GMT

Overview

Concrete tool for enriching a domain with current + history WHOIS data via WhoisXML API with keyless RDAP fallback, provided by the cti-expert WebPivot engine.

Description

The whois_summary function in whois_enrich.py fetches the FULL current + history WHOIS concurrently (two independent WhoisXML calls to halve latency). WITHOUT a key it falls back to keyless RDAP (+ port-43) so registration data lands on every domain regardless. With keep_raw (default) the complete unmodified API responses are archived under out['raw'].

A critical feature is the era-split recomputation: the history block is fetched concurrently with current, so its era split runs without the live created date. Once current is known, the era split is recomputed with the correct created date. The function also backfills from CLD WHOIS for .vn (WhoisXML has no coverage there) and from RDAP for obscure TLDs — only fills what WhoisXML left empty, never overwrites.

Usage

Import this when you need to:

  • Build the WHOIS registrant spine for a domain (registrar, created, expires, name_servers, registrant email/name/phone).
  • Recover WHOIS history with per-era registrant records for the timeline.
  • Enrich domains keylessly when no WhoisXML key is available.
  • Backfill .vn domains from CLD WHOIS (WhoisXML has no coverage).

Code Reference

Source Location

  • Repository: cti-expert
  • File: intel_engine/WebPivot/tools/whois_enrich.py
  • Lines: L989-1057

Signature

def whois_summary(domain, history_mode="purchase", timeout=40, keep_raw=True):
    """Combined current + history block, ready to attach to a pivot_extract result.
    With a key: fetches FULL current + history. Without: keyless RDAP fallback.
    With keep_raw: archives complete API responses under out['raw']."""

Import

from whois_enrich import whois_summary

I/O Contract

Inputs

Name Type Required Description
domain str Yes Domain to look up
history_mode str No "purchase" (full records) or "preview" (no per-era list)
timeout int No Per-request timeout (default 40)
keep_raw bool No Archive raw API responses (default True)

Outputs

Name Type Description
result dict {registrar, created, expires, name_servers, registrant_*, source, history: {count, registrant_emails, registrant_names, eras, records, mode}, raw: {current, history}}

Usage Examples

With WhoisXML Key

from whois_enrich import whois_summary

# Full current + history (spends WhoisXML credits)
result = whois_summary("example.com", history_mode="purchase")
print(result["registrar"])
print(result["history"]["eras"])        # per-era registrant splits
print(result["history"]["records"])     # per-era record list for timeline

Keyless Fallback

# No WHOISXML_API_KEY set — falls back to RDAP + port-43
result = whois_summary("example.com", timeout=30)
print(result["source"])  # "rdap" or "whoisxml+rdap"
# history will be empty (keyless has no history)

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment