首页 »  API接口 »  实用API »  二十四节气查询API

二十四节气查询API

浏览次数:128 次
📖 API文档
🧪 在线测试
⚠️ 错误码
💻 示例代码
接口地址
https://www.chuangxinwu.cn/public/api/solar_term_api.php?action=current
请求方式
GET
返回格式
JSON
接口状态
正常 (HTTP 200) 上次检测:2026-07-10 05:56:03
更新时间
2026-05-06 16:52:34
📝 接口描述
============ 调用方式 ============\
\
1. 查询指定节气(当年):/solar_term_api.php?word=立春\
\
2. 查询指定年份的节气:/solar_term_api.php?word=立春&year=2024\
\
3. 获取所有节气列表:/solar_term_api.php?action=list\
\
4. 获取当年所有节气:/solar_term_api.php?action=year&year=2024\
\
5. 根据日期查询节气:/solar_term_api.php?date=2024-02-04\
\
6. 获取当前节气:/solar_term_api.php?action=current
📋 请求示例
【基础请求】
GET https://www.chuangxinwu.cn/public/api/solar_term_api.php?action=current

【请求头】
Content-Type: application/json
Accept: application/json

【参数说明】
GET请求参数通过URL传递:
https://www.chuangxinwu.cn/public/api/solar_term_api.php?action=current?参数名1=参数值1&参数名2=参数值2

【调用示例】

# cURL
curl -X GET 'https://www.chuangxinwu.cn/public/api/solar_term_api.php?action=current' \
  -H 'Content-Type: application/json'

# JavaScript (Fetch)
fetch('https://www.chuangxinwu.cn/public/api/solar_term_api.php?action=current', {
    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/solar_term_api.php?action=current');
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/solar_term_api.php?action=current'
response = requests.get(url)
print(response.json())
📤 真实返回示例
{
    "code": 200,
    "success": true,
    "data": {
        "name": "大暑",
        "nameimg": "dashu",
        "day": "7月22日-24日",
        "date": {
            "gregdate": "2026年7月23日",
            "lunardate": "六月廿四",
            "cnyear": "丙午年",
            "cnmonth": "六月",
            "cnday": "廿四",
            "cnzodiac": "马"
        },
        "yuanyin": "大暑是一年中最热的时期。此时太阳到达黄经120°。",
        "shiju": "赤日几时过,清风无处寻。经书聊枕籍,瓜李漫浮沉。——宋·曾几《大暑》",
        "jieshao": "大暑,二十四节气之一,夏季最后一个节气。“暑”是炎热的意思,大暑,指炎热之极。大暑相对小暑,更加炎热,是一年中阳光最猛烈、最炎热的节气。",
        "xishu": "送大暑船:祈福平安;吃仙草:消暑解热;斗蟋蟀:民间娱乐;晒伏姜。",
        "meishi": "仙草、伏茶、荔枝、羊肉",
        "yiji": "宜:祭祀、祈福、求嗣、开光、嫁娶;忌:安葬、伐木、作灶。"
    },
    "message": "查询成功"
}
📌 请求参数 (键值对)
📊 返回结果
点击"发起请求"查看返回数据
错误码说明
200请求成功
400请求参数错误
401未授权访问
403禁止访问
404接口不存在
500服务器内部错误
🔧 JavaScript (Fetch)
fetch('/api/proxy.php?url=https%3A%2F%2Fwww.chuangxinwu.cn%2Fpublic%2Fapi%2Fsolar_term_api.php%3Faction%3Dcurrent', {
    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/solar_term_api.php?action=current');
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/solar_term_api.php?action=current'
response = requests.request('GET', url)
print(response.json())

同类推荐

🔥 同分类下热门接口