Loading
Loading
https://api.apifreaks.com/v1.0/zipcode/distance/match
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/match"
payload = json.dumps({
"codes": [
"42000",
"46000",
"55270",
"53700"
],
"country": "PK",
"distance": 150,
"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 | Total number of postal code pairs returned in the response. |
| results | Array | Mandatory | Array of objects, each representing a matched postal code pair with distance information. |
| results[].code_1 | String | Mandatory | The first postal code in the matched pair. |
| results[].code_2 | String | Mandatory | The second postal code in the matched pair. |
| results[].distance | Number | Mandatory | The calculated distance between the specified postal codes (e.g., kilometers or miles). |