1. Fetch
php tools/sync.php requests the ACS 5-Year Detailed Tables dataset acs/acs5, vintage 2024:
https://api.census.gov/data/2024/acs/acs5
It asks for NAME, B01003_001E (total population), and B19013_001E (median household income in 2024 inflation-adjusted dollars) for state:* and county:*. Variable IDs were read from the official variables.json. Data queries require a Census API key; metadata does not.
2. Cache
Successful rows are upserted into MySQL table places. Raw responses go to api_cache. Pages never call Census. If the key is missing or a request fails, the cache is left as-is and the site says so. Census missing values (blank, ., or large negative sentinels) are stored as null and displayed as “Not available.”
3. Publish
php tools/publish.php reads places only. It does not call the Census API. If there are no rows, it publishes nothing — no placeholder statistics.
When rows exist it upserts:
- A vintage note that ACS 5-Year 2024 covers 2020–2024 and that income is inflation-adjusted to 2024 dollars.
- Rank briefs (top and bottom 10 states) when at least 10 state rows exist.
- One state spotlight per cached state.
- A highest/lowest-income county brief for a state when that state has county rows with income.
Every figure is formatted from the related places column. Sentences do not claim year-over-year change unless two vintages are stored (they are not, in this edition). Republish updates the same (kind, place, vintage) row instead of duplicating it.
4. What we will not do
- Invent a population or income for an empty cache.
- Say “new population every day.” ACS 5-Year is annual.
- Use Data.gov as a source.
- Let an LLM guess a statistic for a brief body.
Attribution
This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.