# Korean Saju Compatibility (Gunghap) Calculator (`motivated_picnic/korean-saju-compatibility-calculator`) Actor

Compute Korean Saju compatibility (gunghap) for two people from their birth dates & times: match score, day-master fit, Stem/Branch harmonies & clashes, Five Elements balance, plus a Korean-language summary with advice. Pure calculation, no external calls. Batch-friendly.

- **URL**: https://apify.com/motivated\_picnic/korean-saju-compatibility-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 compatibility 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 Compatibility (Gunghap) Calculator

A **Korean Saju love compatibility calculator** (궁합 / **gunghap**): give it two people's birth dates and times and get a full compatibility reading back — overall **match score**, day-master fit, stem/branch harmonies & clashes, and Five Elements balance — as clean **JSON**, in **batch**, with **zero external API calls** (pure computation, runs entirely on Apify's cloud). Ideal as a Saju compatibility / synastry-style **API** for dating apps, matchmaking sites, and astrology tools.

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

### What it returns

For each pair you get:

| Section (`include` key) | Content |
|---|---|
| `scores` | Overall match score (0–98) + component scores (ilgan / interaction / balance) |
| `ilganAnalysis` | Day-master (일간) compatibility score + notes (element relation, yin-yang, spouse palace) |
| `stemInteractions` | Heavenly Stem harmonies (합) and clashes (충) between the two charts |
| `branchInteractions` | Earthly Branch six-harmonies and six-clashes |
| `elementBalance` | Combined Five Elements distribution, balance score, mutual complementarity |
| `summary` | Written summary: headline, advice, cautions |

Each person's returned block includes their Four Pillars, day-master, and zodiac animal.

### Input

```json
{
  "pairs": [
    {
      "personA": { "year": 1990, "month": 5, "day": 15, "hour": 14, "gender": "male" },
      "personB": { "year": 1992, "month": 8, "day": 20, "hour": 9, "gender": "female" },
      "label": "us"
    }
  ],
  "include": ["scores", "summary"]
}
```

- `pairs` — array (max 1000). Each person: `year` 1920–2050, `month` 1–12, `day` 1–31, `hour` 0–23 (omit or `-1` if unknown), `gender` `male`/`female`.
- `include` — sections to return; empty = all.

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

### Output

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

### Note on output language

The written `summary`, `ilganAnalysis.notes`, and interaction names are in **Korean** (traditional 명리학 terminology). Numeric scores and structured fields are language-neutral.

### Pricing

Pay-per-result: you are charged once per successfully analyzed pair. 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

## `pairs` (type: `array`):

One or more pairs to analyze. Each item: { personA, personB, label? }. Each person: { year, month, day, hour (0-23; omit or -1 if unknown), gender ('male'|'female') }. Solar (Gregorian) calendar.

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

Which analysis sections to return. Leave empty for all.

## Actor input object example

```json
{
  "pairs": [
    {
      "personA": {
        "year": 1990,
        "month": 5,
        "day": 15,
        "hour": 14,
        "gender": "male"
      },
      "personB": {
        "year": 1992,
        "month": 8,
        "day": 20,
        "hour": 9,
        "gender": "female"
      },
      "label": "example"
    }
  ],
  "include": []
}
```

# 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 = {
    "pairs": [
        {
            "personA": {
                "year": 1990,
                "month": 5,
                "day": 15,
                "hour": 14,
                "gender": "male"
            },
            "personB": {
                "year": 1992,
                "month": 8,
                "day": 20,
                "hour": 9,
                "gender": "female"
            },
            "label": "example"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("motivated_picnic/korean-saju-compatibility-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 = { "pairs": [{
            "personA": {
                "year": 1990,
                "month": 5,
                "day": 15,
                "hour": 14,
                "gender": "male",
            },
            "personB": {
                "year": 1992,
                "month": 8,
                "day": 20,
                "hour": 9,
                "gender": "female",
            },
            "label": "example",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("motivated_picnic/korean-saju-compatibility-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 '{
  "pairs": [
    {
      "personA": {
        "year": 1990,
        "month": 5,
        "day": 15,
        "hour": 14,
        "gender": "male"
      },
      "personB": {
        "year": 1992,
        "month": 8,
        "day": 20,
        "hour": 9,
        "gender": "female"
      },
      "label": "example"
    }
  ]
}' |
apify call motivated_picnic/korean-saju-compatibility-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-compatibility-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/m1GwpdrX4WeRKNill/builds/upYZyaYqjnerXOMDa/openapi.json
