Back to Main Site

FengShui API for WordPress - Complete Core Calculation & REST API Integration Guide

Last updated on Aug 23, 2026 10:34 PM 10:34 PM 266.75 ms

100% Algorithmic Precision - Zero AI Hallucinations: All astronomical dates, lunar calendar conversions, solar terms, and zodiac ratings are mathematically computed using exact East Asian Feng Shui algorithms and formulas. Artificial Intelligence is strictly limited to rendering natural language explanations, ensuring absolute data integrity without arbitrary AI hallucination or statistical discrepancies.

FengShui API for WordPress is the high-performance core backend service plugin powering the PolyXGO ecosystem. It encapsulates advanced East Asian astronomical algorithms, bi-directional Yin-Yang lunar conversions based on Julian Day numbers, 24 Solar Terms tracking, taboo date filtering, and age compatibility matrices into a clean, secured REST API v2 architecture.

Core Astronomical & Lunar Calendar Calculation Kernel

Compute precise astronomical and lunar data with zero performance latency across high-traffic applications:

  • Julian Day Conversion: Convert Gregorian dates to Lunar dates and vice versa with mathematical precision using Julian Day numbers (jd).
  • Heavenly Stems & Earthly Branches: Determine Year, Month, Day, and Hour Stems and Branches (Can Chi) alongside real-time 24 Solar Terms (solar_terms).
  • Auspicious & Inauspicious Hours: Calculate Hoang Dao and Hac Dao rating metrics for dates and time intervals.

Automated Taboo Date & Compatibility Filtering

Protect critical events by screening dates against major East Asian astrological restrictions:

  • Nguyet Ky & Tam Nuong Screening: Filter out monthly Nguyet Ky taboo days (5th, 14th, 23rd lunar calendar days) and Tam Nuong taboo days (3rd, 7th, 13th, 18th, 22nd, 27th).
  • Duong Cong Ky Calendar Index: Automatically index Duong Cong Ky taboo dates across all 12 lunar months.
  • Zodiac Harmony Matrix: Cross-examine birth year Can Chi against date Can Chi to evaluate Tu Hanh Xung, Thien Can Hop/Khac, Tam Hop, and Nhi Hop / Luc Hop.

Secured REST API v2 System & Architecture Workflows

The plugin provides standardized HTTP endpoints wrapped with custom rewrite rules, Bearer Token security, domain whitelisting, and dual-stream response rendering. Below are the core architecture workflow diagrams illustrating API request authentication, date calculation pipelines, and deterministic calculation vs AI natural language response streams.

1. API Request & Security Authentication Workflow

graph TD
    A["Client / Satellite Site HTTP Request"] --> B{"Bearer Token & Whitelist Active?"}
    B -->|"Yes"| C["Validate Authorization Bearer Token"]
    B -->|"No"| F["Pass to Core Calculation Engine"]
    C -->|"Invalid / Expired"| D["Return HTTP 401 Unauthorized"]
    C -->|"Valid"| E{"Check Referer / Origin Whitelist"}
    E -->|"Unauthorized Domain"| G["Return HTTP 403 Forbidden Domain"]
    E -->|"Authorized Domain"| F
    F --> H["Julian Day Bi-Directional Solar/Lunar Converter"]
    H --> I["Compute Year, Month, Day, Hour Can Chi & 24 Solar Terms"]
    I --> J["Filter Inauspicious Dates (Nguyet Ky, Tam Nuong, Duong Cong Ky)"]
    J --> K["Evaluate Personal Zodiac Matrix (Tu Hanh Xung, Thien Can Khac)"]
    K --> L{"Select Response Rendering Stream"}
    L -->|"Non-AI Raw Data Stream"| M["Return Dynamically Optimized Preset Template & Raw JSON Payload"]
    L -->|"AI Assistance Stream"| N["Inject Preset Templates & Raw Data into AI System Prompt"]
    N --> O["AI Formats Natural Language Analysis based on Template Context"]
    M --> P["End User Client"]
    O --> P

2. Deterministic Calculation vs AI Response Workflow

graph TD
    A["Input Parameters: Year of Birth, Target Date / Month"] --> B["Core FengShui Mathematical Algorithm Engine"]
    B --> C["Exact Astronomical & Can Chi Computation (100% Deterministic)"]
    C --> D["Apply Tu Hanh Xung, Thien Can Khac & Taboo Filtering Rules"]
    D --> E{"Check Response Output Stream Mode"}
    E -->|"Non-AI Direct Stream"| F["Render Dynamically Optimized Preset Templates & Rating Cards"]
    E -->|"AI Assistance Stream"| G["Inject Preset Template Rules & Calculation Data into AI System Prompt"]
    G --> H["AI Renders Natural Language Interpretation adhering to Template System Prompt"]
    F --> I["End User Client Screen"]
    H --> I

REST API Endpoints Reference

Integrate with external clients using standardized REST API endpoints:

  • GET /api/feng-shui/v2/moving-date/?date=YYYY-MM-DD: Returns full solar/lunar calendar data, Solar Terms, Hoang Dao/Hac Dao ratings, and monthly auspicious days.
  • GET /api/feng-shui/v2/moving-date-lookup?checked_year=YYYY&target_month=MM&target_year=YYYY: Returns house-moving dates tailored to the home owner's birth year, automatically filtering out Tu Hanh Xung and Thien Can Khac dates.
  • GET /api/feng-shui/v2/date?years=YYYY,YYYY...: Evaluates birth year arrays and returns Can Chi, Tu Hanh Xung, Tam Hop, and Nhi Hop relationships.

Note: Additional API integration endpoints will be continuously expanded over time based on project roadmap. If your system requires custom API endpoint integrations or tailored developments, custom implementation support is available under negotiated terms based on specific needs. Users are warmly invited to leave feedback - any feasible and valuable feature suggestions will be prioritized for future release integrations.

Related Products & Technical Documentation

Explore the complete PolyXGO FengShui WordPress ecosystem and engineering resources:

Data Builder — Visual Reporting, REST API & GraphQL for Perfex CRM

Create powerful cross-module reports in Perfex CRM — no SQL, just a visual builder for datasets, filters, and charts.

Transform Perfex CRM into an API-first platform with unified GraphQL and REST APIs for core Perfex CRM tables, custom datasets, reports, and third-party module data.
Secure and scale your data workflows with granular permissions, tokenized access control, and reusable API-driven data assets.