emsifa/api-wilayah-indonesia/public
Claude Code and agent skill by emsifa/api-wilayah-indonesia
- community
Checking that the SKILL.md file is still in the repository.
Schemas for Indonesian administrative data — API responses and downloadable files for app integration
Install
npx vskill@latest install emsifa/api-wilayah-indonesia/publicSKILL.md
SKILL — Wilayah Indonesia
Use this skill when a developer wants to integrate Indonesian administrative data (provinces, regencies/cities, districts, villages, postal codes, boundaries) into their app. Data is available in two interchangeable ways: Static API (https://www.emsifa.com/api-wilayah-indonesia/v2) and Downloaded files (npx wilayah download --format csv|sql|json). This file only describes what you will receive — columns, keys, and response shapes — so you can build for any stack.
1. Which Source Should You Use?
- Static API: Best for MVPs, frontend-only apps, or edge functions. No database needed — just
fetchJSON. Includes polygons for maps. Data is cached on CDN. - Download: Best when you need offline validation, foreign keys, or complex queries (
WHERE postal_code = ?). You get the full dataset to self-host in your own database or static hosting.
Ask the user: “Do you want to fetch from the API or self-host the data?”
2. API — What You Get
Base URL: https://www.emsifa.com/api-wilayah-indonesia/v2
Every response has the same wrapper:
data: the actual payload (see below)meta.generated_at: when the file was generated (RFC3339)meta.level: depth0=stats, 1=province, 2=regency, 3=district, 4=village/postal
2.1 What you get for provinces & regencies (detailed)
For provinces.json, provinces/{code}.json, regencies/{province}.json, regencies/{regency}.json you receive rich objects:
- You'll always get
idandname. For provinces and regencies you also getcapital, lat, lng (for map marker), elv, tz, population, total_area. - Detail endpoints also include their parent: a regency includes
province, a district includesprovince+regency, a village includes all three.
2.2 What you get for districts & villages (lists)
For lists, you get a compact form to keep files small:
- District lists only have
idandname(no coordinates or polygon here). - Village lists add
postal_codeso you can filter by postal code without a separate lookup.
2.3 All endpoints
| Path | What it returns | |
|---|---|---|
/stats.json | Totals for all levels | |
/provinces.json | All provinces (detailed) | |
/provinces/{code}.json | One province, e.g. 32 | |
/regencies/{province_code}.json | Regencies in that province | |
/regencies/{regency_code}.json | One regency + its province | |
/districts/{regency_code}.json | Districts in that regency (compact) | |
/districts/{district_code}.json | One district + its province/regency | |
/villages/{district_code}.json | Villages in that district + postal_code | |
/villages/{village_code}.json | One village + postal_code + all parents | |
/postal-codes/{postal_code}.json | All villages that use that postal code | |
/paths/{province_or_regency_code}.json | Boundary polygon for a province/regency |
2.4 Totals (stats)
2.5 Boundaries (polygons)
- Only provinces and regencies have polygons. Some have one ring (single island), others have many (e.g., Jakarta 2 rings, Aceh 28, Papua Barat 1455). Your map code should handle both: if the first element is a point
[lat,lng]it's a single polygon, if it's an array of points it's already a list of rings — collect all rings that have more than 2 points.
3. Downloaded Files — What You Get
Run npx wilayah download --format <csv|sql|json> --output ./wilayah.<ext> to get the full dataset to host yourself. You can also get the same shapes via the API, but as static files you control.
3.1 wilayah.csv / wilayah.json (full hierarchy)
Every row is one administrative area:
kode: the ID. Count the dots to know the level: no dot = province (2 chars, e.g.11), one dot = regency (5 chars,11.01), two dots = district (8 chars,11.01.01), three dots = village (13 chars,11.01.01.2001)nama: the display name
The json version has the same rows as an array of {kode, nama}.
3.2 Rich data for provinces & regencies
When you need coordinates, capital, population, area, or polygon, use the level 1/2 data. In the download this is available as extra columns (for sql/json) or as the API rich objects:
ibukota= capital,luas= total_area,penduduk= population,path= same polygon as/pathsendpoint
3.3 Postal code mapping
kode: village idkodepos: postal code used to buildpostal-codes/{code}.json. One postal code can map to many villages.
3.4 What each download format gives you
wilayah.json/api/*.json: same structures as Section 2 — ready to serve as static files.wilayah.sql:INSERTstatements with columnskode, nama, capital, lat, lng, elv, tz, total_area, population, postal_code— import into MySQL/Postgres.wilayah.csv: merged table withkode,nama,postal_codeplus rich columns for provinces/regencies.
4. How IDs and Relationships Work
- The
kode/idis the primary key. Split by.to get the parent:32.73.01.1001→ province32, regency32.73, district32.73.01. - Hierarchy is always
province → regency → district → village. postal_codelives on the village. Usepostal-codes/{code}.jsonto find all villages sharing a code.
5. How to Use (for the AI)
- If the user wants to fetch: call the endpoints in Section 2 in order
provinces → regencies/{prov} → districts/{reg} → villages/{dist}. Always use the realkodefrom the previous response, never guess. - If the user wants to self-host: suggest
npx wilayah download --format <...>and point to the columns above. Let the user choose the format that fits their database. - For maps, only provinces/regencies have coordinates and polygons — don’t try to zoom to a district/village by coordinates.
References
- Live API:
https://www.emsifa.com/api-wilayah-indonesia/v2 - Spec:
openapi.ymlandwilayah-postman.jsonat the same base URL - Stats:
api/stats.json,api/provinces.json
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingweb/public/SKILL.md
Popularity
- Repository stars
- 751
- Repository forks
- 1,418
- 7-day trend score
- 33
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/emsifa/api-wilayah-indonesia/public)