Relate two sets of locations (free)
relate_locationsFree. How one set of places relates to another, by straight-line distance. The base set is the usual dataset / datasets / category plus filters; relate.anchor is the other set, given the same way. Modes: nearest (each base row's k<=3 nearest anchors with miles), count_within (rank base rows by how many anchors are within radius_miles), within_any (base rows with at least one anchor within radius_miles), none_within (base rows with no anchor within radius_miles). Mode next_best (no anchor, needs the base set's state) ranks the candidate NEW sites in that state by how well they match what the base list's own locations typically have nearby, blended with an estimated market capture; every candidate names its matched factors. Mode typically_near answers "who is X typically located near?" — the PROFILE: the kinds of place and brands the base list's locations have nearby far more often than a typical spot (share of locations, lift, average miles), with an answer sentence and a link to the ranked sites; state optional (without one it is computed in the list's top state and the answer says which); a thin sample is said, never sold. Every set (base, anchor) also takes metro (a CBSA code or name) or areas_in (county / ZIP / metro / state ids), like count_locations. Mode near / not_near matches by distance only (near_m metres, default 30) and is how a LIVE public register is compared: give a set as opendata {source, state} instead of a dataset — search_datasets with kind "register" finds the source key. A register is read at the moment you ask, never sold; the answer names its publisher, licence and read time. Returns counts for both sets (rows without coordinates are left out and counted), summary stats, up to 3 preview rows, the price of the full answer (base rows plus the anchor rows named, each at its dataset's per-row rate, one card fee) and how to buy it with query_locations or create_query_checkout using the same arguments. Example: {"dataset": "", "state": "VA", "relate": {"mode": "nearest", "k": 1, "anchor": {"dataset": "", "metro": "Richmond"}}}. Profile: {"dataset": "", "relate": {"mode": "typically_near"}}. Live register: {"dataset": "ymca", "state": "NY", "relate": {"mode": "near", "near_m": 30, "anchor": {"opendata": {"source": "data.ny.gov/cb42-qumz", "state": "NY"}}}}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zip | No | ||
| city | No | ||
| near | No | Distance search on lists with coordinates: ONE of place, zip, lat+lng or points, with radius_miles or drive_minutes (not both). | |
| metro | No | Only rows in one metro area (CBSA): its 5-digit code ("37980") or its name ("Philadelphia", "Philadelphia, PA"). The same as areas_in {"by": "metro", "ids": [code]}. | |
| state | No | ||
| total | No | Base rows wanted, first in answer order | |
| where | No | ||
| county | No | ||
| relate | Yes | Relate each base row to an anchor set. nearest: the k nearest anchors with miles. count_within: rank by anchors within radius_miles. within_any: rows with an anchor within radius_miles. none_within: rows with none. same_place / not_same_place: base rows that are (or are not) the same physical place as a row of each set — same address, or within 60 m sharing a name word — with every region of the overlap counted; N-way with anchors, also and not_also. near / not_near: the same N-way shape matched by DISTANCE ONLY, within near_m metres (default 30) — the rule for a live open-data register given as a set's opendata. next_best: no anchor; needs the base set's state — the candidate sites in that state ranked by how well they match what the base list's own locations typically have nearby, blended with an estimated market capture. typically_near: the PROFILE of the same analysis, no anchor, state optional — what the base list's locations typically have nearby (the signature: each kind of place or brand near at least 15% of them and at least 1.5x as often as near a typical commercial spot), with a link to the ranked sites; without a state it is computed in the list's top state and the answer says which. Under 10 locations the pattern is shown with a thin-sample note and nothing is sold. Straight-line miles, or real drive time with within_drive_minutes (5-60) on count_within / within_any / none_within, capped at 60 base rows. overlap: a TERRITORY question, not a row count — buffer every base row and every anchor row by radius_miles (straight-line, default 3, 1-25), union each into one shape, and answer what share of the base's shape the anchor's shape covers, plus each base row's own share (lowest first finds the whitespace rows with no nearby anchor territory). Free: the shares, the two territories in square miles and the headline percentage. Paid: the base rows with their own share, at that list's per-row rate. | |
| dataset | No | ||
| exclude | No | Dataset slugs left out wherever the set expands: a category minus one of its members (a list's competitors are its own category with itself excluded). | |
| areas_in | No | Only rows in these areas, e.g. {"by": "county", "ids": ["51760"]} for Richmond city, VA — the ids count_by_area returns, placed the same way (/find: areas_in=county:51760). | |
| category | No | ||
| datasets | No | ||
| opendata | No | INSTEAD of dataset / datasets / category: a public register read LIVE from the body that publishes it, at the moment of the question — e.g. a state's licensed child-care programs. Matched by distance only (relate.mode near / not_near, near_m metres, default 30), because the publisher's own coordinates are the evidence. It is not a list we sell: the answer gives counts and a preview, names the publisher, the licence and when it was read, and prices only the rows of OUR lists. E.g. {"dataset": "ymca", "state": "NY", "relate": {"mode": "near", "near_m": 30, "anchor": {"opendata": {"source": "data.ny.gov/cb42-qumz", "state": "NY"}}}}. | |
| area_where | No | Only rows whose county/zip/state/metro meets a Census condition, each as "<kind>:<attribute><op><value>" (ops > >= < <= =; values accept 1M, 250k, $50,000, 10%), e.g. "county:population>1000000". Every clause must hold; the fact is the area's, not the row's, and it adds nothing to the price. Attributes: population (population), households (households), median_household_income (median household income), median_age (median age), pct_65_plus (share of residents aged 65 or older), pct_bachelors_plus (share with a bachelor's degree or higher), housing_units (housing units), owner_occupied_share (owner-occupied share), median_home_value (median home value), establishments (business establishments), employees (employees), population_estimate (population estimate; county/metro/state only), population_growth_since_2020 (population growth since 2020; county/metro/state only); by NAICS sector, <sector>_establishments and <sector>_employees (employees: county/metro/state only) for agriculture, mining, utilities, construction, manufacturing, wholesale_trade, retail_trade, transportation, information, finance, real_estate, professional, management, administrative, educational_services, health_care, arts, accommodation, other_services; by detailed NAICS industry (1999 codes, 2 to 6 digits, the Census's titles), naics_<code>_establishments (county/metro/state/zip), naics_<code>_employees and naics_<code>_payroll (county/metro/state), e.g. naics_4471_establishments (gasoline stations naics 4471 establishments), naics_8111_establishments (automotive repair and maintenance establishments), naics_238990_establishments (all other specialty trade contractors naics 238990 establishments), naics_561621_establishments (security systems services except locksmiths establishments); 262 nclimdiv fields (NOAA nClimDiv county climate normals, 1991–2020, and 2025 actuals (release 2026-09-04)): january_high (January high), february_high (February high), march_high (March high), april_high (April high), may_high (May high), june_high (June high), …; 190 storms fields (NOAA Storm Events Database, 2016–2025, events a year by county): astronomical_low_tide_events (astronomical low tide events a year), avalanche_events (avalanche events a year), blizzard_events (blizzard events a year), coastal_flood_events (coastal flood events a year), cold_or_wind_chill_events (cold or wind chill events a year), debris_flow_events (debris flow events a year), …; 127 normals-annual fields (NOAA U.S. Climate Normals 1991–2020, annual and seasonal station normals, by county): annual_cooling_degree_days_base_40 (annual cooling degree days base 40), annual_cooling_degree_days_base_45 (annual cooling degree days base 45), annual_cooling_degree_days_base_50 (annual cooling degree days base 50), annual_cooling_degree_days_base_55 (annual cooling degree days base 55), annual_cooling_degree_days_base_57 (annual cooling degree days base 57), annual_cooling_degree_days_base_60 (annual cooling degree days base 60), …; 67 normals-winter fields (NOAA U.S. Climate Normals 1991–2020, annual and seasonal station normals, by county): winter_cooling_degree_days_base_40 (winter cooling degree days base 40), winter_cooling_degree_days_base_45 (winter cooling degree days base 45), winter_cooling_degree_days_base_50 (winter cooling degree days base 50), winter_cooling_degree_days_base_55 (winter cooling degree days base 55), winter_cooling_degree_days_base_57 (winter cooling degree days base 57), winter_cooling_degree_days_base_60 (winter cooling degree days base 60), …; 67 normals-spring fields (NOAA U.S. Climate Normals 1991–2020, annual and seasonal station normals, by county): spring_cooling_degree_days_base_40 (spring cooling degree days base 40), spring_cooling_degree_days_base_45 (spring cooling degree days base 45), spring_cooling_degree_days_base_50 (spring cooling degree days base 50), spring_cooling_degree_days_base_55 (spring cooling degree days base 55), spring_cooling_degree_days_base_57 (spring cooling degree days base 57), spring_cooling_degree_days_base_60 (spring cooling degree days base 60), …; 67 normals-summer fields (NOAA U.S. Climate Normals 1991–2020, annual and seasonal station normals, by county): summer_cooling_degree_days_base_40 (summer cooling degree days base 40), summer_cooling_degree_days_base_45 (summer cooling degree days base 45), summer_cooling_degree_days_base_50 (summer cooling degree days base 50), summer_cooling_degree_days_base_55 (summer cooling degree days base 55), summer_cooling_degree_days_base_57 (summer cooling degree days base 57), summer_cooling_degree_days_base_60 (summer cooling degree days base 60), …; 67 normals-fall fields (NOAA U.S. Climate Normals 1991–2020, annual and seasonal station normals, by county): fall_cooling_degree_days_base_40 (fall cooling degree days base 40), fall_cooling_degree_days_base_45 (fall cooling degree days base 45), fall_cooling_degree_days_base_50 (fall cooling degree days base 50), fall_cooling_degree_days_base_55 (fall cooling degree days base 55), fall_cooling_degree_days_base_57 (fall cooling degree days base 57), fall_cooling_degree_days_base_60 (fall cooling degree days base 60), …; 15 hourly fields (NOAA U.S. Climate Normals 1991–2020, hourly station normals summarised over the year, by county): hourly_temperature (round the clock temperature), dew_point (dew point), sea_level_pressure (sea level pressure), cooling_degree_hours (cooling degree hours), heating_degree_hours (heating degree hours), clear_sky_share (share of clear hours), …; 51 b01001 fields (U.S. Census Bureau, ACS 2020–2024 5-year estimates): pct_under_18 (share of residents aged 0 to 17), pct_5_to_14 (share of residents aged 5 to 14), b01001_001 (sex by age total), b01001_002 (sex by age male), b01001_003 (sex by age male 0 to 4 years), b01001_004 (sex by age male 5 to 9 years), …; 20 b11005 fields (U.S. Census Bureau, ACS 2020–2024 5-year estimates): pct_households_with_people_under_18 (share of households with people aged 0 to 17), b11005_001 (households by presence of people 0 to 17 years by household type total), b11005_002 (households by presence of people 0 to 17 years by household type households with people 0 to 17 years), b11005_003 (households by presence of people 0 to 17 years by household type households with people 0 to 17 years family households), b11005_004 (households by presence of people 0 to 17 years by household type households with people 0 to 17 years family households married-couple family), b11005_005 (households by presence of people 0 to 17 years by household type households with people 0 to 17 years family households other family), …; 3 b25003 fields (U.S. Census Bureau, ACS 2020–2024 5-year estimates): b25003_001 (tenure total), b25003_002 (tenure owner occupied), b25003_003 (tenure renter occupied); 13 b08303 fields (U.S. Census Bureau, ACS 2020–2024 5-year estimates): b08303_001 (travel time to work total), b08303_002 (travel time to work 0 to 4 minutes), b08303_003 (travel time to work 5 to 9 minutes), b08303_004 (travel time to work 10 to 14 minutes), b08303_005 (travel time to work 15 to 19 minutes), b08303_006 (travel time to work 20 to 24 minutes), …; 7 b23025 fields (U.S. Census Bureau, ACS 2020–2024 5-year estimates): b23025_001 (employment status for the population 16 years or older total), b23025_002 (employment status for the population 16 years or older in labor force), b23025_003 (employment status for the population 16 years or older in labor force civilian labor force), b23025_004 (employment status for the population 16 years or older in labor force civilian labor force employed), b23025_005 (employment status for the population 16 years or older in labor force civilian labor force unemployed), b23025_006 (employment status for the population 16 years or older in labor force armed forces), …; 30 buildings fields (Overture Maps buildings, release 2026-08-19.0, summed per area): buildings (buildings), multi_story_buildings (multi-story buildings), mid_rise_buildings (mid-rise buildings), high_rise_buildings (high-rise buildings), buildings_2_floors_plus (buildings with 2 published floors and up), buildings_4_floors_plus (buildings with 4 published floors and up), …; 13 building-types fields (Overture Maps buildings, release 2026-08-19.0, summed per area): residential_buildings (residential buildings), outbuilding_buildings (outbuilding buildings), commercial_buildings (commercial buildings), industrial_buildings (industrial buildings), education_buildings (education buildings), agricultural_buildings (agricultural buildings), …; 43 building-classes fields (Overture Maps buildings, release 2026-08-19.0, summed per area): house_class_buildings (house class buildings), detached_class_buildings (detached class buildings), residential_class_buildings (residential class buildings), garage_class_buildings (garage class buildings), apartments_class_buildings (apartments class buildings), shed_class_buildings (shed class buildings), …; 42 building-classes-2 fields (Overture Maps buildings, release 2026-08-19.0, summed per area): religious_class_buildings (religious class buildings), civic_class_buildings (civic class buildings), fire_station_class_buildings (fire station class buildings), bungalow_class_buildings (bungalow class buildings), pavilion_class_buildings (pavilion class buildings), hut_class_buildings (hut class buildings), …; 27 building-roofs fields (Overture Maps buildings, release 2026-08-19.0, summed per area): gabled_roof_buildings (buildings with a gabled roof), flat_roof_buildings (buildings with a flat roof), hipped_roof_buildings (buildings with a hipped roof), mansard_roof_buildings (buildings with a mansard roof), round_roof_buildings (buildings with a round roof), pyramidal_roof_buildings (buildings with a pyramidal roof), …; 11 building-facades fields (Overture Maps buildings, release 2026-08-19.0, summed per area): brick_facade_buildings (buildings with a brick facade), wood_facade_buildings (buildings with a wood facade), metal_facade_buildings (buildings with a metal facade), concrete_facade_buildings (buildings with a concrete facade), plaster_facade_buildings (buildings with a plaster facade), plastic_facade_buildings (buildings with a plastic facade), …. | |
| area_columns | No | Census and NOAA facts added to EVERY ROW as columns named <kind>_<attribute>, each as "<kind>:<attribute>,<attribute>", e.g. "county:population,median_household_income" — the county / ZIP / metro / state figures beside each location, in the preview and in the file you buy. Free. The same attribute words area_where takes (listed there). |