Use cases

Six ways to build the API into a product. Every demo below is calculated live by the API; the scenarios are illustrative integrations, not client case studies.

Real-estate portal: a feng shui profile for every listing

Buyers from East Asia often ask about a home's feng shui before visiting. Store the facing bearing and construction year with each listing and show the Flying Star chart and the Eight Mansions sectors on the detail page — a differentiator competitors rarely offer.

Endpoints: /feng-shui/flying-star, /feng-shui/eight-mansions. Results depend only on the building, so calculate once when the listing is published and store them.

// when a listing is saved (server side)
const [stars, mansions] = await Promise.all([
  api('/feng-shui/flying-star', { facing: listing.facingDegrees, constructionYear: listing.builtYear }),
  api('/feng-shui/eight-mansions', { facing: listing.facingDegrees }),
]);
await db.listings.update(listing.id, { fengShui: { stars, mansions } });

Demo listing: faces 172° (south), built 2019

Shuang Xing Dao Zuo · Period 8 · Kan house (East group)
NW 394
N 848
NE 126
W 215
CENTRE 483
E 661
SW 759
S 937
SE 572

Best sectors: N (Fu Wei), E (Tian Yi), SE (Sheng Qi), S (Yan Nian).

Furniture & interior shop: lucky-dimension badges

Many customers who follow feng shui check dimensions on the Lu Ban ruler before buying. Show a small badge next to each measurement — and suggest the nearest auspicious size for made-to-measure products.

Endpoint: /feng-shui/lucky-dimension. Compute the badges for your catalogue in a nightly job and cache them.

for (const product of catalogue) {
  for (const [name, cm] of Object.entries(product.dimensions)) {
    const { auspicious, section } = await api('/feng-shui/lucky-dimension', { length: cm, unit: 'cm' });
    product.badges[name] = auspicious ? `Lucky: ${section.meaning}` : null;
  }
}

Demo product sheet

  • ✗Desk width: 140 cm
    Bing — Illness · try 145.8–151.1 cm
  • ✗Desk height: 75 cm
    Jie — Robbery and loss · try 81–86.3 cm
  • ✗Interior door width: 80 cm
    Hai — Harm · try 81–86.3 cm
  • ✗Wardrobe height: 210 cm
    Hai — Harm · try 210.6–215.9 cm
  • ✗Bed length: 200 cm
    Jie — Robbery and loss · try 210.6–215.9 cm

Dating & social apps: a zodiac match score

Add a playful "zodiac match" to profiles. Users already enter their birth date; convert it to an animal once and compare animals at match time — the score is a lookup, so it can be cached for all 144 combinations.

Endpoints: /zodiac/year once per user, then /compatibility/love?animal1=…&animal2=….

const { animal } = await api('/zodiac/year', { date: user.birthDate });
const match = await api('/compatibility/love', { animal1: animal, animal2: other.animal });
// → { score: 3, maxScore: 4, rating: "good" }

Demo: born 15 Jun 1990 and 10 Mar 1992

3/4
Horse & Monkey
good match

Wedding & event planners: dates without clashes

Traditional date selection avoids days whose animal clashes with the year animal of the people involved. Mark such days in your calendar picker — a feature couples actively look for.

Endpoints: /zodiac/enemy for each person, then /zodiac/day for the candidate dates (the day cycle never changes, so you can pre-compute a whole year).

const clashes = await Promise.all(people.map(
  (p) => api('/zodiac/enemy', { date: p.birthDate }).then((r) => r.enemy)));
const days = await Promise.all(candidates.map((date) => api('/zodiac/day', { date })));
const suitable = days.filter((d) => !clashes.includes(d.animal));

Demo: a Horse and a Monkey partner avoid Rat and Tiger days

DateDay
Fri 25 SepTiger Ren Yinclash
Sat 26 SepRabbit Gui Maook
Sun 27 SepDragon Jia Chenok
Mon 28 SepSnake Yi Siok
Tue 29 SepHorse Bing Wuok
Wed 30 SepGoat Ding Weiok
Thu 1 OctMonkey Wu Shenok
Fri 2 OctRooster Ji Youok
Sat 3 OctDog Geng Xuok
Sun 4 OctPig Xin Haiok
Mon 5 OctRat Ren Ziclash
Tue 6 OctOx Gui Chouok
Wed 7 OctTiger Jia Yinclash
Thu 8 OctRabbit Yi Maook

Horoscope & content sites: a daily almanac widget

Show today's Chinese date — year, month and day pillars — on your homepage or in a newsletter. Three calls a day, cached until midnight, keep the widget fresh without touching your quota.

Endpoints: /zodiac/year, /zodiac/month (with calendar=solar for the Ba Zi pillars) and /zodiac/day.

Today, 25 September 2026

Year
丙午 Fire Horse
Month
丁酉 Rooster
Day
壬寅 Water Tiger
Solar term
White Dew

Wellbeing & home apps: personal directions

Ask for birth date and gender during onboarding and tell users which way to face at their desk and where to point the bed. Combine it with a compass on mobile for a "find your direction" feature.

Endpoint: /feng-shui/kua — one call per user, store the result in the profile.

Demo: a woman born 15 Mar 1985 — Kua 9, East group

  • ESheng Qi
    Face this way at your desk
  • SETian Yi
    Point the head of the bed here
  • NWJue Ming
    Avoid facing this way

Run your own instance

The API is open source (MIT). To host it yourself — for data residency, higher volumes or an intranet — build the Docker image and run it next to MariaDB; the calendar data is loaded by the database migrations:

git clone https://github.com/fengshui-api/restApi.git fengshui-api && cd fengshui-api
APP_SECRET=$(openssl rand -hex 32) APP_URL=https://feng-shui.example.com \
DB_PASSWORD=… DB_ROOT_PASSWORD=… MAILER_DSN=smtp://… \
  docker compose -f compose.prod.yaml up -d --build

Details in the repository README. Using the hosted API instead? Get a free key and see the code examples.