Twinkle HubTwinkle Hub

美國人口普查 有效地理層級 (state/county/tract)

us_get_geography_list

🇺🇸 États-Unislecture seule

關鍵字 / Keywords: 美國人口普查 地理 層級 州 郡 區 州碼 郡碼 tract block group FIPS GEOID geography level state county census tract block group hierarchy

Scope: US Census Bureau · api.census.gov geography hierarchy.

List the geography levels valid for one dataset — state, county, county subdivision, place, tract, block group, ZCTA, congressional district, etc. Also tells you which parent levels a child requires (e.g. tract requires state+county in the in_geo param).

Endpoint: https://api.census.gov/data/{year}/{dataset}/geography.json

Args: year: vintage year (e.g. 2022, "2020"). dataset: dataset path — "acs/acs5", "dec/pl", ...

Returns dict with geographies — each entry has name (e.g. "state"), geo_level (FIPS-style 3-digit like "040"), reference_date, requires (parent-geo list), wildcard. No API key required. License: US Public Domain.

Paramètres

NomTypeDescription
year *integer | string
dataset *string
Schéma JSON brut
{
  "properties": {
    "year": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "title": "Year"
    },
    "dataset": {
      "title": "Dataset",
      "type": "string"
    }
  },
  "required": [
    "year",
    "dataset"
  ],
  "title": "us_get_geography_listArguments",
  "type": "object"
}

Comment appeler

Amorce — paramètres dans le tableau
us_get_geography_list({ year: 10 })