API Icon

城市天气id 正常

查询当前城市的天气id。

GET/POST JSON 调用: 1,998 测速中...

基本信息

接口地址
请求方式 GET/POST
返回格式 JSON
调用权限 公开/免费

请求参数说明

参数名 必填 类型 说明 示例值
city 必填 string 需要填的城市名 朝阳

调用示例

PHP cURL

$url = 'https://api.bugpk.com/api/citywid';
$params = [
    'key' => 'value' // 请替换实际参数
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);

echo $response;
                                    

返回结果示例

JSON Response
{
    "success": true,
    "type": "substring",
    "count": 3,
    "results": [
        {
            "name": "北京市朝阳",
            "id": "101010300",
            "type": "substring",
            "position": 9
        },
        {
            "name": "辽宁省朝阳市朝阳",
            "id": "101071201",
            "type": "substring",
            "position": 9
        },
        {
            "name": "吉林省长春市朝阳",
            "id": "101060110",
            "type": "substring",
            "position": 18
        }
    ]
}

返回参数说明

参数名 类型 说明 示例
success string 状态码
type string 类型
count string 结果条数
results string 信息

调试参数

响应结果

--
点击左侧"发送请求"查看结果...