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
    3
    {     
    "at":{"lat": 28.661332, "lng":77.197106},
    } 
  • To retrieve information about a specific postal code, include both the postalcode and the country parameter in the request.
    For example:

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

Response Schema

Loading..

Sample Request

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

Sample Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
{
  "places": [
    {
      "geopoint": {
        "lat": 34.00713949,
        "lng": -118.2587382
      },
      "country": "United States",
      "countryCode": "USA",
      "state": "California",
      "district": "Los Angeles",
      "postalCode": "90011",
      "address": "Los Angeles, Los Angeles, California, United States, 90011",
      "distance": 1197,
      "boundary": {
        "multiPolygon": [
          {
            "polygon": [
              {
                "points": [
                  {
                    "lat": 34.016452,
                    "lng": -118.27402099
                  },
                  {
                    "lat": 34.018654,
                    "lng": -118.27262499
                  },
                  {
                    "lat": 34.018818,
                    "lng": -118.26837099
                  },
                  {
                    "lat": 34.020256,
                    "lng": -118.27160099
                  },
                  {
                    "lat": 34.024847,
                    "lng": -118.26867099
                  },
                  {
                    "lat": 34.027311,
                    "lng": -118.26709899
                  },
                  {
                    "lat": 34.028413,
                    "lng": -118.26491999
                  },
                  {
                    "lat": 34.028952,
                    "lng": -118.26605099
                  },
                  {
                    "lat": 34.030991,
                    "lng": -118.26467899
                  },
                  {
                    "lat": 34.029962,
                    "lng": -118.26244699
                  },
                  {
                    "lat": 34.027467,
                    "lng": -118.26290499
                  },
                  {
                    "lat": 34.027703,
                    "lng": -118.26275699
                  },
                  {
                    "lat": 34.028606,
                    "lng": -118.26218199
                  },
                  {
                    "lat": 34.027571,
                    "lng": -118.25995599
                  },
                  {
                    "lat": 34.026742,
                    "lng": -118.26054299
                  },
                  {
                    "lat": 34.02588,
                    "lng": -118.25855999
                  },
                  {
                    "lat": 34.027631,
                    "lng": -118.25743699
                  },
                  {
                    "lat": 34.026748,
                    "lng": -118.25553399
                  },
                  {
                    "lat": 34.025872,
                    "lng": -118.25611599
                  },
                  {
                    "lat": 34.025845,
                    "lng": -118.25358699
                  },
                  {
                    "lat": 34.023027,
                    "lng": -118.24804199
                  },
                  {
                    "lat": 34.021208,
                    "lng": -118.24659099
                  },
                  {
                    "lat": 34.021421,
                    "lng": -118.245184
                  },
                  {
                    "lat": 34.020172,
                    "lng": -118.24617899
                  },
                  {
                    "lat": 34.019004,
                    "lng": -118.24413799
                  },
                  {
                    "lat": 34.020805,
                    "lng": -118.24399499
                  },
                  {
                    "lat": 34.020595,
                    "lng": -118.24277199
                  },
                  {
                    "lat": 34.018717,
                    "lng": -118.24285599
                  },
                  {
                    "lat": 34.018754,
                    "lng": -118.243023
                  },
                  {
                    "lat": 34.014286,
                    "lng": -118.24323699
                  },
                  {
                    "lat": 34.01385,
                    "lng": -118.24487699
                  },
                  {
                    "lat": 34.013201,
                    "lng": -118.24324699
                  },
                  {
                    "lat": 34.003917,
                    "lng": -118.24337599
                  },
                  {
                    "lat": 33.989443,
                    "lng": -118.24313899
                  },
                  {
                    "lat": 33.989498,
                    "lng": -118.25643599
                  },
                  {
                    "lat": 33.989317,
                    "lng": -118.25643599
                  },
                  {
                    "lat": 33.989227,
                    "lng": -118.26518499
                  },
                  {
                    "lat": 33.989205,
                    "lng": -118.27052799
                  },
                  {
                    "lat": 33.986067,
                    "lng": -118.27052599
                  },
                  {
                    "lat": 33.986143,
                    "lng": -118.27180699
                  },
                  {
                    "lat": 33.9892,
                    "lng": -118.27180799
                  },
                  {
                    "lat": 33.989191,
                    "lng": -118.27392799
                  },
                  {
                    "lat": 33.995227,
                    "lng": -118.27394799
                  },
                  {
                    "lat": 33.996514,
                    "lng": -118.27284399
                  },
                  {
                    "lat": 33.996505,
                    "lng": -118.27395299
                  },
                  {
                    "lat": 34.002014,
                    "lng": -118.27397199
                  },
                  {
                    "lat": 34.003835,
                    "lng": -118.27278999
                  },
                  {
                    "lat": 34.003831,
                    "lng": -118.27342799
                  },
                  {
                    "lat": 34.005683,
                    "lng": -118.27398399
                  },
                  {
                    "lat": 34.013057,
                    "lng": -118.27400899
                  },
                  {
                    "lat": 34.016452,
                    "lng": -118.27402099
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  ]
}

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
  • 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
200Normal success case.

Normal success case.

400Input validation failed.

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

401APIKEY not supplied or invalid.

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

403APIKEY 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.

404Requested host/path not found.

This error occurs when a malformed hostname is used.

422Could 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.

429Too many requests.

QPM reached or API request count quota reached.

500Internal Service error.

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