Base URL: https://rgeo.mypapit.net
Content-Type: application/x-www-form-urlencoded
Method: POST only
Author: Mohammad Hafiz bin Ismail (mypapit@gmail.com)
Copyright: © 2025 Mohammad Hafiz bin Ismail. All rights reserved.
/reverse-geocodeReturns the top 5 nearest locations using KD-Tree spatial nearest neighbor search.
POST /reverse-geocode
| Parameter | Type | Required | Description |
|---|---|---|---|
| lat | float | Yes | Latitude in decimal |
| lon | float | Yes | Longitude in decimal |
curl -X POST https://rgeo.mypapit.net/reverse-geocode \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "lat=1.919&lon=102.92"
{
"status": "success",
"result": [
{
"State": "Johor",
"District": "Batu Pahat",
"Town": "Batu Pahat",
"Lat": 1.919,
"Lon": 102.92
},
...
]
}
/reverse-geohashReturns approximate results using GeoHash lookup.
POST /reverse-geohash
| Parameter | Type | Required | Description |
|---|---|---|---|
| lat | float | Yes | Latitude in decimal |
| lon | float | Yes | Longitude in decimal |
| accuracy | int | No | 1 = GeoHash 4-char (~39 km²), 2 = 5-char (~5 km², default) |
curl -X POST https://rgeo.mypapit.net/reverse-geohash \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "lat=1.919&lon=102.92&accuracy=2"
0.5 ≤ lat ≤ 7.395 ≤ lon ≤ 122{"status": "out of bounds", "result": "0"}
Try the API with a web client demo here:
https://demo.mobilepit.com/mobile/detectlocation/
You can run the Daerah Reverse Geocoding API in your own machine using Docker. The image is available at:
https://hub.docker.com/r/mypapit/daerah-geocoder
docker run -d -p 15000:15000 -v /usr/local/shared-data:/shared-data -v /var/log:/var/log mypapit/daerah-geocoder:latest
This will start the API service and bind it to port 15000 on your local machine.
curl -X POST http://localhost:15000/reverse-geohash \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "lat=1.919&lon=102.92&accuracy=2"