{
"countries": [
{
"country": "AU",
"note": null
},
{
"country": "CA",
"note": "Forward sortation areas only (first three characters)."
},
{
"country": "DE",
"note": null
}
],
"attribution": "Postal code data from GeoNames (geonames.org), CC BY 4.0"
}
curl --location --request GET 'https://zylalabs.com/api/15051/postal+codes+api/39823/list+covered+countries' --header 'Authorization: Bearer YOUR_API_KEY'
{
"postal_code": "94105",
"country": "US",
"places": [
"San Francisco"
],
"state": "California",
"state_code": "CA",
"county": "City and County of San Francisco",
"latitude": 37.7864,
"longitude": -122.3892,
"attribution": "Postal code data from GeoNames (geonames.org), CC BY 4.0"
}
curl --location --request GET 'https://zylalabs.com/api/15051/postal+codes+api/39824/look+up+a+postal+code&country=Required&/=Required&code=Required' --header 'Authorization: Bearer YOUR_API_KEY'
{
"origin": {
"postal_code": "94105",
"country": "US",
"places": [
"San Francisco"
],
"state": "California",
"state_code": "CA",
"county": "City and County of San Francisco",
"latitude": 37.7864,
"longitude": -122.3892
},
"radius_km": 10,
"total": 50,
"postal_codes": [
{
"postal_code": "94104",
"country": "US",
"places": [
"San Francisco"
],
"state": "California",
"state_code": "CA",
"county": "City and County of San Francisco",
"latitude": 37.7915,
"longitude": -122.4018,
"distance_km": 1.24
},
{
"postal_code": "94111",
"country": "US",
"places": [
"San Francisco"
],
"state": "California",
"state_code": "CA",
"county": "City and County of San Francisco",
"latitude": 37.7974,
"longitude": -122.4001,
"distance_km": 1.55
},
{
"postal_code": "94108",
"country": "US",
"places": [
"San Francisco"
],
"state": "California",
"state_code": "CA",
"county": "City and County of San Francisco",
"latitude": 37.7929,
"longitude": -122.4079,
"distance_km": 1.8
}
],
"attribution": "Postal code data from GeoNames (geonames.org), CC BY 4.0"
}
curl --location --request GET 'https://zylalabs.com/api/15051/postal+codes+api/39825/find+postal+codes+within+a+radius?radius_km=10&limit=25&country=Required&/=Required&code=Required' --header 'Authorization: Bearer YOUR_API_KEY'
{
"from": {
"postal_code": "94105",
"country": "US",
"places": [
"San Francisco"
],
"state": "California",
"state_code": "CA",
"county": "City and County of San Francisco",
"latitude": 37.7864,
"longitude": -122.3892
},
"to": {
"postal_code": "10001",
"country": "US",
"places": [
"New York"
],
"state": "New York",
"state_code": "NY",
"county": "New York",
"latitude": 40.7484,
"longitude": -73.9967
},
"distance_km": 4126.1,
"distance_miles": 2563.9,
"attribution": "Postal code data from GeoNames (geonames.org), CC BY 4.0"
}
curl --location --request GET 'https://zylalabs.com/api/15051/postal+codes+api/39826/distance+between+two+postal+codes?from_country=US&from_code=94105&to_country=US&to_code=10001' --header 'Authorization: Bearer YOUR_API_KEY'
{
"country": "DE",
"query": "Heidelberg",
"total": 10,
"postal_codes": [
{
"postal_code": "69115",
"country": "DE",
"places": [
"Heidelberg"
],
"state": "Baden-Württemberg",
"state_code": "BW",
"county": "Karlsruhe Region",
"latitude": 49.4062,
"longitude": 8.6868
},
{
"postal_code": "69117",
"country": "DE",
"places": [
"Heidelberg"
],
"state": "Baden-Württemberg",
"state_code": "BW",
"county": "Karlsruhe Region",
"latitude": 49.4095,
"longitude": 8.6935
},
{
"postal_code": "69118",
"country": "DE",
"places": [
"Heidelberg"
],
"state": "Baden-Württemberg",
"state_code": "BW",
"county": "Karlsruhe Region",
"latitude": 49.4194,
"longitude": 8.7345
}
],
"attribution": "Postal code data from GeoNames (geonames.org), CC BY 4.0"
}
curl --location --request GET 'https://zylalabs.com/api/15051/postal+codes+api/39827/find+postal+codes+by+place+name?q=Heidelberg&limit=25&country=Required' --header 'Authorization: Bearer YOUR_API_KEY'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 邮政编码 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
打包的GeoNames邮政数据(CC BY 4.0)回应包括GeoNames的署名
涵盖11个国家:美国 英国 加拿大 德国 法国 西班牙 意大利 荷兰 澳大利亚 墨西哥 和 印度 英国 加拿大 和 荷兰 只是部分代码 坐标为近似中心