Get the supported country list for address completion function
Request address
{域名地址}/api/place/countries
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/place/countries
Request Syntax
GET {域名地址}/api/place/countries
Request Headers
This interface involves only public request headers. For more information, please refer toCommon Request Headers (Common Request Headers).
Request parameters
None
Response header
This interface only involves common response headers. For more information, please refer toCommon Request Headers (Common Request Headers).
Return parameters
| Field name | Type | Description |
|---|---|---|
| code | int | Error code |
| msg | string | Error description |
| data | object[] | Country list |
data result item parameter
| Field name | Type | Description |
|---|---|---|
| id | int | Country ID |
| name | string | Country name |
| iso3 | string | ISO3 Code (such as CHN) |
| iso2 | string | ISO2 Code (such as CN) |
| phone_code | string | International dialing code |
| Capital | string | Capital |
| currency | string | Currency code (e.g. CNY) |
| Native | string | national language name |
| emoji | string | national flag emoji |
| latitude | string | latitude |
| longitude | string | longitude |
Usage Example
Request example
GET /api/place/countries HTTP/1.1
Host: your-domain.com
Content-Type: application/json
Response Example
{
"code": 0,
"data": [
{
"id": 48,
"name": "China",
"iso3": "CHN",
"iso2": "CN",
"phone_code": "+86",
"capital": "Beijing",
"currency": "CNY",
"native": "中国",
"emoji": "🇨🇳",
"latitude": "35.86166",
"longitude": "104.195397"
},
{
"id": 236,
"name": "United States",
"iso3": "USA",
"iso2": "US",
"phone_code": "+1",
"capital": "Washington",
"currency": "USD",
"native": "United States",
"emoji": "🇺🇸",
"latitude": "37.09024",
"longitude": "-95.712891"
}
],
"msg": ""
}
error code
| Error code | Description |
|---|---|
| 0 | OK |
| -1 | Error, the reason is indicated in msg |