caleg
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Caleg

An unofficial API Node.js SDK for getting the list of candidates for the 2024 Indonesian General Election. REST API is provided by Zakiego.

Installation

npm install caleg

Usage

import { Caleg } from "caleg"

const caleg = new Caleg()

DPD

const list = await caleg.dpd.dapil.list()
const dapil = await caleg.dpd.dapil.get("11")
const calon = await caleg.dpd.calon.get("aceh/6")

DPR

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")

DPRD

Provinsi

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"
)

Kabupaten/Kota

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")

Readme

Keywords

none

Package Sidebar

Install

npm i caleg

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

31.6 kB

Total Files

28

Last publish

Collaborators

  • abielzulio