按邮政编码查询城市和州/省
curl --request GET \
--url https://api.qbank.cl/platform/v1/aml/catalogs/postal-code \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.qbank.cl/platform/v1/aml/catalogs/postal-code"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.qbank.cl/platform/v1/aml/catalogs/postal-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.qbank.cl/platform/v1/aml/catalogs/postal-code",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.qbank.cl/platform/v1/aml/catalogs/postal-code"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.qbank.cl/platform/v1/aml/catalogs/postal-code")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/aml/catalogs/postal-code")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"country": "US",
"postal_code": "33130",
"city": "Miami",
"state": "FL"
}{
"error": "invalid_payload",
"message": "code must be a 5-digit US ZIP"
}{
"error": "unauthorized",
"message": "invalid or missing credentials"
}{
"error": "account_required",
"message": "this endpoint requires an account credential"
}{
"error": "postal_code_not_found",
"message": "no place found for the given postal code"
}按邮政编码查询城市和州/省
从嵌入式公开数据集将邮政编码解析为其城市和州/省——目前仅覆盖美国 ZIP 编码。用于在地址表单中用户输入 ZIP 时自动填充城市/州字段:返回 404 表示”未知 ZIP”(或该国没有数据集),地址字段保持手动填写即可。静态数据以 Cache-Control: public, max-age=86400 提供,可安全缓存一天。
GET
/
v1
/
aml
/
catalogs
/
postal-code
按邮政编码查询城市和州/省
curl --request GET \
--url https://api.qbank.cl/platform/v1/aml/catalogs/postal-code \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.qbank.cl/platform/v1/aml/catalogs/postal-code"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.qbank.cl/platform/v1/aml/catalogs/postal-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.qbank.cl/platform/v1/aml/catalogs/postal-code",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.qbank.cl/platform/v1/aml/catalogs/postal-code"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.qbank.cl/platform/v1/aml/catalogs/postal-code")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/aml/catalogs/postal-code")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"country": "US",
"postal_code": "33130",
"city": "Miami",
"state": "FL"
}{
"error": "invalid_payload",
"message": "code must be a 5-digit US ZIP"
}{
"error": "unauthorized",
"message": "invalid or missing credentials"
}{
"error": "account_required",
"message": "this endpoint requires an account credential"
}{
"error": "postal_code_not_found",
"message": "no place found for the given postal code"
}授权
会话 JWT(来自注册/登录)或 API key(pk_...)。
也接受 X-API-Key: <token> 作为替代请求头。
查询参数
ISO 3166-1 alpha-2 国家/地区代码。目前仅 US 有数据集。
Pattern:
^[A-Z]{2}$要解析的邮政编码(5 位美国 ZIP)。
Pattern:
^[0-9]{5}$最后修改于 2026年8月22日
⌘I