Loading
Loading
https://api.apifreaks.com/v1.0/zipcode/distance
1. Open the Authorizations dropdown and Verify your API key.
2. Click Run to see the live response here.
$ pip install requestsimport requests
import json
url = "https://api.apifreaks.com/v1.0/zipcode/distance"
payload = json.dumps({
"compare": [
"42000",
"46000"
],
"code": "55150",
"lat": 0.1,
"long": 0.1,
"country": "PK",
"unit": "km"
})
headers = {
'Content-Type': 'application/json',
'X-apiKey': ''
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
| Field | Type | Requirement | Description |
|---|---|---|---|
| results_count | String | Mandatory | Number of results |
| results | Array | Mandatory | An Array containing Postal Code Search Objects |
| results[].code | String | Mandatory | The postal code for each search result. |
| results[].distance | Number | Mandatory | The calculated distance between the specified postal codes (e.g., kilometers or miles). |