← 地理与天气

搜索国家

GET /countrydata/search

按名称模糊搜索国家。返回每个匹配国家的完整资料,包括首都、人口、地区、语言和货币。适用于构建自动补全的国家搜索字段和用户可能输入部分或近似国家名称的位置选择器。

参数

q 必填

Search query

请求示例

基本用法
curl "https://nordapi.ee/api/v1/countrydata/search?q=norway"
Search for Norway
curl "https://nordapi.ee/api/v1/countrydata/search?q=norway"
Search for countries with 'united'
curl "https://nordapi.ee/api/v1/countrydata/search?q=united"
Search for island nations
curl "https://nordapi.ee/api/v1/countrydata/search?q=island"

实时响应

{
  "count": 1,
  "data": [
    {
      "area_km2": 386224.0,
      "borders": [
        "FIN",
        "SWE",
        "RUS"
      ],
      "capital": "Oslo",
      "code": "NO",
      "code_alpha3": "NOR",
      "continents": [
        "Europe"
      ],
      "currencies": {
        "NOK": {
          "name": "Norwegian krone",
          "symbol": "kr"
        }
      },
      "drives_on": "right",
      "flag_png": "https://flagcdn.com/w320/no.png",
      "flag_svg": "https://flagcdn.com/no.svg",
      "languages": {
        "nno": "Norwegian Nynorsk",
        "nob": "Norwegian Bokmål",
        "smi": "Sami"
      },
      "latitude": 62.0,
      "longitude": 10.0,
      "name": "Norway",
      "official_name": "Kingdom of Norway",
      "population": 5606944,
      "region": "Europe",
      "start_of_week": "monday",
      "subregion": "Northern Europe",
      "timezones": [
        "UTC+01:00"
      ]
    }
  ],
  "success": true
}