SL Postal Codes API is HTTP-based, all API requests are made using HTTP GET method. HTTP response is in json format by default.
Contentsjson.jsonp,xml,html,php,csv,serialized
| Parameter | Example | Description |
|---|---|---|
| area | area=kandy | Required. The postal area that you may need to get the postal code |
| format | format=xml | Optional. Data format of the response. json is the default. |
| key | key=YOUR_API_KEY | Required. Your API key, this is our way to identify you and authorize your call. |
<xml>
<area>Kandy</area>
<postal_code>20000</postal_code>
<district>KY</district>
<latitude>7.2964</latitude>
<longitude>80.635</longitude>
</xml>
json.jsonp,xml,html,php,csv,serialized
| Parameter | Example | Description |
|---|---|---|
| postalcode | postalcode=20000 | Required. The postal code of the unknown postal area. |
| format | format=xml | Optional. Data format of the response. json is the default. |
| key | key=YOUR_API_KEY | Required. Your API key, this is our way to identify you and authorize your call. |
<xml>
<area>Kandy</area>
<postal_code>20000</postal_code>
<district>KY</district>
<latitude>7.2964</latitude>
<longitude>80.635</longitude>
</xml>
json.jsonp,xml,html,php,csv,serialized
| Parameter | Example | Description |
|---|---|---|
| area | area=kandy | Required. Postal area for which you may need nearby places. |
| radius | radius=20 | Required. Defines the distance (in miles) within which to return place results. |
| limit | limit=3 | Optional. Number of place results you may need. Search for five results by default. | format | format=xml | Optional. Data format of the response. json is the default. |
| key | key=YOUR_API_KEY | Required. Your API key, this is our way to identify you and authorize your call. |
<xml>
<item>
<area>Kandy</area>
<postal_code>20000</postal_code>
<district>KY</district>
<latitude>7.2964</latitude>
<longitude>80.635</longitude>
<distance>0.00</distance>
</item>
<item>
<area>Katugastota</area>
<postal_code>20800</postal_code>
<district>KY</district>
<latitude>7.3161</latitude>
<longitude>80.6211</longitude>
<distance>1.66</distance>
</item>
<item>
<area>Udatalawinna</area>
<postal_code>20802</postal_code>
<district>KY</district>
<latitude>7.3161</latitude>
<longitude>80.6211</longitude>
<distance>1.66</distance>
</item>
</xml>