接口地址
https://www.chuangxinwu.cn/public/api/timezone_api.php?word=中国
接口状态
正常 (HTTP 200) 上次检测:2026-05-13 12:08:29
📝 接口描述
* 调用方式:
* 1. 查询国家/地区时区:http://你的域名/timezone_api.php?word=中国
* 2. 查询英文名称:http://你的域名/timezone_api.php?word=China
* 3. 查询二字码:http://你的域名/timezone_api.php?word=CN
* 4. 查询三字码:http://你的域名/timezone_api.php?word=CHN
* 5. 获取所有国家列表:http://你的域名/timezone_api.php?action=list
📋 请求示例
【基础请求】
GET https://www.chuangxinwu.cn/public/api/timezone_api.php?word=中国
【请求头】
Content-Type: application/json
Accept: application/json
【参数说明】
GET请求参数通过URL传递:
https://www.chuangxinwu.cn/public/api/timezone_api.php?word=中国?参数名1=参数值1&参数名2=参数值2
【调用示例】
# cURL
curl -X GET 'https://www.chuangxinwu.cn/public/api/timezone_api.php?word=中国' \
-H 'Content-Type: application/json'
# JavaScript (Fetch)
fetch('https://www.chuangxinwu.cn/public/api/timezone_api.php?word=中国', {
method: 'GET',
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data));
# PHP (cURL)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.chuangxinwu.cn/public/api/timezone_api.php?word=中国');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
# Python (requests)
import requests
url = 'https://www.chuangxinwu.cn/public/api/timezone_api.php?word=中国'
response = requests.get(url)
print(response.json())
📤 真实返回示例
{
"code": 200,
"success": true,
"data": {
"country": "中国",
"countryen": "China",
"countryezm": "CN",
"countryszm": "CHN",
"timezone": "Asia\/Shanghai",
"areaname": "中国标准时间",
"continent": "亚洲",
"current_time": {
"datetime": "2026-05-13 12:08:29",
"date": "2026-05-13",
"time": "12:08:29",
"weekday": "Wednesday",
"timestamp": 1778645309,
"utc_offset": "+08:00"
}
},
"fuzzy": false,
"message": "查询成功"
}
🔧 JavaScript (Fetch)
fetch('/api/proxy.php?url=https%3A%2F%2Fwww.chuangxinwu.cn%2Fpublic%2Fapi%2Ftimezone_api.php%3Fword%3D%E4%B8%AD%E5%9B%BD', {
method: 'GET',
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
🐘 PHP (cURL)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.chuangxinwu.cn/public/api/timezone_api.php?word=中国');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
📡 Python (requests)
import requests
url = 'https://www.chuangxinwu.cn/public/api/timezone_api.php?word=中国'
response = requests.request('GET', url)
print(response.json())