All packages

Address data API

Address data API

Import the facade once:

use Khanaldpk\NepaliAddress\Facades\NepaliAddress;

MethodArgumentsReturnsgetProvinces()NoneAll seven provinces.getDistricts(?int $provinceId = null)Optional province_idAll districts, or only districts in one province.getLocalBodies(?int $districtId = null)Optional district_idAll local bodies, or only bodies in one district.getLocalBodyTypes()NoneMetropolitan, sub-metropolitan, municipality, and rural municipality types.getPostalCodes()NoneThe complete city-wise postal-code dataset in its source hierarchy.

Provinces

$provinces = NepaliAddress::getProvinces();

// Example record
// [
//     'province_id' => 3,
//     'name' => 'Bagmati Pradesh',
//     'nepali_name' => 'बागमती प्रदेश',
// ]

Districts

// Every district
$districts = NepaliAddress::getDistricts();

// Districts in province ID 3
$bagmatiDistricts = NepaliAddress::getDistricts(3);

Each district includes district_id, province_id, name, and nepali_name.

Local bodies

// Every local body
$localBodies = NepaliAddress::getLocalBodies();

// Local bodies in district ID 2
$chitwanLocalBodies = NepaliAddress::getLocalBodies(2);

Each local body includes municipality_id, district_id, local_level_type_id, name, and nepali_name.

Local-body types

$types = NepaliAddress::getLocalBodyTypes();

Each type includes local_level_type_id, name, and nepali_name. Match local_level_type_id on a local body with this list to display its type.

City-wise postal codes

$postalCodes = NepaliAddress::getPostalCodes();

Postal codes are supplied as the bundled source hierarchy: province → districts → cities. A city record contains city and post_code keys. This preserves the official grouping data for building dropdowns, search, or API responses.