{
"count": 252,
"countries": [
{
"alpha2": "AF",
"alpha3": "AFG",
"numeric": "004",
"name": "Afghanistan",
"flag": "🇦🇫",
"capital": "Kabul",
"continent": "Asia",
"continent_code": "AS",
"currency_code": "AFN",
"calling_code": "+93",
"population": 43844111
},
{
"alpha2": "AX",
"alpha3": "ALA",
"numeric": "248",
"name": "Aland Islands",
"flag": "🇦🇽",
"capital": "Mariehamn",
"continent": "Europe",
"continent_code": "EU",
"currency_code": "EUR",
"calling_code": "+358-18",
"population": 26711
},
{
"alpha2": "AL",
"alpha3": "ALB",
"numeric": "008",
"name": "Albania",
"flag": "🇦🇱",
"capital": "Tirana",
"continent": "Europe",
"continent_code": "EU",
"currency_code": "ALL",
"calling_code": "+355",
"population": 2349580
}
],
"attribution": "Country data from GeoNames (geonames.org), CC BY 4.0. Subdivisions from ISO 3166-2."
}
curl --location --request GET 'https://zylalabs.com/api/15050/countries+api/39818/list+or+search+countries?eu_only=false' --header 'Authorization: Bearer YOUR_API_KEY'
{
"code": "EUR",
"name": "Euro",
"numeric": "978",
"countries": [
{
"alpha2": "AX",
"name": "Aland Islands",
"flag": "🇦🇽"
},
{
"alpha2": "AD",
"name": "Andorra",
"flag": "🇦🇩"
},
{
"alpha2": "AT",
"name": "Austria",
"flag": "🇦🇹"
}
]
}
curl --location --request GET 'https://zylalabs.com/api/15050/countries+api/39819/currency+details+and+the+countries+that+use+it&code=Required' --header 'Authorization: Bearer YOUR_API_KEY'
{
"alpha2": "FR",
"alpha3": "FRA",
"numeric": "250",
"name": "France",
"flag": "🇫🇷",
"capital": "Paris",
"continent": "Europe",
"continent_code": "EU",
"currency_code": "EUR",
"calling_code": "+33",
"population": 68720337,
"official_name": "French Republic",
"currency_name": "Euro",
"area_km2": 547030,
"tld": ".fr",
"languages": [
"fr-FR",
"frp",
"br"
],
"neighbours": [
"CH",
"DE",
"BE"
],
"time_zones": [
"Europe/Paris"
],
"eu_member": true,
"eurozone": true,
"postal_code_format": "#####",
"postal_code_regex": "^(\\d{5})$",
"subdivision_count": 124,
"attribution": "Country data from GeoNames (geonames.org), CC BY 4.0. Subdivisions from ISO 3166-2."
}
curl --location --request GET 'https://zylalabs.com/api/15050/countries+api/39820/look+up+one+country&code=Required' --header 'Authorization: Bearer YOUR_API_KEY'
{
"country": "US",
"count": 57,
"subdivisions": [
{
"code": "US-AL",
"name": "Alabama",
"type": "State",
"parent": null
},
{
"code": "US-AK",
"name": "Alaska",
"type": "State",
"parent": null
},
{
"code": "US-AS",
"name": "American Samoa",
"type": "Outlying area",
"parent": null
}
]
}
curl --location --request GET 'https://zylalabs.com/api/15050/countries+api/39821/states+provinces+and+regions+of+a+country&code=Required' --header 'Authorization: Bearer YOUR_API_KEY'
{
"country": "DE",
"count": 9,
"neighbours": [
{
"alpha2": "CH",
"alpha3": "CHE",
"numeric": "756",
"name": "Switzerland",
"flag": "🇨🇭",
"capital": "Bern",
"continent": "Europe",
"continent_code": "EU",
"currency_code": "CHF",
"calling_code": "+41",
"population": 9092436
},
{
"alpha2": "PL",
"alpha3": "POL",
"numeric": "616",
"name": "Poland",
"flag": "🇵🇱",
"capital": "Warsaw",
"continent": "Europe",
"continent_code": "EU",
"currency_code": "PLN",
"calling_code": "+48",
"population": 36435861
},
{
"alpha2": "NL",
"alpha3": "NLD",
"numeric": "528",
"name": "The Netherlands",
"flag": "🇳🇱",
"capital": "Amsterdam",
"continent": "Europe",
"continent_code": "EU",
"currency_code": "EUR",
"calling_code": "+31",
"population": 18087633
}
],
"attribution": "Country data from GeoNames (geonames.org), CC BY 4.0. Subdivisions from ISO 3166-2."
}
curl --location --request GET 'https://zylalabs.com/api/15050/countries+api/39822/countries+sharing+a+land+border&code=Required' --header 'Authorization: Bearer YOUR_API_KEY'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 国家 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
按ISO代码的国家数据:首都、货币、拨号代码、语言、时区、邻国和子区域
打包的GeoNames国家表(CC BY 4.0)和ISO 3166-2子区域 响应包含GeoNames的归属
2026年11月14日的GeoNames快照中的人口和面积
每个端点返回与国家相关的JSON数据,包括首都、货币、拨号代码、语言、时区和地理邻国等详细信息。例如,“查找一个国家”端点提供有关特定国家的全面信息,而“列出或搜索国家”端点返回多个国家的摘要
关键字段包括国家代码(alpha2,alpha3,numeric),名称,首都,货币代码,拨号代码,人口,语言和时区。例如,“获取查找一个国家”端点包括“official_name”和“area_km2”等字段,以获取详细的国家信息
该API提供各种信息类型,如国家人口统计(人口、面积)、地理数据(邻国、细分地区)和经济细节(货币、拨号代码)。每个端点专注于特定方面,例如“获取货币详情”端点列出使用特定货币的国家
响应数据以JSON格式构建,通常包含一个主对象,其中有相关字段和嵌套数组用于相关数据。例如,“获取国家的州、省和地区”端点返回一个计数和一个包含子区域的数组,每个子区域都有自己的属性,如代码和名称
参数因端点而异;例如,“获取列表或搜索国家”端点可能接受用于按名称或地区过滤的查询参数。用户可以通过指定国家代码或货币代码来定制请求以检索目标数据
用户可以利用返回的数据用于旅行规划 教育资源或经济分析 例如 "获取共享陆地边界的国家" 端点可以帮助识别地理研究或旅行计划的邻国
数据准确性通过从可靠数据库如GeoNames和ISO标准进行来源维护 定期更新和检查确保信息反映当前的地缘政治现实 增强了用户的可靠性
典型的用例包括开发教育工具 创建旅游应用程序 进行市场研究 和分析人口趋势 综合数据允许在包括旅游和国际商务在内的各个行业中进行多样化的应用