An unofficial API Node.js SDK for getting the list of candidates for the 2024 Indonesian General Election. REST API is provided by Zakiego.
npm install caleg
import { Caleg } from "caleg"
const caleg = new Caleg()
const list = await caleg.dpd.dapil.list()
const dapil = await caleg.dpd.dapil.get("11")
const calon = await caleg.dpd.calon.get("aceh/6")
const list = await caleg.dpr.dapil.list()
const dapil = await caleg.dpr.dapil.get("1101")
const calon = await caleg.dpr.calon.get("aceh-i/partai-kebangkitan-bangsa/6")
const list = await caleg.dprd.provinsi.dapil.list()
const dapil = await caleg.dprd.provinsi.dapil.get("110001")
const calon = await caleg.dprd.provinsi.calon.get(
"aceh-1/partai-kebangkitan-bangsa/11"
)
const list = await caleg.dprd.kabkot.dapil.list()
const dapil = await caleg.dprd.kabkot.dapil.get("110101")
const calon = await caleg.dprd.kabkot.calon.get("aceh-selatan-1/partai-aceh/1")