Our vision.
See code example in the server folder.
Run ./setup.sh
. This script will install bun and download required files to setup server
cd server
./setup.sh
Start Server
bun app.js
Works with both ipv4 and ipv6.
Get geolocation corresponding to given IP
curl https://geoip.samagra.io/city/128.101.101.101
Get geolocation for given lat
& lon
curl https://geoip.samagra.io/georev?lat=28.7041&lon=77.1025
Get polygon centroid for given STATE/DISTRICT/SUBDISTRICT
with some query
curl https://geoip.samagra.io/location/DISTRICT/centroid?query=lucknow
Fuzzy search location by name with STATE/DISTRICT/SUBDISTRICT/VILLAGE
levels with query & location level filters in request body, filter
keys should one of these STATE/DISTRICT/SUBDISTRICT/VILLAGE
.
curl --location 'https://geoip.samagra.io/location/VILLAGE/fuzzysearch' \
--header 'Content-Type: application/json' \
--data '{
"query": "Arong",
"filter": {
"STATE": "Andaman & Nicobar Islands",
"DISTRICT": "Nicobars"
}
}'
# Response
{
"matches": [
{
"state": "Andaman & Nicobar Islands",
"district": "Nicobars",
"subDistrict": "Car Nicobar",
"village": "Arong"
}
]
}
DB will remain updated automatically. Please create a ticket if you see some issues.
- Please consider issues up from grabs.
- It will only be assigned with a PR.