Watt Data Logo

Retrieve detailed analytics for a single trait, including its top predictors, discriminators, and representative exemplar entities.

Quick Example

{
  "entity_type": "person",
  "trait_id": "1000000001"
}

Input Parameters

ParameterTypeRequiredDefaultConstraintsDescription
entity_typestringYes-"person" or "business"Type of entity
trait_idstringConditional--Trait ID to retrieve
trait_hashstringConditional--Trait hash (stable, persists across rebuilds)
trait_namestringConditional--Trait name (requires domain)
domainstringConditional-See domainsTrait domain (required with trait_name)
analytics_depthnumberNo105-50Number of top results per analytics category
workflow_idstringNo-Valid UUIDWorkflow session identifier

Identification: Provide one of:

  1. trait_id - Direct ID lookup
  2. trait_hash - Stable hash lookup
  3. trait_name + domain - Name-based lookup

Request Schema:

interface TraitGetParams {
  entity_type: "person" | "business";
  trait_id?: string;
  trait_hash?: string;
  trait_name?: string;
  domain?: "purchase" | "demographic" | "intent" | "interest" | "financial" | "firmographic" | "affinity" | "content" | "employment" | "household" | "lifestyle" | "political";
  analytics_depth?: number;
  workflow_id?: string;
}

Output Format

{
  trait: {
    trait_id: string;
    trait_hash: string;
    name: string;
    value: string;
    domain: string;
    size: number;
    prevalence: number;
    predictors: Array<{
      trait_id: string;
      name: string;
      value: string;
      domain: string;
      score: number;
    }>;
    discriminators: Array<{
      trait_id: string;
      name: string;
      value: string;
      domain: string;
      score: number;
    }>;
    exemplars: Array<{
      entity_id: string;
      score: number;
    }>;
  },
  tool_trace_id: string,
  workflow_id: string
}

Response Fields:

FieldTypeDescription
traitobjectTrait analytics data
trait.trait_idstringNumeric trait identifier
trait.trait_hashstringStable hash identifier
trait.namestringTrait name
trait.valuestringTrait value
trait.domainstringDomain category
trait.sizenumberNumber of entities with this trait
trait.prevalencenumberPopulation proportion (0-1)
trait.predictorsarrayTop co-occurring traits
trait.discriminatorsarrayMost distinguishing traits
trait.exemplarsarrayRepresentative entity IDs
tool_trace_idstringOpenTelemetry trace ID
workflow_idstringWorkflow session identifier

Example Response:

{
  "trait": {
    "trait_id": "1000000001",
    "trait_hash": "abc123def456",
    "name": "income_range",
    "value": "150000_plus",
    "domain": "demographic",
    "size": 2500000,
    "prevalence": 0.08,
    "predictors": [
      {
        "trait_id": "1000000050",
        "name": "education",
        "value": "graduate_degree",
        "domain": "demographic",
        "score": 0.85
      }
    ],
    "discriminators": [
      {
        "trait_id": "1000000075",
        "name": "luxury_retail",
        "value": "high",
        "domain": "purchase",
        "score": 0.92
      }
    ],
    "exemplars": [
      {
        "entity_id": "123456",
        "score": 0.98
      }
    ]
  },
  "tool_trace_id": "a1b2c3d4e5f6",
  "workflow_id": "550e8400-e29b-41d4-a716-446655440000"
}

Usage Examples

Example 1: Look up by trait ID

{
  "entity_type": "person",
  "trait_id": "1000000001"
}

Example 2: Look up by stable hash

{
  "entity_type": "person",
  "trait_hash": "abc123def456"
}

Example 3: Look up by name + domain

{
  "entity_type": "person",
  "trait_name": "income_range",
  "domain": "demographic"
}

Example 4: Deep analytics

{
  "entity_type": "person",
  "trait_hash": "abc123def456",
  "analytics_depth": 25
}

On this page