curl
curl -X POST https://verification.didit.me/v3/address-validation/ \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"address_line_1": "1600 Amphitheatre Pkwy",
"city": "Mountain View",
"region": "CA",
"postal_code": "94043",
"country": "US"
}'from didit import Didit
# Reads DIDIT_API_KEY.
client = Didit()
result = client.address_validation.validate(
address_line_1="1600 Amphitheatre Pkwy",
city="Mountain View",
region="CA",
postal_code="94043",
country="US",
)
print(result)import Didit from "@didit-protocol/sdk-node";
// Reads DIDIT_API_KEY.
const didit = new Didit();
const result = await didit.addressValidation.validate({
address_line_1: "1600 Amphitheatre Pkwy",
city: "Mountain View",
region: "CA",
postal_code: "94043",
country: "US",
});
console.log(result);import me.didit.Didit;
import me.didit.types.AddressValidationRequest;
// Reads DIDIT_API_KEY.
Didit client = new Didit();
var result = client.addressValidation().validate(AddressValidationRequest.builder()
.addressLine1("1600 Amphitheatre Pkwy")
.city("Mountain View")
.region("CA")
.postalCode("94043")
.country("US")
.build());
System.out.println(result);<?php
require 'vendor/autoload.php';
use Didit\DiditClient;
// Reads DIDIT_API_KEY.
$didit = new DiditClient();
$result = $didit->addressValidation->validate([
'address_line_1' => '1600 Amphitheatre Pkwy',
'city' => 'Mountain View',
'region' => 'CA',
'postal_code' => '94043',
'country' => 'US',
]);
print_r($result->toArray());require "didit"
# Reads DIDIT_API_KEY.
didit = Didit::Client.new
result = didit.address_validation.validate(
address_line_1: "1600 Amphitheatre Pkwy",
city: "Mountain View",
region: "CA",
postal_code: "94043",
country: "US"
)
puts result.to_husing System;
using System.Text.Json;
using Didit;
// Reads DIDIT_API_KEY.
using var client = new DiditClient();
var result = await client.AddressValidation.ValidateAsync(new AddressValidationRequest
{
AddressLine1 = "1600 Amphitheatre Pkwy",
City = "Mountain View",
Region = "CA",
PostalCode = "94043",
Country = "US",
});
Console.WriteLine(JsonSerializer.Serialize(result));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://verification.didit.me/v3/address-validation/"
payload := strings.NewReader("{\n \"address_line_1\": \"1600 Amphitheatre Pkwy\",\n \"city\": \"Mountain View\",\n \"region\": \"CA\",\n \"postal_code\": \"94043\",\n \"country\": \"US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"request_id": "6f7d2c1e-1c5a-4a1e-9b8f-2a1f0f4b9c3d",
"address_validation": {
"status": "verified",
"verification_level": "premise",
"address": {
"address_line_1": "1600 Amphitheatre Pkwy",
"address_line_2": null,
"city": "Mountain View",
"region": "CA",
"postal_code": "94043-1351",
"country": "US"
},
"formatted_address": "1600 Amphitheatre Pkwy, Mountain View CA 94043-1351",
"latitude": 37.422022,
"longitude": -122.08429
},
"created_at": "2026-10-27T11:20:00.000000+00:00"
}身份与证件
地址验证 API:验证并标准化地址
Didit 的 POST /v3/address-validation/ 可确认地址是否存在,并返回标准化地址及坐标。支持结构化或单行输入,每个地址 $0.10。
POST
/
v3
/
address-validation
/
curl
curl -X POST https://verification.didit.me/v3/address-validation/ \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"address_line_1": "1600 Amphitheatre Pkwy",
"city": "Mountain View",
"region": "CA",
"postal_code": "94043",
"country": "US"
}'from didit import Didit
# Reads DIDIT_API_KEY.
client = Didit()
result = client.address_validation.validate(
address_line_1="1600 Amphitheatre Pkwy",
city="Mountain View",
region="CA",
postal_code="94043",
country="US",
)
print(result)import Didit from "@didit-protocol/sdk-node";
// Reads DIDIT_API_KEY.
const didit = new Didit();
const result = await didit.addressValidation.validate({
address_line_1: "1600 Amphitheatre Pkwy",
city: "Mountain View",
region: "CA",
postal_code: "94043",
country: "US",
});
console.log(result);import me.didit.Didit;
import me.didit.types.AddressValidationRequest;
// Reads DIDIT_API_KEY.
Didit client = new Didit();
var result = client.addressValidation().validate(AddressValidationRequest.builder()
.addressLine1("1600 Amphitheatre Pkwy")
.city("Mountain View")
.region("CA")
.postalCode("94043")
.country("US")
.build());
System.out.println(result);<?php
require 'vendor/autoload.php';
use Didit\DiditClient;
// Reads DIDIT_API_KEY.
$didit = new DiditClient();
$result = $didit->addressValidation->validate([
'address_line_1' => '1600 Amphitheatre Pkwy',
'city' => 'Mountain View',
'region' => 'CA',
'postal_code' => '94043',
'country' => 'US',
]);
print_r($result->toArray());require "didit"
# Reads DIDIT_API_KEY.
didit = Didit::Client.new
result = didit.address_validation.validate(
address_line_1: "1600 Amphitheatre Pkwy",
city: "Mountain View",
region: "CA",
postal_code: "94043",
country: "US"
)
puts result.to_husing System;
using System.Text.Json;
using Didit;
// Reads DIDIT_API_KEY.
using var client = new DiditClient();
var result = await client.AddressValidation.ValidateAsync(new AddressValidationRequest
{
AddressLine1 = "1600 Amphitheatre Pkwy",
City = "Mountain View",
Region = "CA",
PostalCode = "94043",
Country = "US",
});
Console.WriteLine(JsonSerializer.Serialize(result));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://verification.didit.me/v3/address-validation/"
payload := strings.NewReader("{\n \"address_line_1\": \"1600 Amphitheatre Pkwy\",\n \"city\": \"Mountain View\",\n \"region\": \"CA\",\n \"postal_code\": \"94043\",\n \"country\": \"US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"request_id": "6f7d2c1e-1c5a-4a1e-9b8f-2a1f0f4b9c3d",
"address_validation": {
"status": "verified",
"verification_level": "premise",
"address": {
"address_line_1": "1600 Amphitheatre Pkwy",
"address_line_2": null,
"city": "Mountain View",
"region": "CA",
"postal_code": "94043-1351",
"country": "US"
},
"formatted_address": "1600 Amphitheatre Pkwy, Mountain View CA 94043-1351",
"latitude": 37.422022,
"longitude": -122.08429
},
"created_at": "2026-10-27T11:20:00.000000+00:00"
}Didit 的地址验证 API 用于确认邮寄地址是否存在,并返回标准化后的地址,包括投递行、地址组成部分和坐标。当您的后端拥有一个地址,并需要确认它是否存在以及以何种标准化形式存在时,请使用
POST /v3/address-validation/。
地址验证仅确认地址本身。它从不将地址与某个人关联:verified 结果表示该地点存在,但不代表有人居住在那里。
发送地址
请在address 中以单行形式发送地址,或以结构化字段发送:address_line_1,并在有这些信息时提供 address_line_2、city、region 和 postal_code。切勿在同一请求中同时发送两种格式。country 始终为必填项,须为 ISO 3166-1 alpha-2 或 alpha-3 代码。
解读响应
address_validation.status是您应当依据的结果:verified:地址已确认到楼栋(或套房、邮政信箱)。partially_verified:地址仅确认到街道,或确认到邮政参考数据对该地点保存的最精确级别。not_verified:仅匹配到地区或城市,或完全未匹配。unavailable:无法执行验证。请稍后重试。
address_validation.verification_level是匹配到的最精确级别:administrative_area、locality、thoroughfare、premise或delivery_point。address_validation.address和address_validation.formatted_address包含标准化后的地址,并按该国的书写习惯呈现。address_validation.latitude和address_validation.longitude标示匹配地址的位置。request_id用于标识该请求。不会创建会话,结果仅在本次响应中返回,因此请自行保存所需内容。
200,包括 unavailable 的情况。
工作流中的地址验证
同一验证功能也是身份证件验证和地址证明工作流步骤的附加功能。在该步骤的设置中开启address_validation_enabled 后,系统会在读取人员上传的文件后,对其提供的地址(印在身份证件上的地址,或地址证明上的地址)进行一次验证。结果即为会话决策中该步骤对应条目(id_verifications[] 或 poa_verifications[])里的 address_validation 对象。状态为 partially_verified 或 not_verified 的地址会触发 ADDRESS_NOT_VERIFIED 警告,其操作由该步骤的 address_not_verified_action 决定(默认为 NO_ACTION,仅记录该警告)。unavailable 的验证从不触发该警告,也从不改变验证结果。
沙盒行为
沙盒密钥会验证请求,并始终返回确定性的verified 结果,该结果会回显您发送的地址。沙盒调用不消耗额度。
计费
每次地址验证 API 调用,按每个已验证地址收取 $0.10。`unavailable` 结果不收费。在工作流中,该附加功能按步骤验证的每个地址收取 $0.10。授权
您的应用 API 密钥,可在 Business Console 的“开发者 -> API 密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域:针对每个资源设为无权限、只读或读写,限定于特定工作流或已通过的会话、限定于 IP 地址列表,以及设置到期日期。401 表示密钥错误、已撤销或已过期;403 表示未发送密钥、密钥无权访问该资源或操作,或请求来自其 IP 列表之外的地址;在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF URL 将为 null;没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅 https://docs.didit.me/console/api-keys。
请求体
application/json
一个地址:使用单行文本(address),或者至少包含 address_line_1 的结构化字段,两者不可兼有。
地址所在国家/地区的 ISO 3166-1 alpha-2 或 alpha-3 代码。
Maximum string length:
3示例:
"US"
单行完整地址。
Maximum string length:
500示例:
"Paseo de la Castellana 259, 28046 Madrid"
街道与门牌号。
Maximum string length:
255示例:
"1600 Amphitheatre Pkwy"
公寓、套房、楼层或楼栋。
Maximum string length:
255城市或地区。
Maximum string length:
128示例:
"Mountain View"
州、省或地区。
Maximum string length:
128示例:
"CA"
Maximum string length:
32示例:
"94043"
最后修改于 2026年11月7日