Reverse geocode
curl --request GET \
--url https://api.postcode.gov.ng/v1/search/reverse \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.postcode.gov.ng/v1/search/reverse"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.postcode.gov.ng/v1/search/reverse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.postcode.gov.ng/v1/search/reverse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.postcode.gov.ng/v1/search/reverse"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.postcode.gov.ng/v1/search/reverse")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.postcode.gov.ng/v1/search/reverse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"found": true,
"coordinate": [
123
],
"unit": {
"postcode": "EK-01-A03-FK-01",
"display": "EK 01 A03 FK 01",
"distance_m": 123,
"confidence": "high",
"state_name": "<string>",
"lga_name": "<string>",
"locality_name": "<string>",
"address": "<string>"
},
"area": "EK-01-A03-FK",
"district": "EK-01-A03",
"state": "EK",
"message": "<string>",
"radius_m": 123
}
}Search
Reverse geocode
Resolves a coordinate to the postcode of the nearest active unit within a specified radius (default 25m, max 250m). Returns the full unit code plus the derived area/district/state hierarchy and a distance-graded confidence. Administrative names are included only for keys granted lookup level 2+.
GET
/
v1
/
search
/
reverse
Reverse geocode
curl --request GET \
--url https://api.postcode.gov.ng/v1/search/reverse \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.postcode.gov.ng/v1/search/reverse"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.postcode.gov.ng/v1/search/reverse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.postcode.gov.ng/v1/search/reverse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.postcode.gov.ng/v1/search/reverse"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.postcode.gov.ng/v1/search/reverse")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.postcode.gov.ng/v1/search/reverse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"found": true,
"coordinate": [
123
],
"unit": {
"postcode": "EK-01-A03-FK-01",
"display": "EK 01 A03 FK 01",
"distance_m": 123,
"confidence": "high",
"state_name": "<string>",
"lga_name": "<string>",
"locality_name": "<string>",
"address": "<string>"
},
"area": "EK-01-A03-FK",
"district": "EK-01-A03",
"state": "EK",
"message": "<string>",
"radius_m": 123
}
}Authorizations
Query Parameters
Search radius for this call. Honored as asked, tighter or looser than the 25m default, but silently clamped to the 250m hard ceiling if it asks for more than that -- see radius_m on the response for what was actually applied.
Required range:
0 <= x <= 250Response
200 - application/json
Resolved postcode (found=false when nothing is within range)
Show child attributes
Show child attributes

