⚠️ Due to financial issues, our free hosted API at https://api.wilayah-nusantara.id has been shut down. ⚠️

Introduction

Wilayah Nusantara API

Wilayah Nusantara is an open source API that provides access to Indonesian province, regencies, districts, and villages data. This API allows developers to fetch specific location information for their applications or projects.

The API itself is currently hosted on a small virtual machine and may be scaled if necessary. We also use Planetscale to host our MySQL database. Since our resources are currently very limited, you are free to choose between using our public API or hosting it by yourself.

Try it out

Try out our free-to-use hosted API at https://api.wilayah-nusantara.id (opens in a new tab)

🚫

The free-to-use API is now no longer active. Sorry for everyone still wanting to use it, I will try my best to find a source of income for operational costs.

API Installation

To run the API in your local machine, follow these steps: Clone the repository to your machine and install the needed dependencies. We use pnpm to manage our packages, so please make sure it is installed in your local machine.

git clone https://github.com/theodevoid/wilayah-nusantara.git
 
cd wilayah-nusantara
 
pnpm install

Start up a docker container running MySQL. A docker-compose file is provided to make this easier.

apps/api
docker compose up

Run migrations Linux or Mac

apps/api
pnpm mikro-orm migration:up

For windows, we need to use cross-env. The script has also been provided.

apps/api
pnpm cross:mikro-orm migration:up

Import data from the /data folder to your database. We recommend using a GUI like MySQL Workbench, or DBeaver to make this easier.

Run the API Linux or Mac

apps/api
# for development
pnpm dev
 
# for production
pnpm build
pnpm start:prod

Windows

apps/api
pnpm cross:dev

Contributing

We welcome contributions from the open source community. To contribute to the Wilayah Nusantara API, please follow these steps:

  1. Fork the repository and clone it to your local machine.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and ensure that the codebase remains clean and follows best practices.
  4. Don't forget to create migrations if there are any database changes.
  5. Don't forget to build the dto package if you made any DTO changes
  6. Submit a pull request describing your changes and explaining the rationale behind them.

Roadmap

  • Update to latest data
  • Include postal code
  • Include latitude and longitude