Base URL: https://api.apihub.co.id/v1. All requests require Authorization: Bearer YOUR_API_KEY.
GET /regions/provinces?page=&limit=
List Indonesian provinces. 1 credit/request
GET /regions/regencies?province_id=11
List regencies/cities for a province. 1 credit/request
GET /regions/districts?regency_id=11.01
List districts for a regency. 1 credit/request
GET /regions/villages?district_id=11.01.01
List villages for a district. 1 credit/request
GET /holidays?year=2027&month=1
Public holidays and joint leave days. Free
GET /prayer-times?city_id=11.01&date=2026-10-17
Daily prayer times by city. Free
GET /prayer-times/cities?query=bandung&province_id=32
Search/list prayer time cities. Free
Register in the dashboard, confirm the verification email we send you, then create an API key under API Keys. Keys can only be created once your email address is verified. Forgot your password? Use Lupa password on the login page.
These read-only endpoints accept your API key (no credits charged), so you can check balance and usage from your own code. Everything else under /account — profile, API keys, plan changes and top-ups — is only available from the dashboard.
GET /account/me
Current account and subscription overview. Dashboard session only.
GET /account/credits
Credit balance.
GET /account/usage
Monthly usage summary.
GET /account/plans
Available subscription plans.
POST /account/subscribe
Dashboard session only. Body: { "plan": "free" | "starter" | "pro" }. Paid plans activate only after the payment is confirmed. Returns PAYMENT_UNAVAILABLE (503) while online payment is not enabled.
POST /account/topup
Dashboard session only. Body: { "amount_idr": 50000 }. Top-up prepaid credits. Returns PAYMENT_UNAVAILABLE (503) while online payment is not enabled.
Idempotency-Key: <uuid> header to retry safely. A repeat of a completed request is served again at 0 credits with Idempotent-Replayed: true. A repeat while the first is still running returns DUPLICATE_REQUEST (409). If the request failed, the key can be reused.INVALID_API_KEY — 401INVALID_PARAMETER — 400INSUFFICIENT_CREDITS — 402EMAIL_NOT_VERIFIED — 403DUPLICATE_REQUEST — 409RATE_LIMITED — 429NOT_FOUND — 404INTERNAL_ERROR — 500PAYMENT_UNAVAILABLE — 503npm install @apihub/sdk
import { ApiHubClient } from "@apihub/sdk";
const client = new ApiHubClient({ apiKey: "YOUR_API_KEY" });
const holidays = await client.listHolidays({ year: 2027 });