欢迎使用 WOW API 平台!
WOWAPI 合成展示图
当前时间
运行正常

全世界人口数量详情

接口地址
https://api.wq.cgdey.cn/API/population/population.php
请求方式GET
返回格式JSON
请求参数:
名称必填类型描述
snapshot_type string 可选,visit=访问采集,daily=每日定时采集,默认 visit
返回参数:
名称类型描述
snapshot_date string 人口快照所属日期
snapshot_type string 快照类型:visit 或 daily
now_population integer 当前世界总人口数量
male integer 当前男性人口数量
female integer 当前女性人口数量
this_year_human integer 今年出生人口累计数量
this_day_human integer 今日出生人口数量
this_year_dead_human integer 今年死亡人口累计数量
this_day_dead_human integer 今日死亡人口数量
this_year_net_migration integer 今年净迁移人口数量
this_day_net_migration integer 今日净迁移人口数量
this_year_population_growth integer 今年人口净增长数量
this_day_population_growth integer 今日人口净增长数量
captured_at string 本条人口快照采集时间
状态码说明:
HTTP 状态业务状态说明
200success请求成功,已返回世界人口快照数据。
503maintain接口临时维护中。
系统级错误:
状态码错误标识说明
400bad_request请求格式错误或参数不符合要求。
429too_many_requests请求过于频繁,请稍后重试。
500server_error服务器内部异常,未正常返回内容。
GET 请求:
<?php
echo file_get_contents('https://api.wq.cgdey.cn/API/population/population.php');
POST 请求:
<?php
$ch = curl_init('https://api.wq.cgdey.cn/API/population/population.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['key' => 'value']));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
GET 请求:
import requests

response = requests.get('https://api.wq.cgdey.cn/API/population/population.php')
print(response.text)
POST 请求:
import requests

response = requests.post(
    'https://api.wq.cgdey.cn/API/population/population.php',
    json={'key': 'value'}
)
print(response.text)
GET 请求:
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.wq.cgdey.cn/API/population/population.php"))
    .GET()
    .build();

HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());

System.out.println(response.body());
POST 请求:
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.wq.cgdey.cn/API/population/population.php"))
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString("{\"key\":\"value\"}"))
    .build();

HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());

System.out.println(response.body());
复制成功