The /affordability endpoint returns the Housing Affordability Index (HAI) for a US metro area, using Census ACS median household income and Redfin median home prices.

Request

GET /affordability?metro={metro_name}&income={income} Parameters: metro (string, required) — Metro area name (e.g., "Austin-Round Rock") income (integer, optional) — Custom household income for personalised score Headers: x-rapidapi-proxy-secret: YOUR_API_KEY

Response Schema

{ "metro": "Austin-Round Rock, TX", "matched_metro": "Austin-Round Rock, TX", "median_household_income": 82000, "median_home_price": 475000, "income_data_year": 2023, "data_source": "census_acs+redfin_mls", "price_data_source": "redfin_mls", "affordability_index": 75.7, // 100 = exactly affordable "interpretation": "Stretched", "price_to_income_ratio": 5.8, "monthly_payment_estimate": 2528, "down_payment_20pct": 95000, "years_to_save_down_payment": 7.7 }

matched_metro is the Census row the name actually resolved to — check it, because a loose name can match a neighbouring metro, and a near miss returns a did_you_mean array. Passing income adds a personalized object with your debt-to-income percentage and the maximum price a 28% DTI supports.

How the Index Is Calculated

The index compares what a median household can comfortably pay against what the median home actually costs to finance, on the same 20% down, 7.0% over 30 years assumptions the rest of the API uses:

Payment on median home = 475000 × 0.80 at 7.0% / 30yr = 2528/month Household can pay = (82000 / 12) × 0.28 = 1913/month Affordability index = 1913 / 2528 × 100 = 75.7

An index of 100 means the median-income household can exactly afford the median home at a 28% debt-to-income ratio. The value is capped at 200. Note this is a 28%-DTI index, not the NAR qualifying-income formula, so it will not match HAI figures published elsewhere.

Interpretation Guide

The interpretation field returns one of exactly three labels:

IndexinterpretationMeaning
≥ 100AffordableThe median-income household can carry the median home inside 28% DTI
70–99.9StretchedAffordable only above the median income, or with a larger deposit
< 70UnaffordableThe typical household is priced out at prevailing rates