奥运会排行榜
奥运会排行名单金牌银牌获取情况

接口地址: https://wmkxz.cn/api/ph

返回格式: JSON

请求方式: GET/POST

请求示例: https://wmkxz.cn/api/ph

所有接口需携带秘钥,以免更新导致请求失败!

请求参数说明:

名称 必填 类型 说明
type int 输出数量默认10

返回参数说明:

名称 类型 说明
rank string 排名
countryname string 国名
countryid string 国际
gold string 金牌
silver string 银牌
bronze string 铜牌
count string 总计

返回示例:

{
    "code": "200",
    "message": "奥运会排行榜",
    "medalsList": [
        {
            "rank": "1",
            "countryname": "美国",
            "countryid": "USA",
            "gold": "39",
            "silver": "41",
            "bronze": "33",
            "count": "113"
        },
        {
            "rank": "2",
            "countryname": "中国",
            "countryid": "CHN",
            "gold": "38",
            "silver": "32",
            "bronze": "19",
            "count": "89"
        },
        {
            "rank": "3",
            "countryname": "日本",
            "countryid": "JPN",
            "gold": "27",
            "silver": "14",
            "bronze": "17",
            "count": "58"
        },
        {
            "rank": "4",
            "countryname": "英国",
            "countryid": "GBR",
            "gold": "22",
            "silver": "20",
            "bronze": "22",
            "count": "64"
        }
    ]
}

错误码格式说明:

名称 类型 说明
200 int 成功
201 int 失败

代码示例:

<?php
$apiUrl = "https://wmkxz.cn/api/ph";
$params = array(
"type" => "10",
"apiKey" => "您的API密钥"
);

$queryString = http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiUrl . "?" . $queryString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo "cURL 错误: " . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>