This repo teaches AI coding agents (Cursor, Claude Code, Aider, Codex, Windsurf, RooCode, Gemini CLI) how to use the RoxyAPI Chinese almanac endpoints: the Tong Shu day view and auspicious date selection.
- Almanac day:
GET https://roxyapi.com/api/v2/chinese-astrology/calendar/day/{date}- Operation ID:
getAlmanacDaymatches the SDK method name in camelCase - MCP tool:
get_chinese_astrology_calendar_day_date
- Operation ID:
- Date selection:
POST https://roxyapi.com/api/v2/chinese-astrology/calendar/auspicious-days- Operation ID:
lookupAuspiciousDaysmatches the SDK method name in camelCase - MCP tool:
post_chinese_astrology_calendar_auspicious_days
- Operation ID:
- Auth:
X-API-Keyheader - Domain:
chinese-astrology(one of 14+ in the RoxyAPI catalog) - MCP server:
https://roxyapi.com/mcp/chinese-astrology, Streamable HTTP
import { createRoxy } from '@roxyapi/sdk';
const roxy = createRoxy(process.env.ROXY_API_KEY!);
const day = await roxy.chineseAstrology.getAlmanacDay({ path: { date: '2026-10-11' } });
const search = await roxy.chineseAstrology.lookupAuspiciousDays({
body: {
activity: 'wedding',
startDate: '2026-10-01',
endDate: '2026-11-15',
avoidAnimal: 'rat',
},
});import os
from roxy_sdk import create_roxy
roxy = create_roxy(os.environ["ROXY_API_KEY"])
day = roxy.chinese_astrology.get_almanac_day(date="2026-10-11")
search = roxy.chinese_astrology.lookup_auspicious_days(
activity="wedding",
start_date="2026-10-01",
end_date="2026-11-15",
avoid_animal="rat",
)Neither endpoint takes a latitude or a longitude, and no endpoint in this domain requires one. The Chinese lunisolar calendar is defined at a fixed UTC+8 reference meridian, so a lunar date, a pillar, a day officer and a mansion are the same worldwide for a given Gregorian date. Do not call /location/search for these endpoints. Pass the date, or the activity plus the range, directly.
Almanac day:
date(path, required): Gregorian date YYYY-MM-DD, evaluated at the reference meridian. Years 1900 to 2100lang(query, optional):en,tr,de,es,hi,pt,fr,ru,zh-Hans,zh-Hant. Defaults toen
Date selection:
activity(body, required): one ofwedding,travel,moving-house,opening-business,signing-contracts,construction,groundbreaking,burial,medical-treatment,praying. Matching folds case and punctuation, somoving-houseandMOVING_HOUSEboth resolvestartDate(body, required): first date of the range, inclusive, YYYY-MM-DDendDate(body, required): last date of the range, inclusive. The range may not exceed 93 daysavoidAnimal(body, optional):rat,ox,tiger,rabbit,dragon,snake,horse,goat,monkey,rooster,dog,pig. Days that clash with this animal are dropped from the resultslang(query, optional): same ten codes as above
Almanac day:
date: the Gregorian date at the reference meridianlunar:year,month,day,isLeapMonth,monthLength,dateyearPillar,monthPillar,dayPillar: eachid(stem-branch pinyin),number(1 to 60),stem,branch,chinese,naYin,naYinElementdayOfficer:id,name,chinese,pinyin,quality,meaning, plusnameLocalizedwhenlangis notenmansion:number(1 to 28),name,chinese,pinyin,palace,planet,animalclashAnimal: English animal id, plusclashAnimalLocalizedwhenlangis notenfavours,avoids: activity identifier arrays, English kebab case
Date selection:
activity,activityLabel,startDate,endDate,daysSearched,totalavoidAnimal: echoed only when one was sent, absent rather than nulldays[]: the favoured days in date order, each the same object the day view returns
- Coordinates are never needed in this domain. Never call
/location/searchfor these endpoints. - The search range is capped at 93 days, which is a quarter. A longer range returns 400 with the day count in the message, rather than being silently trimmed. Page a longer plan into consecutive quarters.
totalis the count after the clash filter, not the number of days searched. ReaddaysSearchedfor the range size.id,stem,branch,palace,quality,clashAnimal, and every entry offavoursandavoidsare stable English machine values in every language. Branch on those. The*Localizedsiblings andname,meaning,activityLabelare the display strings, and theLocalizedones are absent whenlangisen.mansion.numberis the mansion identifier, not the pinyin: three mansions share the pinyin wei and two share bi, so a pinyin key is not unique.- The year and month pillars here are attributed by whole days, which is what an almanac prints. The day a solar term falls on belongs to the new period for its whole length, however late in the day the term arrives. A chart built from a birth TIME uses the term instant instead, so it can differ inside that one day.
- A leap month repeats the number of the month it follows and is flagged by
lunar.isLeapMonth. Never assume twelve months in a year. avoidAnimalis how a date is chosen around the people attending. Filtering for the Rat drops 2026-10-11 out of a wedding search, because that day clashes with the Rat.
GET /chinese-astrology/calendar/monthly(getMonthlyAlmanac): every day of a month with pillars, officer, mansion and clash animal, plus the solar terms inside the month. One call instead of thirtyGET /chinese-astrology/calendar/solar-terms/{year}(listSolarTerms): the 24 solar terms of a solar year as exact instants, Li Chun to Li Chun. Settles where a month pillar boundary fallsPOST /chinese-astrology/calendar/lunar-date(calculateLunarDate): convert a Gregorian date to the lunisolar calendar or convert a lunar date back, leap months included
2026-Q3 against https://roxyapi.com/api/v2/openapi.json. Re-fetch the spec for ground truth before changing this file.
- Full catalog: https://roxyapi.com/AGENTS.md
- LLM index: https://roxyapi.com/llms.txt
- Methodology: https://roxyapi.com/methodology