接口地址:http://apis.juhe.cn/springTravel/query |
---|
返回格式:json |
请求方式:get/post |
请求示例:http://apis.juhe.cn/springTravel/query?key=&from=10191&to=10349 |
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
key | string | 必填 | 对应平台key 扫码关注公众号 |
from | int | 必填 | 出发地城市ID |
to | int | 必填 | 目的城市ID |
名称 | 类型 | 说明 |
---|---|---|
error_code | int | 返回码 |
reason | string | 返回说明 |
result | string | 返回结果集 |
from_info | object | 出发地城市-出行政策信息 |
to_info | object | 目的地城市-出行政策信息 |
province_id | stirng | 省份ID |
province_name | stirng | 省份名称 |
city_id | stirng | 城市ID |
city_name | stirng | 城市名称 |
health_code_desc | stirng | 健康码描述 |
health_code_gid | stirng | 健康码使用教程链接 |
health_code_name | stirng | 健康码名称 |
health_code_picture | stirng | 健康码图片 |
health_code_style | stirng | 健康码类型 0:小程序 1:二维码,其他:未知 |
high_in_desc | stirng | 高风险地区,进入政策描述 |
low_in_desc | stirng | 低风险地区,进入政策描述 |
out_desc | stirng | 出行政策描述 |
risk_level | stirng | 风险等级,0:暂无 1:低风险 2:中风险 3:高风险 4:部分地区中风险 5:部分地区高风险 6:部分地区中、高风险 |
from_covid_info | object | 出发地城市-疫情数据,可能为null |
to_covid_info | object | 出发地城市-疫情数据,可能为null |
today_confirm | stirng | 新增确诊 |
total_confirm | stirng | 累计确诊 |
total_heal | stirng | 治愈 |
total_dead | stirng | 死亡 |
updated_at | stirng | 更新时间 |
is_updated | stirng | 今日是否更新 |
{
"reason": "success",
"result": {
"from_info": {
"province_id": "16",
"city_id": "10191",
"city_name": "苏州",
"health_code_desc": "支付宝扫一扫,进入小程序",
"health_code_gid": "https://www.sdk.cn/details/jgRaEkelBp7R85ZmYq",
"health_code_name": "苏康码\r\r\n",
"health_code_picture": "https://cdn.juhekeji.com/spring_travel/e681692d49d50d8eb9d2bade122a8654.png",
"health_code_style": "1",
"high_in_desc": "1.中高风险地区人员须持7日内核酸检测阴性证明,第一时间主动报备,配合做好信息登记、核酸检测、集中隔离医学观察等防控工作。\n2.根据江苏省要求:对有中高风险地区所在设区市(直辖市为区)旅居史的来苏返苏人员,持有7日内核酸检测阴性证明(或能出示包括7日内核酸检测阴性证明的健康码),可以自由有序流动;对不能提供7日内核酸检测阴性证明的人员,要进行核酸检测,其所在社区应加强健康管理。",
"low_in_desc": "3.低风险地区人员进苏州无需持核酸阴性证明及隔离,需持健康码绿码。",
"out_desc": "出苏无需核酸阴性证明,原则上非必要不出省,不得前往中高风险区及其所在的设区市。",
"province_name": "江苏",
"risk_level": "1"
},
"to_info": {
"province_id": "31",
"city_id": "10349",
"city_name": "温州",
"health_code_desc": "支付宝扫一扫,进入小程序",
"health_code_gid": "https://www.sdk.cn/details/vjxQ9bLPEp70bqnKOZ",
"health_code_name": "浙江健康码",
"health_code_picture": "https://cdn.juhekeji.com/spring_travel/ad9ef3f794107b400aed52e0e721b578.png",
"health_code_style": "1",
"high_in_desc": "1.疫情高风险地区,经综合评估,可对其所在城市来浙返浙人员实行“7+7”健康管理措施,即先实施7天居家健康观察,第1天和第7天分别进行一次核酸检测;对居家健康观察期满核酸检测阴性者,继续实施7天日常健康监测,期满再进行一次核酸检测。\n2.疫情中风险地区,所在街道或县(市、区)来浙返浙人员,一律核验3天内核酸检测阴性证明;对无法提供相关证明的,立即引导到指定场所接受核酸检测;对结果为阴性者实施7天日常健康监测,期满进行一次核酸检测。\n3.入境人员需14天集中隔离+7天居家健康观察+7天健康监测。",
"low_in_desc": "低风险地区进温州无需持核酸阴性证明及隔离,需持健康码绿码。",
"out_desc": "出行无需核酸阴性证明,非必要避免前往中高风险地区。",
"province_name": "浙江",
"risk_level": "1"
},
"from_covid_info": {
"city_id": "10191",
"city_name": "苏州",
"today_confirm": "0",
"total_confirm": "87",
"total_heal": "87",
"total_dead": "0",
"updated_at": "2021-01-20 10:07:33",
"is_updated": "0"
},
"to_covid_info": {
"city_id": "10349",
"city_name": "温州",
"today_confirm": "0",
"total_confirm": "504",
"total_heal": "503",
"total_dead": "1",
"updated_at": "2021-01-20 10:07:33",
"is_updated": "0"
},
"tc_tag": "1",
"fc_tag": "1",
"t_tag": "1",
"f_tag": "1"
},
"error_code": 0
}
错误码 | 说明 |
---|---|
10001 | 错误的请求KEY |
10002 | 该KEY无请求权限 |
10003 | KEY过期 |
10004 | 错误的OPENID |
10005 | 应用未审核超时,请提交认证 |
10007 | 未知的请求源 |
10008 | 被禁止的IP |
10009 | 被禁止的KEY |
10011 | 当前IP请求超过限制 |
10012 | 请求超过次数限制 |
10013 | 测试KEY超过请求限制 |
10014 | 系统内部异常(调用充值类业务时,请务必联系客服或通过订单查询接口检测订单,避免造成损失) |
10020 | 接口维护 |
10021 | 接口停用 |
<?php
$url = "http://apis.juhe.cn/springTravel/query";
$params = array(
"to" => "1",
"from" => "2",
"key" => "您申请的ApiKey",//应用APPKEY(应用详细页查询)
);
$paramstring = http_build_query($params);
$content = juheCurl($url, $paramstring);
$result = json_decode($content, true);
if ($result) {
var_dump($result);
} else {
//请求异常
}
/**
* 请求接口返回内容
* @param string $url [请求的URL地址]
* @param string $params [请求的参数]
* @param int $ipost [是否采用POST形式]
* @return string
*/
function juheCurl($url, $params = false, $ispost = 0)
{
$httpInfo = array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_USERAGENT, 'JuheData');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
if ($ispost) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, $url);
} else {
if ($params) {
curl_setopt($ch, CURLOPT_URL, $url.'?'.$params);
} else {
curl_setopt($ch, CURLOPT_URL, $url);
}
}
$response = curl_exec($ch);
if ($response === FALSE) {
//echo "cURL Error: " . curl_error($ch);
return false;
}
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$httpInfo = array_merge($httpInfo, curl_getinfo($ch));
curl_close($ch);
return $response;
}