API 문서
SAZU 사주분석 API를 5분 안에 연동하세요.
문서가 어려우신가요? AI에게 맡기세요.
Cursor, Windsurf, Claude Code 등 AI 도구에 아래 한 줄만 입력하면 5분 안에 연동됩니다.
"SAZU API 연동해줘. 엔드포인트: https://api.sazu.app/v1/sazu/calculate, API 문서: https://api.sazu.app/swagger"
코딩을 몰라도, AI가 알아서 코드를 만들어 줍니다.
Quick Start
API 키 발급
회원가입 후 대시보드에서 API 키를 발급받으세요. 테스트용 demo 키를 즉시 사용할 수 있습니다.
첫 번째 요청
curl -X POST https://api.sazu.app/v1/sazu/calculate \
-H "Content-Type: application/json" \
-H "x-api-key: demo" \
-d '{"birthYear":1990,"birthMonth":3,"birthDay":15,"birthHour":14,"isFemale":false}'응답 확인
JSON 응답의 data.modules 에서 각 모듈의 분석 결과를 확인하세요.
인증
모든 API 요청에 x-api-key 헤더를 포함하세요.
x-api-key: sazu_free_xxxx... 또는 sazu_pro_xxxx...엔드포인트
/v1/sazu/calculate사주 분석 (핵심)
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| birthYear | number | 필수 | 출생년도 (1900~2100) |
| birthMonth | number | 필수 | 출생월 (1~12) |
| birthDay | number | 필수 | 출생일 (1~31) |
| birthHour | number | null | 선택 | 출생시 (0~23), 모르면 null |
| birthMinute | number | 선택 | 출생분 (0~59), 기본값 0 |
| isFemale | boolean | 필수 | 여성 여부 |
| isLunar | boolean | 선택 | 음력 여부, 기본값 false |
| birthCity | string | 선택 | 출생 도시, 기본값 "서울" |
| locale | "ko" | "han" | 선택 | 한글 또는 한자, 기본값 "ko" |
| modules | string[] | 선택 | 포함할 모듈 ID 목록. 생략 시 플랜별 기본 모듈 |
| decadeCount | number | 선택 | 대운 개수 (13~20) |
| detail | "minimal" | "standard" | "full" | 선택 | 응답 상세 수준. minimal(값만), standard(핵심해석, 기본), full(전체) |
/v1/sazu/modules사용 가능한 모듈 목록
/v1/calendar/convert음양력 변환
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| year | number | 필수 | 년도 |
| month | number | 필수 | 월 |
| day | number | 필수 | 일 |
| direction | "toSolar" | "toLunar" | 필수 | 변환 방향 |
모듈
modules 파라미터로 원하는 모듈만 선택할 수 있습니다. 생략 시 플랜별 기본 모듈이 포함됩니다.
fourPillarsFREE사주 원국
천간·지지·십성·12운성·12신살·납음·지장간 포함
{
"year": {
"full": "기미", "sky": "기", "earth": "미",
"skyElement": "토", "earthElement": "토",
"sippiSeong": "상관", "twelveStage": "쇠",
"naeeum": "천상화",
"jiJangGan": {
"residue": { "stem": "정", "days": 9 },
"middle": { "stem": "을", "days": 3 },
"main": { "stem": "기", "days": 18 }
}
},
"day": { "full": "병오", "sky": "병", "earth": "오", ... }
}decadeFortuneFREE대운
10년 단위 대운 흐름, 순행/역행, 시작 나이
{
"direction": "역행",
"startAge": 1,
"startDateTime": "1980년 02월 08일 22:45",
"basisTermsName": "입춘",
"list": [
{ "startAge": 1, "full": "을축", "skyElement": "목", "earthElement": "토" },
{ "startAge": 11, "full": "갑자", "skyElement": "목", "earthElement": "수" },
...
]
}elementsFREE오행 분포
목화토금수 분포, 천간/지지 별도 집계
{
"wood": { "name": "목", "total": { "count": 1, "percentage": 12.5 } },
"fire": { "name": "화", "total": { "count": 4, "percentage": 50.0 } },
"earth": { "name": "토", "total": { "count": 2, "percentage": 25.0 } },
"metal": { "name": "금", "total": { "count": 1, "percentage": 12.5 } },
"water": { "name": "수", "total": { "count": 0, "percentage": 0 } }
}summaryFREE분석 요약
오행 균형, 조화/갈등, 대운을 점수·등급으로 요약
{
"dayMaster": { "char": "병", "element": "화" },
"elementBalance": { "dominant": "화", "lacking": "수", "score": 33, "grade": "C" },
"harmony": { "score": 50, "grade": "B", "label": "2개의 합이 감지되었습니다" },
"conflict": { "score": 0, "grade": "S", "label": "원국에 충돌 요소가 없습니다" },
"positiveSpirits": { "count": 11, "notable": ["천을귀인", "천덕귀인", "월덕귀인"] },
"negativeSpirits": { "count": 4, "notable": ["양인살", "현침살", "탕화살"] },
"fortunePhase": {
"current": { "age": 41, "pillar": "신유", "element": "금/금" },
"next": { "age": 51, "pillar": "경신", "element": "금/금" }
}
}sinStrengthFREE신강/신약
득령·득지·득세 3원칙 + 점수(0-100) + 상세 분석
sinsalPRO신살
귀인 21종, 살 17종, 12신살 — 기둥별 상세 + 해석
{
"angels": [
{ "name": "천을귀인", "pillars": ["시지"], "description": "...", "modernMeaning": "..." },
{ "name": "월덕귀인", "pillars": ["월간", "일간"], ... }
],
"devils": [
{ "name": "양인살", "pillars": ["일지"], "description": "..." }
],
"twelve": [
{ "name": "화개", "pillars": ["년지"], "description": "..." }
],
"byPillar": {
"year": { "twelve": "화개", "angels": [...], "devils": [...] },
...
}
}relationshipsPRO합형충파해
원국(허자 미적용) + 허자 포함 이중 분석. 삼합/반합 자동 분류
{
"original": {
"hap": [
{ "name": "오미합", "subType": "육합", "positions": ["년지", "일지"], "chars": ["미", "오"] },
{ "name": "인오 반합", "subType": "생지반합", "positions": ["월지", "일지"], "chars": ["인", "오"] }
],
"hyeong": [], "chung": [], "pa": [], "hae": []
},
"withGhost": {
"hap": [
{ "name": "오미합", "subType": "육합", ... },
{ "name": "인오술 화국", "subType": "삼합", "positions": ["월지", "일지", "허자(술)"], ... }
],
"hyeong": [{ "name": "술미형", "subType": "삼형", "positions": ["년지", "허자(술)"], ... }],
...
}
}ghostElementsPRO허자 분석
삼합공협·도충 허자의 출투, 진허/가허, 순수성, 강도
{
"maxLevel": 2,
"nodes": [
{ "id": "L1_0_7", "level": 1, "isGhost": false, "char": "미", "element": "토" },
{ "id": "L2_triad_10", "level": 2, "isGhost": true, "char": "술", "element": "토" }
],
"effectiveness": [{
"ghostChar": "술", "ghostElement": "토",
"originName": "삼합공협", "sourceChars": ["인", "오"],
"hasTransparence": false, "isGenuine": true, "isPure": true,
"strength": 70,
"hiddenStems": [{ "stem": "무", "element": "토", "role": "본기" }, ...]
}]
}gyeokgukPRO격국 분석
정격 8격 + 외격(종격) + 건록/양인격, 신강/신약 점수
{
"name": "편인격",
"category": "regular",
"transparency": { "stem": null, "position": null, "sipsin": "편인" },
"strength": { "level": "신강", "score": 77, "deukryeong": true, "deukji": true, "deukse": false },
"reasoning": "월지(인) 지장간 미투출, 본기(갑) 기준 → 편인격"
}yongsinPRO용신 분석
억부용신 + 조후용신(궁통보감) + 5신(용희기구한) 파생
{
"yongsin": { "oheng": "earth", "ko": "토" },
"huisin": { "oheng": "fire", "ko": "화" },
"gisin": { "oheng": "wood", "ko": "목" },
"gusin": { "oheng": "water", "ko": "수" },
"hansin": { "oheng": "metal", "ko": "금" },
"eokbu": { "oheng": "earth", "ko": "토", "method": "설기" },
"johu": { "oheng": "wood", "ko": "목" },
"method": "eokbu",
"reasoning": "신강(77점) → 일간(화)이 생하는 토(식상)으로 설기..."
}weolunPRO월운
현재/전후 월운 + 십성 관계 + 해석
seunPRO세운
과거/현재/미래 년운 + 합형충파해 관계 + 12운성
wongukInteractionPRO원국 상호작용
4기둥 간 합형충파해 + 인접/격각 구분
evaluationPRO종합 사주 평가
스코어카드·성격·인생흐름·년운·용신가이드 — 전체 모듈 교차 종합
{
"scorecard": {
"elementBalance": { "score": 33, "grade": "C" },
"harmony": { "score": 50, "grade": "B" },
"conflict": { "score": 100, "grade": "S" },
"spiritRatio": { "score": 73, "grade": "A" },
"currentEnergy": { "score": 100, "grade": "S" }
},
"personality": {
"keywords": ["독립적", "추진력", "편인격"],
"strengths": [{ "trait": "강한 자기 주도력", "basis": "신강" }],
"cautions": [{ "trait": "고집이 대인관계 마찰 유발", "basis": "신강 과다" }]
},
"lifePhase": {
"current": { "period": "신유", "age": 41, "theme": "사", "summary": "정재 — 사색과 지혜" },
"peak": { "period": "무오", "age": 71, "theme": "제왕" },
"lowest": { "period": "계해", "age": 21, "theme": "절" }
},
"yearForecast": {
"year": 2026, "energyLevel": 12, "energyName": "제왕",
"yongsinAlignment": "medium",
"headline": "2026년(병오) — 최고 에너지 구간",
"advice": "희신의 보조가 있는 안정적인 해"
},
"yongsinGuide": {
"yongsin": { "oheng": "토", "usage": "부동산, 중재, 신뢰 구축" },
"huisin": { "oheng": "화", "usage": "자기표현, 리더십" },
"gisin": { "oheng": "목", "caution": "학업/사색 과몰입 주의" },
"gusin": { "oheng": "수", "caution": "음주, 우울 주의" }
}
}시나리오별 사용 가이드
서비스 유형에 맞게 modules와 detail을 조합하여 응답 크기를 최적화하세요.
| 시나리오 | modules | detail | 크기 | 호출 |
|---|---|---|---|---|
| 운세 앱 (카드 UI) | ["fourPillars", "evaluation"] | standard | ~5KB | 1회 |
| 상담 플랫폼 (전체) | (생략 = 전체) | standard | ~35KB | 1회 |
| 프로그레시브 로딩 | ["fourPillars", "evaluation"] | minimal → standard | 4KB → 35KB | 2회 |
| 궁합 서비스 | ["evaluation", "elements"] | minimal | ~3KB x2 | 2회 |
| AI/LLM 연동 | ["evaluation", "fourPillars", "yongsin"] | full | ~15KB | 1회 |
핵심: 한 사용자 = 최소 1회 호출
modules와 detail은 응답 크기 최적화용이며, 추가 호출을 유발하지 않습니다. evaluation 모듈만 요청해도 내부적으로 모든 의존 모듈을 계산하여 종합 결과를 생성합니다.
detail — 응답 크기 제어
목적에 맞게 응답 상세 수준을 조절하여 네트워크 비용과 파싱 시간을 절약하세요.
| 레벨 | 포함 | 제거 | 크기 |
|---|---|---|---|
| minimal | 값, 점수, 등급 | 모든 해석 텍스트, 12운성 해석, 십성 해석 | ~19KB |
| standard | 핵심 해석, description | 중복 해석, 세운 합충 3개 제한 | ~35KB |
| full | 전체 (interpretation, modernMeaning 등) | 없음 | ~46KB |
Rate Limit
응답 헤더에서 남은 요청 수를 확인할 수 있습니다.
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: 1712678400| 플랜 | 분당 | 월간 |
|---|---|---|
| Free | 10 | 500 |
| Pro | 300 | 10,000 (초과 시 10원/건) |
| Custom | 협의 | 무제한 |
에러 코드
| HTTP | 코드 | 설명 |
|---|---|---|
| 400 | VALIDATION_ERROR | 입력값 검증 실패 |
| 401 | UNAUTHORIZED | 유효하지 않은 API 키 |
| 429 | RATE_LIMIT_EXCEEDED | 요청 한도 초과 |
| 500 | INTERNAL_ERROR | 서버 내부 오류 |