Post Code Lookup
Discover how the Post Code Lookup API fetches information related to postal codes, aiding developers in various applications.
The Post Code Lookup API provides developers with the ability to fetch information related to postal codes. This API offers three main functionalities:
Fetching postal codes for a given latitude and longitude within a specified range
Fetching latitude and longitude for a given postal code
Fetching latitude and longitude for a partial postal code
Fetch Postal Code for Latitude Longitude in a Given Range
Fetches the postal code for a specific location based on its latitude and longitude. The API can also return postal codes for locations within a specified distance range from the provided latitude and longitude. To get the postal code, you will need to call /postcodeLookup endpoint with the POST method.
Request
Endpoint
https://<host>/api/postcodeLookup
Header
Content-Type:​ application/json
Body
q
The query parameter
N
fq
Applies a filter to the query search results
N
pt
The latitude and longitude of the location
N
d
The distance from which postal code needs to be fetched
N
Note:
pt
andd
parameters are required to get the post codesd
= 0 will fetch exact post code value for passed latitude and longituded
> 0 will fetch post codes within the given distance
Response
Status Code
HTTP/1.1 200 OK
Headers
Content-Type: application/json
Body
numfound
The number of results found
postcode
The postal code for the provided latitude and longitude
latitude
The latitude of the postal code
longitude
The longitude of the postal code
country
The country of the provided postal code
country-code-ID
The country code ID of the provided country
location
The latitude and longitude points of the postal code
Fetch latitude longitude for a postal code
Fetches the latitude longitude for a specific postal code. To look up the latitude longitude you will need to call the endpoint with the POST method.
Request
Endpoint
https://<host>/api/postcodeLookup
Header
Content-Type:​ application/json
Body
postcode
The postal code
Y
Response
Status Code
HTTP/1.1 200 OK
Headers
Content-Type: application/json
Body
postcode
The postal code for the provided latitude and longitude
latitude
The latitude of the postal code
longitude
The longitude of the postal code
country
The country of the provided postal code
country-code-ID
The country code ID of the provided country
location
The latitude and longitude points of the postal code
Fetch latitude longitude for a partial postal code
Fetches the latitude longitude for a partial postal code. This API fetches all the latitude and longitude matching the partial postal code. To look up the latitude longitude for a partial postal code you will need to call the endpoint with the POST method.
Request
Endpoint
https://<host>/api/postcodeLookup
Header
Content-Type:​ application/json
Body
postcodelike
The partial postal code
Y
fields
The data fields or attributes that are included in the response body of the API call
Y
Response
Status Code
HTTP/1.1 200 OK
Headers
Content-Type: application/json
Body
latitude
The latitude of the postal code
longitude
The longitude of the postal code
Last updated