API Reference

Base URL: https://api.apihub.co.id/v1. All requests require Authorization: Bearer YOUR_API_KEY.

First-party APIs

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

Getting an API key

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.

Account

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.

Billing & Retries

Common Error Codes

SDK

npm install @apihub/sdk

import { ApiHubClient } from "@apihub/sdk";
const client = new ApiHubClient({ apiKey: "YOUR_API_KEY" });
const holidays = await client.listHolidays({ year: 2027 });