get_migration_flows
Retrieve top migration inflow or outflow counties/states, ranked by tax returns or AGI. Data includes FIPS, area name, returns, exemptions, and AGI.
Instructions
Retrieve top inflow or outflow areas for a county or state, ranked by number of tax returns or AGI. Inflows show where people moved from (into this area); outflows show where people moved to (out of this area). Returns an array of flow records with FIPS, area name, returns, exemptions, and AGI (in thousands of dollars). Some flow entries may be suppressed by the IRS for privacy when returns fall below the disclosure threshold. Source: IRS Statistics of Income.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fips | Yes | FIPS code — 5 digits for county, 2 for state | |
| sort | No | Ranking metric: 'returns' (household count) or 'agi' (income). Default: 'returns'. | |
| year | No | Year pair (e.g., '2021-2022'). Defaults to most recent available. | |
| level | Yes | Geographic level: county or state | |
| limit | No | Number of top flow areas to return (1-50, default: 10) | |
| direction | Yes | Flow direction: inflow (moved into area) or outflow (moved out of area) |