# Korean Saju / BaZi Four Pillars Calculator (`motivated_picnic/korean-saju-bazi-calculator`) Actor

Compute Korean Saju / Chinese BaZi four pillars, Five Elements distribution, Ten Gods, 12 life stages, 10-year luck cycles (Daeun), yongsin lucky element, and daily/annual fortune from a birth date & time. Pure calculation engine, no external calls. Batch-friendly: pass an array of birth records.

- **URL**: https://apify.com/motivated\_picnic/korean-saju-bazi-calculator.md
- **Developed by:** [쿤스튜](https://apify.com/motivated_picnic) (community)
- **Categories:** AI, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 saju result computeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Korean Saju / BaZi Four Pillars Calculator

A **Korean Saju** (사주) and **Chinese BaZi** (八字) **four pillars calculator**: give it a birth date and time and get a full structured reading back — four pillars, Five Elements, Ten Gods, luck cycles, and daily/annual fortune — as clean **JSON**, in **batch**, with **zero external API calls** (pure computation, runs entirely on Apify's cloud). Ideal as a Saju / BaZi / four-pillars-of-destiny **API** for astrology apps, fortune-telling sites, and data pipelines.

Built and maintained by **KunStudio** (also publishers of the Saju API on API.market, Zyla, and RapidAPI, and [sajuapp.app](https://sajuapp.app)).

### What it returns

For each birth record you get:

| Section (`include` key) | Content |
|---|---|
| `pillars` | Year / Month / Day / Hour pillars (천간·지지, Hanja) |
| `elements` | Five Elements (Wood/Fire/Earth/Metal/Water) distribution |
| `tenGods` | Ten Gods (십신) per pillar |
| `lifeStages` | 12 life stages (12운성) |
| `hiddenStems` | Hidden stems (지장간) |
| `daeun` | 10-year luck cycle (대운) with correct gender-based direction |
| `clashHarmony` | Stem/branch combinations & clashes (합·충) |
| `yongsin` | Useful element (용신), favorable/unfavorable elements |
| `dailyFortune` / `annualFortune` | Current month / year fortune |

### Input

```json
{
  "births": [
    { "year": 1990, "month": 5, "day": 15, "hour": 14, "gender": "male", "label": "me" }
  ],
  "include": ["pillars", "elements", "yongsin"],
  "language": "en"
}
```

- `births` — array (max 1000). `year` 1920–2050, `month` 1–12, `day` 1–31, `hour` 0–23 (omit or `-1` if unknown → defaults to noon), `gender` `male`/`female`.
- `include` — sections to return; empty = all.
- `language` — label language for the Five Elements block (`en`/`ko`/`ja`/`zh`). Raw Korean/Hanja keys are always present.

Solar (Gregorian) calendar input; the engine converts to lunar internally.

### Output

One dataset item per birth record. Invalid records return `{ ok: false, error }` instead of failing the whole run, so a batch of 1000 never dies on one bad row.

### Pricing

Pay-per-result: you are charged once per successfully analyzed birth record. No subscription, no free-trial trap — pay only for what you compute.

### Support

Questions, bug reports, or feature requests: **https://sajuapp.app/support**

We usually respond within 1 business day.

# Actor input Schema

## `births` (type: `array`):

One or more birth records to analyze. Each item: { year, month, day, hour (0-23), gender ('male'|'female'), label (optional) }. Solar (Gregorian) calendar. Hour 0-23; omit or use -1 if birth time unknown.

## `include` (type: `array`):

Which analysis sections to return. Leave empty for all.

## `language` (type: `string`):

Language for human-readable labels in the output. Raw Korean/Hanja keys are always included.

## Actor input object example

```json
{
  "births": [
    {
      "year": 1990,
      "month": 5,
      "day": 15,
      "hour": 14,
      "gender": "male",
      "label": "example"
    }
  ],
  "include": [],
  "language": "en"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "births": [
        {
            "year": 1990,
            "month": 5,
            "day": 15,
            "hour": 14,
            "gender": "male",
            "label": "example"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("motivated_picnic/korean-saju-bazi-calculator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "births": [{
            "year": 1990,
            "month": 5,
            "day": 15,
            "hour": 14,
            "gender": "male",
            "label": "example",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("motivated_picnic/korean-saju-bazi-calculator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "births": [
    {
      "year": 1990,
      "month": 5,
      "day": 15,
      "hour": 14,
      "gender": "male",
      "label": "example"
    }
  ]
}' |
apify call motivated_picnic/korean-saju-bazi-calculator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,motivated_picnic/korean-saju-bazi-calculator"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/r1P850HBTtl34VuOr/builds/qiNhuErPxfTV6bGdu/openapi.json
