Get AGI distribution by ZIP
get_agi_distributionGet the income distribution for a US ZIP code across six AGI brackets, with return counts, totals, and shares to reveal the area's income shape.
Instructions
The income distribution of a ZIP across the six IRS AGI brackets.
`zip_code`: a 5-digit US ZIP. Returns, for each bracket (<$25k, $25-50k,
$50-75k, $75-100k, $100-200k, $200k+), the number of returns and total AGI
plus each bracket's share of the ZIP's returns and AGI. This is the income
*shape* of a ZIP — what a single median can't show.
Note: a bracket showing 0 may be IRS-suppressed (<20 returns in that cell)
rather than truly empty, so the other brackets' shares can be slightly
overstated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zip_code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | 2-letter USPS state code | |
| zipcode | Yes | 5-digit ZIP code | |
| brackets | Yes | One entry per AGI bracket, ordered 1 (lowest) to 6 (highest) | |
| tax_year | Yes | SOI tax year of the data | |
| total_agi | No | Total AGI across all brackets (USD) | |
| total_returns | No | Total returns across all brackets |