Data & Assets
States, Provinces & Administrative Divisions
The states array contains 5,000+ administrative divisions across every country in the dataset. It is backed by ISO 3166-2 subdivision data, normalized into a consistent set of types such as states, provinces, territories, districts, municipalities, counties, and regions.
Import
import {
states,
getStatesByCountry,
getStateByCode,
getStatesByType,
} from "arevdata";
import type { State, StateType } from "arevdata";
Data shape
interface State {
name: string; // "California"
code: string; // "CA" β subdivision code within the country
country: string; // "US" β ISO 3166-1 alpha-2 country code
type: StateType; // "state" | "province" | "district" | ...
}
type StateType =
| "state"
| "province"
| "territory"
| "autonomous region"
| "district"
| "department"
| "region"
| "county"
| "emirate"
| "canton"
| "municipality"
| "prefecture"
| "governorate"
| "parish"
| "city"
| "division"
| "atoll"
| "island";
Examples
All divisions for a country
import { getStatesByCountry } from "arevdata";
getStatesByCountry("US").length; // 57
getStatesByCountry("CH").length; // 26
getStatesByCountry("JP").length; // 47
getStatesByCountry("MT").length; // 68
Look up a specific division by code
import { getStateByCode } from "arevdata";
getStateByCode("CA", "US");
// { name: "California", code: "CA", country: "US", type: "state" }
getStateByCode("ON", "CA");
// { name: "Ontario", code: "ON", country: "CA", type: "province" }
getStateByCode("ZZ", "US"); // undefined
Filter by normalized division type
import { getStatesByType } from "arevdata";
const provinces = getStatesByType("province");
const cantons = getStatesByType("canton");
const municipalities = getStatesByType("municipality");
const territories = getStatesByType("territory");
Build a country-aware subdivision selector
import { getStatesByCountry } from "arevdata";
function getSubdivisionOptions(countryCode: string) {
return getStatesByCountry(countryCode).map((division) => ({
value: division.code,
label: division.name,
}));
}
Coverage
Every entry in countries has matching subdivision data.
Representative counts:
| Country | Count | Typical types |
|---|---|---|
| πΊπΈ United States | 57 | states, district, territories |
| π¨π¦ Canada | 13 | provinces, territories |
| π¦πΊ Australia | 8 | states, territories |
| π¨π³ China | 34 | provinces, municipalities, autonomous regions |
| π«π· France | 131 | regions, departments, territories |
| π¬π§ United Kingdom | 239 | counties, districts, municipalities, territories |
| π―π΅ Japan | 47 | prefectures |
| π²πΉ Malta | 68 | municipalities |
| π¨π Switzerland | 26 | cantons |
| π½π° Kosovo | 7 | districts |