Geocode Postcode API

Introduction

Geocode Postcode API is a geolocation tool that provides users with a simple way to retrieve the geographical coordinates and boundaries of a postal code or ZIP code. Additionally, users can provide location coordinates to get the postal code it belongs to.

The API has a range of potential use cases across multiple domains. In the e-commerce industry, it can be utilized to enhance the accuracy of shipping and delivery processes. Similarly, in the logistics and delivery sector, the API can assist with optimizing routes, resulting in faster deliveries. Online mapping services and location-based apps can leverage the API to recommend nearby businesses and attractions based on a user's geographical location. These are just a few examples of the practical applications of the API that can enhance user experiences in various domains.

POST

https://api.nextbillion.io/postalcode?key={your_api_key}

Request Parameters

Loading..

Request Body

Loading..

Note

  • The user can include only the at parameter in the API request to obtain information about the postal code a specific geographic coordinate belongs to.
    For example:

    1
    {
    2
    "at":{"lat": 28.661332, "lng":77.197106},
    3
    }
  • To retrieve information about a specific postal code, include both the postalcode and the country parameter in the request.
    For example:

    1
    {
    2
    "postalcode": "110007",
    3
    "country": "India"
    4
    }
  • We do not recommend using both postalcode and at together in a single request

Response Schema

Loading..

Sample Request

1
curl --location --request POST 'https://api.nextbillion.io/postalcode?key=<your_api_key>'
2
--header 'Content-Type: application/json'
3
--data-raw '{
4
"at":{"lat": 34.007578, "lng":-118.271713},
5
"country": "USA"
6
}'

Sample Response

1
{
2
"places": "[...]"
3
}

API Query Limits

  • Only 1 postalcode is allowed per request.

  • Only 1 at location is allowed per request.

  • The Geocode Postcode API supports the following countries currently:

    • United States of America

    • India

    • United Kingdom

    • Netherlands

    • Austria

    • Germany

    • Indonesia

    • France

    • Singapore

    • Philippines

    • Canada

    • Australia

    • New Zealand

    • Italy

    • Brazil

    • Mexico

    • Spain

  • Nextbillion.ai allows a maximum rate limit of 2400 queries per minute or 40 queries/second for continuous requests. Note: We can increase the quota if needed on request. Contact [email protected] for more details

API Error Codes

Response CodeDescriptionAdditional Notes
200

Normal success case.

Normal success case.

400

Input validation failed.

There is a missing or invalid parameter or a parameter with an invalid value type is added to the request.

401

APIKEY not supplied or invalid.

This error occurs when the wrong API key is passed in the request or the key is missing altogether

403

APIKEY is valid but does not have access to requested resources.

You might be querying for a geographical region which is not valid for your account, or requesting a service which is not enabled for you.

404

Requested host/path not found.

This error occurs when a malformed hostname is used.

422

Could not process the request.

The request could not be processed due to inappropriate input. Please verify the accuracy of the postal code or the location.

429

Too many requests.

QPM reached or API request count quota reached.

500

Internal Service error.

There was an internal issue with NextBillion.ai services. You can reach out to [email protected] for an explanation.

© 2024 NextBillion.ai all rights reserved.