新冠全国疫情(136)
其他 官方文档
新型冠状病毒全国疫情,包括到具体的县市区统计人数,136提供数据
基本说明:
接口地址:https://c.m.163.com/ug/api/wuhan/app/data/list-total
返回格式:json
请求方式:get
请求示例:https://c.m.163.com/ug/api/wuhan/app/data/list-total
请求参数说明:
名称 类型 必填 说明
null null 选填 不需要填写
返回参数说明:
名称 类型 说明
confirm int 较上日新增确诊个数
heal int 较上日治愈个数
dead int 较上日死亡个数
storeConfirm int 较上日现有确诊
input int 较上日境外输入确诊个数
confirm int 累计确诊个数
heal int 累计治愈个数
dead int 累计死亡个数
JSON返回示例:
{
	"reqId": 15992865229850270,
	"code": 10000,
	"msg": "成功",
	"data": {
		"chinaTotal": {
			"today": {
				"confirm": 23,
				"suspect": null,
				"heal": 46,
				"dead": 0,
				"severe": null,
				"storeConfirm": -23,
				"input": 10
			},
			"total": {
				"confirm": 90498,
				"suspect": 0,
				"heal": 85257,
				"dead": 4735,
				"severe": 0,
				"input": 2563
			},
			"extData": {
				"noSymptom": 338,
				"incrNoSymptom": 8
			}
		},
		"chinaDayList": [{
			"date": "2020-01-13",
			"today": {
				"confirm": 0,
				"suspect": 0,
				"heal": 0,
				"dead": 0,
				"severe": null,
				"storeConfirm": 0,
				"input": 0
			},
			"total": {
				"confirm": 41,
				"suspect": 0,
				"heal": 0,
				"dead": 1,
				"severe": null,
				"input": 0,
				"storeConfirm": 0
			},
			"extData": null,
			"lastUpdateTime": null
		}, {
			"date": "2020-01-14",
			"today": {
				"confirm": 0,
				"suspect": 0,
				"heal": 0,
				"dead": 0,
				"severe": null,
				"storeConfirm": 0,
				"input": 0
			},
			"total": {
				"confirm": 41,
				"suspect": 0,
				"heal": 0,
				"dead": 1,
				"severe": null,
				"input": 0,
				"storeConfirm": 0
			},
			"extData": null,
			"lastUpdateTime": null
		}]
	},
	"timestamp": 1599286522985
}
服务级错误码参照
错误码 说明
- -
完整教学代码示例
<?php
/**
 * Created by PhpStorm.
 * User: FZS
 * Time: 2020/09/05 16:46
 */
class freeApi
{
    private $apiUrl;

    public function __construct()
    {
        $this->apiUrl = 'https://c.m.163.com/ug/api/wuhan/app/data/list-total';
    }

    /**
     * 获取结果
     * @return array
     */
    public function getResult()
    {
        return file_get_contents($this->apiUrl);
    }
}
package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)

const (
	APIURL   = "https://c.m.163.com/ug/api/wuhan/app/data/list-total"
)

func main() {
	queryUrl := fmt.Sprintf("%s",APIURL)
	resp, err := http.Get(queryUrl)
	if err != nil {
		log.Println(err)
		return
	}

	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)

	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}