新冠全国疫情(新浪)
其他 官方文档
新型冠状病毒全国疫情,包括到具体的县市区统计人数,新浪提供数据
基本说明:
接口地址:https://interface.sina.cn/news/wap/fymap2020_data.d.json
返回格式:json
请求方式:get
请求示例:https://interface.sina.cn/news/wap/fymap2020_data.d.json
请求参数说明:
名称 类型 必填 说明
null null 选填 不需要填写
返回参数说明:
名称 类型 说明
times string 统计数据截至日期
mtime string 统计数据截至日期
cachetime string 缓存时间
gntotal int 累计确诊
deathtotal int 累计死亡
sustotal int 有病例城市个数
curetotal int 累计治愈
jwsrNum int 境外累计输入病例
add_daily array 全国疫情数据
jwsrTop array 境外输入城市及确诊个数
list array 城市病例详情
JSON返回示例:
{
	"data_title": "fymap",
	"data": {
		"times": "截至9月5日13时00分",
		"mtime": "2020-09-05 13:00:00",
		"cachetime": "2020-09-05 13:26:08",
		"gntotal": "90498",
		"deathtotal": "4735",
		"sustotal": "3",
		"curetotal": "85252",
		"econNum": "511",
		"heconNum": "44",
		"asymptomNum": "285",
		"jwsrNum": "2200",
		"add_daily": {
			"addcon": 90498,
			"addsus": 3,
			"adddeath": 4735,
			"addcure": 85252,
			"wjw_addsus": "2",
			"addcon_new": "+90498",
			"adddeath_new": "+4735",
			"addcure_new": "+85252",
			"wjw_addsus_new": " 待公布",
			"addecon_new": "+511",
			"addhecon_new": " 待公布",
			"addjwsr": " 待公布",
			"addasymptom": " 待公布"
		},
		"jwsrTop": [{
			"jwsrNum": "574",
			"name": "上海",
			"ename": "shanghai"
		}, {
			"jwsrNum": "387",
			"name": "黑龙江",
			"ename": "heilongjiang"
		}, {
			"jwsrNum": "184",
			"name": "内蒙古",
			"ename": "neimenggu"
		}, {
			"jwsrNum": "176",
			"name": "北京",
			"ename": "beijing"
		}, {
			"jwsrNum": "129",
			"name": "陕西",
			"ename": "shanxis"
		}, {
			"jwsrNum": "94",
			"name": "天津",
			"ename": "tianjin"
		}, {
			"jwsrNum": "89",
			"name": "福建",
			"ename": "fujian"
		}, {
			"jwsrNum": "77",
			"name": "甘肃",
			"ename": "gansu"
		}, {
			"jwsrNum": "69",
			"name": "山西",
			"ename": "shanxi"
		}, {
			"jwsrNum": "68",
			"name": "山东",
			"ename": "shandong"
		}],
		"list": [{
			"name": "北京",
			"ename": "beijing",
			"value": "935",
			"conadd": "待公布",
			"hejian": "",
			"econNum": "0",
			"susNum": "0",
			"deathNum": "9",
			"asymptomNum": "",
			"cureNum": "926",
			"zerodays": "3",
			"jwsr": "含境外输入",
			"jwsrNum": "176",
			"showCurData": "0",
			"adddaily": {
				"conadd": " 待公布",
				"deathadd": " 待公布",
				"cureadd": " 待公布",
				"econadd": " 待公布",
				"conadd_n": "待公布",
				"deathadd_n": "待公布",
				"cureadd_n": "待公布"
			},
			"city": [{
				"name": "境外输入人员",
				"conNum": "176",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "176",
				"deathNum": "0",
				"mapName": "",
				"citycode": "",
				"econNum": "0",
				"zerodays": "85",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "东城区",
				"conNum": "19",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "19",
				"deathNum": "0",
				"mapName": "东城区",
				"citycode": "CN11010100000000",
				"econNum": "0",
				"zerodays": "22",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "西城区",
				"conNum": "59",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "59",
				"deathNum": "0",
				"mapName": "西城区",
				"citycode": "CN11010200000000",
				"econNum": "0",
				"zerodays": "16",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "朝阳区",
				"conNum": "77",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "77",
				"deathNum": "0",
				"mapName": "朝阳区",
				"citycode": "CN11010500000000",
				"econNum": "0",
				"zerodays": "17",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "海淀区",
				"conNum": "82",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "82",
				"deathNum": "0",
				"mapName": "海淀区",
				"citycode": "CN11010800000000",
				"econNum": "0",
				"zerodays": "13",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "丰台区",
				"conNum": "273",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "273",
				"deathNum": "0",
				"mapName": "丰台区",
				"citycode": "CN11010600000000",
				"econNum": "0",
				"zerodays": "3",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "石景山区",
				"conNum": "15",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "15",
				"deathNum": "0",
				"mapName": "石景山区",
				"citycode": "CN11010700000000",
				"econNum": "0",
				"zerodays": "24",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "门头沟区",
				"conNum": "5",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "5",
				"deathNum": "0",
				"mapName": "门头沟区",
				"citycode": "CN11010900000000",
				"econNum": "0",
				"zerodays": "23",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "房山区",
				"conNum": "20",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "20",
				"deathNum": "0",
				"mapName": "房山区",
				"citycode": "CN11011100000000",
				"econNum": "0",
				"zerodays": "23",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "通州区",
				"conNum": "20",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "11",
				"deathNum": "9",
				"mapName": "通州区",
				"citycode": "CN11011200000000",
				"econNum": "0",
				"zerodays": "18",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "顺义区",
				"conNum": "10",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "10",
				"deathNum": "0",
				"mapName": "顺义区",
				"citycode": "CN11011300000000",
				"econNum": "0",
				"zerodays": "151",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "昌平区",
				"conNum": "30",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "30",
				"deathNum": "0",
				"mapName": "昌平区",
				"citycode": "CN11011400000000",
				"econNum": "0",
				"zerodays": "13",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "大兴区",
				"conNum": "104",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "104",
				"deathNum": "0",
				"mapName": "大兴区",
				"citycode": "CN11011500000000",
				"econNum": "0",
				"zerodays": "8",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "怀柔区",
				"conNum": "7",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "7",
				"deathNum": "0",
				"mapName": "怀柔区",
				"citycode": "CN11011600000000",
				"econNum": "0",
				"zerodays": "153",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "密云区",
				"conNum": "7",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "7",
				"deathNum": "0",
				"mapName": "密云区",
				"citycode": "CN11011800000000",
				"econNum": "0",
				"zerodays": "148",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "延庆区",
				"conNum": "1",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "1",
				"deathNum": "0",
				"mapName": "延庆区",
				"citycode": "CN11011900000000",
				"econNum": "0",
				"zerodays": "156",
				"jwsr": "",
				"asymptomNum": ""
			}, {
				"name": "外地来京人员",
				"conNum": "25",
				"conadd": "待公布",
				"conadd_str": " 待公布",
				"hejian": "",
				"susNum": "0",
				"cureNum": "25",
				"deathNum": "0",
				"mapName": "",
				"citycode": "",
				"econNum": "0",
				"zerodays": "135",
				"jwsr": "",
				"asymptomNum": ""
			}]
		}],
		"worldlist": [{
			"name": "中国",
			"value": "90498",
			"susNum": "3",
			"deathNum": "4735",
			"cureNum": "85252",
			"econNum": "511"
		}],
		"caseClearCityInfo": {
			"ljClearCityNum": 331,
			"ljNoClearCityNum": 14,
			"ljCityNum": 345
		}
	}
}
服务级错误码参照
错误码 说明
- -
完整教学代码示例
<?php
/**
 * Created by PhpStorm.
 * User: FZS
 * Time: 2020/09/05 16:46
 */
class freeApi
{
    private $apiUrl;

    public function __construct()
    {
        $this->apiUrl = 'https://interface.sina.cn/news/wap/fymap2020_data.d.json';
    }

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

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

const (
	APIURL   = "https://interface.sina.cn/news/wap/fymap2020_data.d.json"
)

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))
}