Developer / Referensi
Population pyramid (SP2020) per province × cohort × sex
GET /v1/demographics/age-cohort
Isi referensi
Indonesian population from BPS Sensus Penduduk 2020 (SP2020), broken down into 5-year age cohorts × sex. Default view returns the national pyramid (~40 rows = 20 cohorts × 2 sexes); ?province=NN swaps to a single-province pyramid. Use ?sex=m or ?sex=f to filter one half. SP2020 is a one-shot decennial census; next refresh is SP2030.
Deskripsi endpoint berasal dari spesifikasi dan masih berbahasa Inggris.
Parameter
| Parameter | Lokasi | Tipe | Aturan |
|---|---|---|---|
| province | query | string | Opsional |
| sex | query | m | f | all | Opsional |
Hak redistribusi mengikuti lisensi seri. Data tampilan saja tidak tersedia sebagai baris mentah.
Respons
| Kode | Keterangan |
|---|---|
| 200 | Population pyramid rows (cohort × sex × value) |
| 400 | Invalid request parameters |
| 401 | Missing or invalid API key |
| 429 | Quota exceeded; retry after the window resets |
Dibangkitkan dari openapi.yaml, spesifikasi yang sama dengan /v1/openapi.yaml.
Permintaan / contoh
curl -H "x-api-key: $SUMBER_KEY" \
"https://api.sumber.io/v1/demographics/age-cohort"