운세 조회
curl --request GET \
--url https://sajuapi.dev/v1/fortunes/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://sajuapi.dev/v1/fortunes/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://sajuapi.dev/v1/fortunes/{id}', 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/fortunes/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://sajuapi.dev/v1/fortunes/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sajuapi.dev/v1/fortunes/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sajuapi.dev/v1/fortunes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body운세
운세 조회
GET
/
v1
/
fortunes
/
{id}
운세 조회
curl --request GET \
--url https://sajuapi.dev/v1/fortunes/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://sajuapi.dev/v1/fortunes/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://sajuapi.dev/v1/fortunes/{id}', 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/fortunes/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://sajuapi.dev/v1/fortunes/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sajuapi.dev/v1/fortunes/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sajuapi.dev/v1/fortunes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyv1 Enterprise API (Coming Soon)이 엔드포인트는 Enterprise 버전에서 제공될 예정입니다.
현재는 v0 API를 사용하세요.
마스킹되지 않은 원본 데이터가 필요한 경우 운세 복호화 조회 엔드포인트를 사용하세요.
Path 파라미터
string
required
조회할 운세의 ID입니다.
ftn_ 접두사로 시작합니다.Response
성공
운세 조회에 성공하면 Fortune 객체가 반환됩니다.실패
| 상태 코드 | 에러 타입 | 설명 |
|---|---|---|
| 401 | authentication_error | API 키가 유효하지 않음 |
| 404 | not_found | 운세를 찾을 수 없음 |
| 429 | rate_limited | 요청 한도 초과 |
요청 예시
curl -X GET https://api.sajuapi.dev/v1/fortunes/ftn_xyz789abc123 \
-H "X-API-Key: bs_live_xxx"
const response = await fetch(
'https://api.sajuapi.dev/v1/fortunes/ftn_xyz789abc123',
{
headers: {
'X-API-Key': 'bs_live_xxx'
}
}
);
const fortune = await response.json();
import requests
response = requests.get(
'https://api.sajuapi.dev/v1/fortunes/ftn_xyz789abc123',
headers={'X-API-Key': 'bs_live_xxx'}
)
fortune = response.json()
응답 예시
{
"id": "ftn_xyz789abc123",
"profile_id": "prf_abc123def456",
"fortune_type": "daily",
"fortune_date": "2025-01-16",
"model": "sonnet",
"score": 85,
"summary": "오늘은 새로운 기회가 찾아오는 날입니다. 오행 중 화(火) 기운이 강해 창의적인 활동에 유리합니다.",
"categories": {
"overall": {
"score": 85,
"description": "전반적으로 긍정적인 하루가 예상됩니다."
},
"wealth": {
"score": 75,
"description": "재물운이 안정적입니다. 큰 지출은 피하세요."
},
"love": {
"score": 90,
"description": "인간관계가 원만합니다. 새로운 만남에 열린 마음을 가지세요."
},
"health": {
"score": 80,
"description": "건강은 양호하나 과로를 주의하세요."
},
"career": {
"score": 88,
"description": "업무에서 좋은 성과가 기대됩니다."
}
},
"lucky_items": {
"number": 7,
"color": "빨강",
"direction": "남쪽",
"time": "오후 2시-4시"
},
"advice": "오늘은 적극적으로 행동하되, 중요한 결정은 신중하게 내리세요.",
"profile": {
"name": "김**",
"day_master": "병화",
"day_master_element": "fire"
},
"cached": false,
"generated_at": "2025-01-16T09:00:00Z",
"latency_ms": 2340
}
Fortune 객체
| 필드 | 타입 | 설명 |
|---|---|---|
id | string | 운세 ID입니다. ftn_ 접두사로 시작합니다. |
profile_id | string | 연결된 프로필 ID입니다. |
fortune_type | string | 운세 유형입니다. |
fortune_date | string | 운세 날짜입니다. |
model | string | 사용된 AI 모델입니다. |
score | integer | 전체 운세 점수입니다. 0-100 사이의 값입니다. |
summary | string | 운세 요약입니다. |
categories | object | 카테고리별 운세입니다. |
lucky_items | object | 행운의 아이템입니다. |
advice | string | 오늘의 조언입니다. |
profile | object | 연결된 프로필 정보입니다. (마스킹됨) |
cached | boolean | 캐시된 결과인지 여부입니다. |
generated_at | string | 생성 시간입니다. |
latency_ms | integer | 응답 시간(밀리초)입니다. |
Categories 객체
| 카테고리 | 설명 |
|---|---|
overall | 전체 운세 |
wealth | 재물운 |
love | 애정운 |
health | 건강운 |
career | 직장/학업운 |
| 필드 | 타입 | 설명 |
|---|---|---|
score | integer | 카테고리 점수 (0-100) |
description | string | 카테고리별 상세 설명 |
⌘I