參數名稱 | 類型 | 必填 | 說明 |
---|---|---|---|
name | string | 否 | 國家名稱 |
continent | string | 否 | 所屬州 |
language | string | 否 | 官方語言 |
iscountry | int | 否 | 是否是國家 |
參數名稱 | 類型 | 說明 |
---|---|---|
countryid | string | 國家ID |
name | string | 國家名稱 |
cname | string | 中文名稱 |
ename | string | 英文名稱 |
capital | string | 首都 |
nationalanthem | string | 國歌 |
currency | string | 貨幣 |
code | string | 國家代碼 |
area | string | 國土面積 |
timezone | string | 時區 |
gdp | string | GDP總計 |
avggdp | string | 人均GDP |
areacode | string | 國際電話區號 |
domain | string | 國際域名縮寫 |
continent | string | 所在洲 |
waterrate | string | 水域率 |
mainreligion | string | 主要宗教 |
maincity | string | 主要城市 |
nationalday | string | 國慶日 |
political | string | 政治體制 |
leader | string | 國家領袖 |
population | string | 人口數量 |
populationdensity | string | 人口密度 |
mainethnic | string | 主要名族 |
roadaccess | string | 道路通行 |
mainuniversity | string | 主要學府 |
nationalflag | string | 國旗 |
humanindex | string | 人類發展指數 |
largestcity | string | 最大城市 |
nationalflower | string | 國花 |
geoposition | string | 地理位置 |
foreignname | string | 外文名稱 |
nationalmotto | string | 國家格言 |
govresidence | string | 政府駐地 |
climate | string | 氣候條件 |
iscountry | string | 是否國家 |
zimu | string | 首字母 |
<?php //獲取國家地區信息 require_once 'curl.func.php'; $appkey = 'your_appkey_here';//你的appkey $name= '中國'; $continent='亞洲'; $language='漢語'; $iscountry='0'; $url = "https://api.jisuapi.com/country/query?appkey=$appkey&name=$name&continent=$continent&language=$language&iscountry=$iscountry"; $result = curlOpen($url, ['ssl'=>true]); $jsonarr = json_decode($result, true); if($jsonarr['status'] != 0) { echo $jsonarr['msg']; exit(); } $country = $jsonarr['result']; echo $country['countryid'].' '.$country['name'].' '.$country['cname'].' '.$country['ename'].' '.$country['capital'].' '.$country['nationalanthem'].' '.$country['currency'].' '.$country['code'].' '.$country['language'].' '.$country['area'].' '.$country['timezone'].' '.$country['gdp'].' '.$country['avggdp'].' '.$country['areacode'].' '.$country['domain'].' '.$country['continent'].' '.$country['waterrate'].' '.$country['mainreligion'].' '.$country['maincity'].' '.$country['nationalday'].' '.$country['political'].' '.$country['leader'].' '.$country['population'].' '.$country['populationdensity'].' '.$country['mainethnic'].' '.$country['roadaccess'].' '.$country['mainuniversity'].' '.$country['nationalflag'].' '.$country['humanindex'].' '.$country['largestcity'].' '.$country['nationalflower'].' '.$country['geoposition'].' '.$country['foreignname'].' '.$country['nationalmotto'].' '.$country['govresidence'].' '.$country['climate'].' '.$country['iscountry"'].' '.$country['zimu'].'
';
{ "status": 0, "msg": "ok", "result": { "id": 218, "name": "中國", "cname": "中華人民共和國", "ename": "China", "capital": "北京", "nationalanthem": "義勇軍進行曲", "currency": "人民幣", "code": null, "language": "漢語", "area": "陸地面積960萬平方公里,領海約470萬平方公里", "timezone": "東八區", "gdp": null, "avggdp": null, "areacode": "+86", "domain": "CN", "continent": "亞洲", "waterrate": null, "mainreligion": "佛教、道教、伊斯蘭教", "maincity": null, "nationalday": null, "political": "人民代表大會制度", "leader": null, "population": null, "populationdensity": null, "mainethnic": "漢族", "roadaccess": "靠右行駛", "mainuniversity": null, "nationalflag": "/upload/nationalflag/218.jpg", "humanindex": null, "largestcity": null, "nationalflower": null, "geoposition": null, "foreignname": null, "nationalmotto": null, "govresidence": null, "climate": null, "iscountry": 0, "zimu": "C" } }
代號 | 說明 |
---|---|
201 | 國家ID為空 |
代號 | 說明 |
---|---|
101 | APPKEY為空或不存在 |
102 | APPKEY已過期 |
103 | APPKEY無請求此數據權限 |
104 | 請求超過次數限制 |
105 | IP被禁止 |
106 | IP請求超過限制 |
107 | 接口維護中 |
108 | 接口已停用 |