연간 운세 계산
curl --request POST \
--url https://sajuapi.dev/v1/calculations/yearly \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"birth_year": 123,
"birth_month": 123,
"birth_day": 123,
"birth_hour": 123,
"gender": "<string>",
"target_year": 123,
"model": "<string>"
}
'import requests
url = "https://sajuapi.dev/v1/calculations/yearly"
payload = {
"birth_year": 123,
"birth_month": 123,
"birth_day": 123,
"birth_hour": 123,
"gender": "<string>",
"target_year": 123,
"model": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
birth_year: 123,
birth_month: 123,
birth_day: 123,
birth_hour: 123,
gender: '<string>',
target_year: 123,
model: '<string>'
})
};
fetch('https://sajuapi.dev/v1/calculations/yearly', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sajuapi.dev/v1/calculations/yearly",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'birth_year' => 123,
'birth_month' => 123,
'birth_day' => 123,
'birth_hour' => 123,
'gender' => '<string>',
'target_year' => 123,
'model' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sajuapi.dev/v1/calculations/yearly"
payload := strings.NewReader("{\n \"birth_year\": 123,\n \"birth_month\": 123,\n \"birth_day\": 123,\n \"birth_hour\": 123,\n \"gender\": \"<string>\",\n \"target_year\": 123,\n \"model\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sajuapi.dev/v1/calculations/yearly")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"birth_year\": 123,\n \"birth_month\": 123,\n \"birth_day\": 123,\n \"birth_hour\": 123,\n \"gender\": \"<string>\",\n \"target_year\": 123,\n \"model\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sajuapi.dev/v1/calculations/yearly")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"birth_year\": 123,\n \"birth_month\": 123,\n \"birth_day\": 123,\n \"birth_hour\": 123,\n \"gender\": \"<string>\",\n \"target_year\": 123,\n \"model\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body계산
연간 운세 계산
POST
/
v1
/
calculations
/
yearly
연간 운세 계산
curl --request POST \
--url https://sajuapi.dev/v1/calculations/yearly \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"birth_year": 123,
"birth_month": 123,
"birth_day": 123,
"birth_hour": 123,
"gender": "<string>",
"target_year": 123,
"model": "<string>"
}
'import requests
url = "https://sajuapi.dev/v1/calculations/yearly"
payload = {
"birth_year": 123,
"birth_month": 123,
"birth_day": 123,
"birth_hour": 123,
"gender": "<string>",
"target_year": 123,
"model": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
birth_year: 123,
birth_month: 123,
birth_day: 123,
birth_hour: 123,
gender: '<string>',
target_year: 123,
model: '<string>'
})
};
fetch('https://sajuapi.dev/v1/calculations/yearly', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sajuapi.dev/v1/calculations/yearly",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'birth_year' => 123,
'birth_month' => 123,
'birth_day' => 123,
'birth_hour' => 123,
'gender' => '<string>',
'target_year' => 123,
'model' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sajuapi.dev/v1/calculations/yearly"
payload := strings.NewReader("{\n \"birth_year\": 123,\n \"birth_month\": 123,\n \"birth_day\": 123,\n \"birth_hour\": 123,\n \"gender\": \"<string>\",\n \"target_year\": 123,\n \"model\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sajuapi.dev/v1/calculations/yearly")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"birth_year\": 123,\n \"birth_month\": 123,\n \"birth_day\": 123,\n \"birth_hour\": 123,\n \"gender\": \"<string>\",\n \"target_year\": 123,\n \"model\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sajuapi.dev/v1/calculations/yearly")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"birth_year\": 123,\n \"birth_month\": 123,\n \"birth_day\": 123,\n \"birth_hour\": 123,\n \"gender\": \"<string>\",\n \"target_year\": 123,\n \"model\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyv1 Enterprise API (Coming Soon)이 엔드포인트는 Enterprise 버전에서 제공될 예정입니다.
현재는 v0 API를 사용하세요.
이 API는 프로필 없이 일회성 계산을 수행합니다. 저장된 프로필을 사용하려면 운세 생성 API에서
fortune_type: "yearly"를 사용하세요.Request Body 파라미터
integer
required
출생 연도입니다. 1900에서 2100 사이의 값이어야 합니다.
integer
required
출생 월입니다. 1에서 12 사이의 값이어야 합니다.
integer
required
출생 일입니다. 1에서 31 사이의 값이어야 합니다.
integer
출생 시입니다. 0에서 23 사이의 값이어야 합니다.
string
required
성별입니다.
male 또는 female 중 하나입니다.integer
required
운세를 계산할 대상 연도입니다. 1900에서 2100 사이의 값이어야 합니다.
string
default:"haiku"
AI 분석에 사용할 모델입니다.
haiku, sonnet, gpt4o 중 하나입니다.Response
성공
연간 운세 계산에 성공하면 YearlyFortune 객체가 반환됩니다.실패
| 상태 코드 | 에러 타입 | 설명 |
|---|---|---|
| 400 | validation_error | 요청 데이터가 유효하지 않음 |
| 401 | authentication_error | API 키가 유효하지 않음 |
| 429 | rate_limited | 요청 한도 초과 |
| 503 | service_unavailable | AI 모델 서비스 일시 불가 |
요청 예시
curl -X POST https://api.sajuapi.dev/v1/calculations/yearly \
-H "X-API-Key: bs_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"birth_year": 1990,
"birth_month": 3,
"birth_day": 15,
"birth_hour": 14,
"gender": "male",
"target_year": 2025,
"model": "sonnet"
}'
const response = await fetch('https://api.sajuapi.dev/v1/calculations/yearly', {
method: 'POST',
headers: {
'X-API-Key': 'bs_live_xxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
birth_year: 1990,
birth_month: 3,
birth_day: 15,
birth_hour: 14,
gender: 'male',
target_year: 2025,
model: 'sonnet'
})
});
const yearlyFortune = await response.json();
import requests
response = requests.post(
'https://api.sajuapi.dev/v1/calculations/yearly',
headers={'X-API-Key': 'bs_live_xxx'},
json={
'birth_year': 1990,
'birth_month': 3,
'birth_day': 15,
'birth_hour': 14,
'gender': 'male',
'target_year': 2025,
'model': 'sonnet'
}
)
yearly_fortune = response.json()
응답 예시
{
"target_year": 2025,
"year_pillar": {
"stem": "을",
"stem_hanja": "乙",
"branch": "사",
"branch_hanja": "巳",
"element": "wood",
"animal": "뱀"
},
"day_master": {
"name": "병화",
"element": "fire"
},
"year_energy_interaction": {
"relationship": "상생",
"description": "을목(乙木)이 병화(丙火)를 생하여 좋은 에너지 흐름이 있습니다.",
"impact": "positive"
},
"overall": {
"score": 78,
"summary": "2025년은 전반적으로 성장과 발전의 해가 될 것입니다. 을사년(乙巳年)의 목화(木火) 기운이 병화 일주와 조화를 이루어 창의력과 활력이 넘칩니다.",
"keywords": ["성장", "창의력", "새로운 시작", "인간관계 확장"],
"advice": "상반기에 새로운 프로젝트를 시작하기 좋습니다. 하반기에는 안정을 추구하세요."
},
"categories": {
"wealth": {
"score": 72,
"summary": "재물운은 안정적입니다. 투자보다는 저축을 권합니다.",
"best_months": [3, 6, 9],
"caution_months": [2, 8]
},
"career": {
"score": 85,
"summary": "직장운이 좋습니다. 승진이나 이직의 기회가 있을 수 있습니다.",
"best_months": [4, 5, 10],
"caution_months": [7]
},
"love": {
"score": 75,
"summary": "인간관계가 원만합니다. 새로운 만남의 기회가 있습니다.",
"best_months": [2, 5, 11],
"caution_months": [8]
},
"health": {
"score": 70,
"summary": "건강에 주의가 필요합니다. 특히 심장과 혈액순환에 신경 쓰세요.",
"best_months": [4, 9],
"caution_months": [6, 12]
}
},
"monthly": [
{
"month": 1,
"stem": "정",
"branch": "축",
"score": 72,
"summary": "한 해를 시작하는 달로, 계획을 세우기 좋습니다.",
"focus": "계획 수립",
"caution": "과도한 지출 주의"
},
{
"month": 2,
"stem": "무",
"branch": "인",
"score": 80,
"summary": "활력이 넘치는 달입니다. 적극적으로 행동하세요.",
"focus": "새로운 시작",
"caution": "무리한 일정 주의"
},
{
"month": 3,
"stem": "기",
"branch": "묘",
"score": 85,
"summary": "상반기 최고의 운세입니다. 중요한 일을 추진하세요.",
"focus": "도전과 기회",
"caution": "자만심 경계"
}
],
"lucky_elements": {
"colors": ["빨강", "주황", "보라"],
"numbers": [3, 7, 9],
"directions": ["남쪽", "동쪽"],
"items": ["태양 모티프 액세서리", "붉은색 소품"]
},
"generated_at": "2025-01-16T09:00:00Z",
"model": "sonnet",
"latency_ms": 3450
}
YearlyFortune 객체
| 필드 | 타입 | 설명 |
|---|---|---|
target_year | integer | 대상 연도입니다. |
year_pillar | object | 해당 연도의 연주(年柱)입니다. |
day_master | object | 일주(日柱) 정보입니다. |
year_energy_interaction | object | 연도 기운과 일주의 상호작용입니다. |
overall | object | 전체 운세 요약입니다. |
categories | object | 카테고리별 운세입니다. |
monthly | array | 월별 상세 운세입니다. |
lucky_elements | object | 행운의 요소입니다. |
연도 기운 상호작용
| 관계 | 설명 | 영향 |
|---|---|---|
상생 | 연도 기운이 일주를 돕습니다 | 긍정적 |
상극 | 연도 기운이 일주와 충돌합니다 | 주의 필요 |
비화 | 연도 기운이 일주와 동일합니다 | 중립적/경쟁 |
식상 | 일주가 연도 기운을 생합니다 | 에너지 소모 |
재성 | 일주가 연도 기운을 극합니다 | 기회/노력 필요 |
⌘I