Developer Beta
API Playground
Chọn endpoint, sửa tham số, gửi yêu cầu thật tới Address API v1 và copy mã tương ứng.
Request
POST /v1/address/normalize
Cần JavaScript để gửi từ trang này; phản hồi bên cạnh là kết quả thật của ví dụ.
ResponseHTTP 200
{
"apiVersion": "1",
"status": "beta",
"data": {
"address": {
"input": "12 nguyen hue p ben nghe q1 tphcm",
"sources": [
{
"id": "gso-2025",
"name": "Danh mục đơn vị hành chính – Tổng cục Thống kê",
"asOf": "2025-03-01"
},
{
"id": "nq-202-2025",
"name": "Nghị quyết 202/2025/QH15 và các nghị quyết sắp xếp cấp xã năm 2025",
"asOf": "2025-07-01"
}
],
"confidence": {
"level": "exact",
"ai": false
},
"dataUpdated": "2026-09-30",
"normalized": "12 nguyen hue, Phường Sài Gòn, Thành phố Hồ Chí Minh",
"houseNumber": "12",
"street": "nguyen hue",
"ward": {
"name": "Phường Sài Gòn",
"code": "26740",
"slug": "phuong-sai-gon"
},
"province": {
"name": "Thành phố Hồ Chí Minh",
"code": "79",
"slug": "ho-chi-minh"
},
"historical": {
"oldWard": {
"name": "Phường Bến Nghé",
"code": "26740",
"slug": "phuong-ben-nghe"
},
"oldDistrict": {
"name": "Quận 1",
"code": "760",
"slug": "quan-1"
},
"oldProvince": {
"name": "Thành phố Hồ Chí Minh",
"code": "79",
"slug": "thanh-pho-ho-chi-minh"
}
}
},
"candidates": []
},
"meta": {
"requestId": "req-6y",
"tookMs": 20,
"sources": [
{
"id": "gso-2025",
"name": "Danh mục đơn vị hành chính – Tổng cục Thống kê",
"asOf": "2025-03-01"
},
{
"id": "nq-202-2025",
"name": "Nghị quyết 202/2025/QH15 và các nghị quyết sắp xếp cấp xã năm 2025",
"asOf": "2025-07-01"
}
]
}
}
cURL
curl -X POST https://tradiachi.com/v1/address/normalize \
-H 'content-type: application/json' \
-d '{"address":"12 nguyen hue p ben nghe q1 tphcm"}'
JavaScript
const res = await fetch('https://tradiachi.com/v1/address/normalize', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
"address": "12 nguyen hue p ben nghe q1 tphcm"
}),
});
const { data, error } = await res.json();
Python
import requests
res = requests.post('https://tradiachi.com/v1/address/normalize', json={
"address": "12 nguyen hue p ben nghe q1 tphcm"
}, timeout=10)
print(res.json())
PHP
<?php
$ch = curl_init('https://tradiachi.com/v1/address/normalize');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['content-type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'address' => "12 nguyen hue p ben nghe q1 tphcm",
]),
CURLOPT_RETURNTRANSFER => true,
]);
var_dump(json_decode(curl_exec($ch), true));