💡 ToolFK provides all tools free of charge. The ads you see help us keep the site running sustainably. Thank you for your support! ❤️ ToolFK tools are free. Ads help keep the site running. Thanks! ❤️

中国老黄历 API

提供中国老黄历吉日在线查询,支持API接口调用,快速获取黄历宜忌与吉日信息,助力生活与开发应用。

接口文档 《查看会员》
接口地址: http://api.toolfk.com/api/lunar | 在线体验接口
请求方法: [ "GET", "POST" ]
请求参数:
名称类型描述示例
tokenstring请求的token用户中心获取token
timestring出生日期[农历](年-月-日 或 年-月-日 时:分:秒 格式)1992-2-12
-- Response Format --
返回数据:
{
    "status": 1,
    "data": {
        "公历": "1992年 3月 15日 星期日 双鱼座 (阳历)",
        "农历": "一九九二年 二月 十二 (阴历)",
        "佛历": "二五三六年 二月 十二",
        "道历": "四六八九年 二月 十二",
        "年": "壬申年 属猴 剑锋金",
        "月": "癸卯月 属兔 金箔金",
        "日": "庚寅日 属虎 松柏木",
        "儒略日": 2448696.5,
        "月名": "仲春",
        "月相": "宵",
        "物候": "惊蛰 三候,鹰化为鸠",
        "三元九运": "下元 下运",
        "治水": "七龙治水",
        "分饼": "七人分饼",
        "耕田": "四牛耕田",
        "得金": "二日得金",
        "日禄": "申命互禄 甲命进禄",
        "六曜": "先胜",
        "彭祖百忌": "庚不经络织机虚张 寅不祭祀神鬼不尝",
        "每日宜忌": "宜:安床 伐木 拆卸 修造 动土 上梁 立券 交易 栽种 纳畜 牧养 入殓 安葬,忌:嫁娶 祭祀 开光 出行 出火 移徙 入宅 安门",
        "吉神宜趋": "月空 王日 五富 不将 普护 五合 青龙 鸣吠对",
        "凶煞宜忌": "游祸 血支 归忌",
        "相冲": "虎日 冲(甲申)猴",
        "岁煞": "北",
        "星宿": "南方星日马 (凶)",
        "星宿歌诀": "星宿日好造新房,进职加官近帝王,不可埋葬并放水,凶星临位女人亡,生离死别无心恋,要自归休别嫁郎,孔子九曲殊难度,放水开门天命伤。",
        "贵神方位": "阳贵神:正南 阴贵神:东北",
        "喜神方位": "西北",
        "福神方位": "西南",
        "财神方位": "正东",
        "本月胎神": "占户窗",
        "今日胎神": "碓磨炉 外正北",
        "太岁方位": "中宫",
        "值星": "闭",
        "十二天神": "青龙(黄道) 吉",
        "空亡所值": "年:戌亥, 月:辰巳, 日:午未",
        "九星": "六白 - 青龙星(金) - 吉神",
        "九星歌诀": "神光跃青龙,财气喜重重,投入有酒食,赌彩最兴隆,更逢相生旺,休言克破凶,见贵安营寨,万事总吉同。",
        "上一节气": "惊蛰 1992-03-05 15:52:08 星期四",
        "下一节气": "春分 1992-03-20 16:48:04 星期五",
        "节日/纪念日": "消费者权益日",
        "数九": "",
        "三伏": ""
    }
}
                
Code Examples:
  • Curl
  • PHP
  • Java
  • Python
  • JavaScript
  • Go
curl -X POST \
  http://api.toolfk.com/api/lunar \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'token=用户中心获取&time=1992-2-12'
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.toolfk.com/api/lunar",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "token=用户中心获取&time=1992-2-12",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "token=用户中心获取&time=1992-2-12");
Request request = new Request.Builder()
  .url("http://api.toolfk.com/api/lunar")
  .post(body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();

Response response = client.newCall(request).execute();
import requests

url = "http://api.toolfk.com/api/lunar"

payload = "token=用户中心获取&time=1992-2-12"
headers = {'Content-Type': "application/x-www-form-urlencoded"}

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
var data = "token=用户中心获取&time=1992-2-12";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
    if (this.readyState === 4) {
        if (this.readyState === 4 && this.status >= 400) {
            layer.msg('Request failed: ' + this.status);
        }
    }
});

xhr.open("POST", "http://api.toolfk.com/api/lunar");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xhr.send(data);
package main

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

func main() {
	url := "http://api.toolfk.com/api/lunar"
	payload := strings.NewReader("token=用户中心获取&time=1992-2-12")

	req, _ := http.NewRequest("POST", url, payload)
	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))
}
返回状态码 status 描述参照
返回码描述
status1:表示成功,0:表示失败
data成功返回数据
errmsg失败返回数据
Note: By subscribing to the API service, you will also enjoy VIP membership benefits on www.toolfk.com.