# Demographic Similarity

> Demographic Similarity is a paid API for AI agents from agent-vending-production.up.railway.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-11).

Find the U.S. places most demographically similar to a target geography using multivariate Census statistics.

## Facts

- Endpoint: POST https://agent-vending-production.up.railway.app/v1/demographic-similarity?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/demographic-similarity-43db264b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pmISBC2gWGYfx9W7MJfR8

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability demographic-similarity-43db264b -d '<json body>'
```

Example prompt: Find the 10 U.S. counties most demographically similar to Ventura County, California — search across all U.S. counties.

## When to prefer this

Use this endpoint when you need to find peer or comparable geographies based on multivariate demographic profiles from Census data. Ideal for market research, site selection benchmarking, policy analysis, or identifying expansion targets. Prefer this over a generic demographic lookup when the core question is 'what places are most like X?' rather than 'what are the demographics of X?'

## Known failure modes

- Target geography name not found or ambiguous — requires state disambiguation or GEOID
- Universe type mismatch with target geography type (e.g. asking for STATE_COUNTIES with a place target)
- Census tract not found without proper state and county context
- top_n out of range (must be 1–25)
- Invalid state postal code or FIPS code
- GEOID format mismatch (county=5 digits, place=7 digits, tract=11 digits)

## How this service works

Pay-per-call machine utilities for autonomous agents.

## Output

A ranked list of up to 25 U.S. geographies (counties, places, states, ZCTAs, or tracts) most demographically similar to the target geography, ordered by multivariate Census similarity score. Each result typically includes the geography name, GEOID, and a similarity metric derived from Census demographic variables.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "state": {
   "type": "string",
   "description": "State for STATE_* universes (default: target state)"
  },
  "top_n": {
   "type": "integer",
   "maximum": 25,
   "minimum": 1,
   "description": "Default 10"
  },
  "target": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "name": {
     "type": "string",
     "description": "e.g. \"Ventura County\", \"Thousand Oaks\", \"91362\", \"CA\", tract code"
    },
    "type": {
     "enum": [
      "state",
      "county",
      "place",
      "zcta",
      "tract"
     ],
     "type": "string"
    },
    "geoid": {
     "type": "string",
     "description": "Census GEOID alternative to name (county 5, place 7, tract 11 digits)"
    },
    "state": {
     "type": "string",
     "description": "State name, postal code or FIPS (county/place/tract by name)"
    },
    "county": {
     "type": "string",
     "description": "County name or FIPS (tract only)"
    }
   },
   "description": "Target county, place or state",
   "additionalProperties": true
  },
  "universe": {
   "enum": [
    "US_COUNTIES",
    "STATE_COUNTIES",
    "US_PLACES_10K",
    "US_PLACES_50K",
    "STATE_PLACES_10K",
    "US_STATES"
   ],
   "type": "string",
   "description": "Peer universe of the same geography type (default by target type)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "method": {
   "primary": "shrinkage_mahalanobis",
   "shrinkage_intensity": 0.003299,
   "covariance_estimator": "ledoit_wolf_scaled_identity"
  },
  "status": "OK",
  "target": {
   "name": "Ventura County, California",
   "geoid": "06111",
   "geo_type": "county"
  },
  "matches": [
   {
    "rank": 1,
    "distance": 0.967103,
    "geography": {
     "name": "Napa County, California",
     "geoid": "06055"
    },
    "similarity_score": null,
    "category_contributions": {
     "demographics": {
      "share": 0
     }
    },
    "top_difference_contributors": [
     {
      "metric": "median_age",
      "match_value": 42.8,
      "target_value": 39.4
     }
    ],
    "top_similarity_contributors": [
     {
      "metric": "foreign_born_pct",
      "match_value": 22.1,
      "target_value": 21.9
     }
    ]
   },
   {
    "rank": 2,
    "distance": 1.060634,
    "geography": {
     "name": "Orange County, California",
     "geoid": "06059"
    }
   }
  ],
  "product": "demographic_similarity",
  "universe": {
   "id": "US_COUNTIES",
   "size": 3142,
   "geo_type": "county",
   "self_excluded": true
  },
  "uncertainty": {
   "available": false
  },
  "data_vintage": {
   "label": "ACS 5-Year 2019-2023",
   "dataset": "ACS 5-Year",
   "release_year": 2023
  },
  "feature_bundle": {
   "id": "DEMOGRAPHIC_CORE",
   "version": "1.0"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/demographic-similarity-43db264b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-vending-production.up.railway.app](https://www.zero.xyz/host/agent-vending-production.up.railway.app/llms.txt)
