新冠肺炎疫情实时数据
文章来源:未知
更新时间:2022-12-31 09:37:43
口地址
接口地址 :https://api.vvhan.com/api/covid
返回格式
返回格式:JSON
请求方式:
请求方式:GET
请求示例(全国)
请求实例 (全国):
https://api.vvhan.com/api/covid
请求示例(城市)
请求实例 (城市) :https://api.vvhan.com/api/covid?city=南京
参数说明
名称 |
必填 |
类型 |
说明 |
city |
否 |
string |
城市疫情 |
返回数据
{"success":true,"data":{"updatetime":"2022-11-03 09:28:47","country":"中国","province":"江苏省","city":"南京","now":{"sure_new_loc":2,"sure_new_hid":7,"sure_present":206},"history":{"sure_cnt":601,"cure_cnt":395,"die_cnt":"-"},"danger":{"high_risk":26,"medium_risk":3}}}
调用实例
自行调用
示实例例代码
<?php
header("Content-Type:text/json;charset=UTF-8");
date_default_timezone_set("PRC");
$city = $_GET["city"];
$url = "https://api.vvhan.com/api/covid?city=" . $city;
$data = file_get_contents($url);
echo $data;
?>