API — Taiwan (TW)

22 county/citys, 234 districts.

Endpoints

GET /api/v1/countries/tw.json
Full dataset — all levels, all records
GET /api/v1/tw/county.json
All 22 county/citys (縣市)
GET /api/v1/tw/district.json
All 234 districts (鄉鎮市區)
GET /api/v1/tw/county/{slug}.json
Single county/city with children

Quick Start

JavaScript

fetch('https://api.openadmindata.org/api/v1/countries/tw.json')
  .then(r => r.json())
  .then(data => {
    const levels = data.meta.levels.map(l => l.name_en);
    console.log('Taiwan:', levels.join(' → '));
    
    console.log(data.data.county.length, 'county/citys');
  });

Python

import requests
data = requests.get('https://api.openadmindata.org/api/v1/countries/tw.json').json()
countys = data['data']['county']
print(f"Taiwan: {len(countys)} county/citys")

cURL

curl -s https://api.openadmindata.org/api/v1/tw/county.json | jq '.count'

Schema

Each entity record contains:

FieldTypeDescription
idstringUnique identifier
name_localstringName in local script
name_enstringEnglish / romanized name
slugstringURL-safe slug
latnumberLatitude (WGS84)
lonnumberLongitude (WGS84)
parent_idstring?Parent entity ID (null for top level)
parent_name_localstring?Parent name in local script
parent_name_enstring?Parent English name
postal_codestring?Postal code (deepest level only, where available)