운세 통계 조회
curl --request GET \
--url https://sajuapi.dev/v1/reports/fortunes \
--header 'X-API-Key: <api-key>'import requests
url = "https://sajuapi.dev/v1/reports/fortunes"
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/reports/fortunes', 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/reports/fortunes",
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/reports/fortunes"
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/reports/fortunes")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sajuapi.dev/v1/reports/fortunes")
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
/
reports
/
fortunes
운세 통계 조회
curl --request GET \
--url https://sajuapi.dev/v1/reports/fortunes \
--header 'X-API-Key: <api-key>'import requests
url = "https://sajuapi.dev/v1/reports/fortunes"
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/reports/fortunes', 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/reports/fortunes",
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/reports/fortunes"
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/reports/fortunes")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sajuapi.dev/v1/reports/fortunes")
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를 사용하세요.
Query 파라미터
string
조회 시작 날짜입니다. ISO 8601 형식(YYYY-MM-DD)입니다. 기본값은 30일 전입니다.
string
조회 종료 날짜입니다. ISO 8601 형식(YYYY-MM-DD)입니다. 기본값은 오늘입니다.
string
특정 운세 유형만 조회합니다.
daily, yearly, monthly 중 하나입니다.Response
성공
운세 통계 조회에 성공하면 FortuneReport 객체가 반환됩니다.실패
| 상태 코드 | 에러 타입 | 설명 |
|---|---|---|
| 401 | authentication_error | API 키가 유효하지 않음 |
| 429 | rate_limited | 요청 한도 초과 |
요청 예시
curl -X GET "https://api.sajuapi.dev/v1/reports/fortunes?start_date=2025-01-01&end_date=2025-01-16" \
-H "X-API-Key: bs_live_xxx"
const response = await fetch(
'https://api.sajuapi.dev/v1/reports/fortunes?start_date=2025-01-01&end_date=2025-01-16',
{
headers: {
'X-API-Key': 'bs_live_xxx'
}
}
);
const report = await response.json();
import requests
response = requests.get(
'https://api.sajuapi.dev/v1/reports/fortunes',
headers={'X-API-Key': 'bs_live_xxx'},
params={
'start_date': '2025-01-01',
'end_date': '2025-01-16'
}
)
report = response.json()
응답 예시
{
"start_date": "2025-01-01",
"end_date": "2025-01-16",
"summary": {
"total_fortunes": 12580,
"unique_profiles": 3420,
"cache_hit_rate": 72.5,
"average_score": 73.2,
"average_latency_ms": 1850,
"total_cost_usd": 8.45
},
"by_type": {
"daily": {
"count": 10250,
"percentage": 81.5,
"average_score": 72.8,
"cache_hit_rate": 78.2
},
"yearly": {
"count": 1850,
"percentage": 14.7,
"average_score": 74.5,
"cache_hit_rate": 45.3
},
"monthly": {
"count": 480,
"percentage": 3.8,
"average_score": 75.1,
"cache_hit_rate": 52.1
}
},
"by_model": {
"haiku": {
"count": 9500,
"percentage": 75.5,
"average_latency_ms": 1200,
"cost_usd": 2.85
},
"sonnet": {
"count": 2580,
"percentage": 20.5,
"average_latency_ms": 2800,
"cost_usd": 4.64
},
"gpt4o": {
"count": 500,
"percentage": 4.0,
"average_latency_ms": 3500,
"cost_usd": 0.96
}
},
"score_distribution": {
"0-20": 245,
"21-40": 890,
"41-60": 3250,
"61-80": 5420,
"81-100": 2775
},
"category_averages": {
"overall": 73.2,
"wealth": 68.5,
"love": 75.8,
"health": 71.2,
"career": 74.9
},
"daily_trend": [
{
"date": "2025-01-01",
"count": 780,
"average_score": 72.5
},
{
"date": "2025-01-02",
"count": 820,
"average_score": 73.1
}
]
}
FortuneReport 객체
| 필드 | 타입 | 설명 |
|---|---|---|
summary | object | 전체 요약 통계입니다. |
by_type | object | 운세 유형별 통계입니다. |
by_model | object | AI 모델별 통계입니다. |
score_distribution | object | 점수 분포입니다. |
category_averages | object | 카테고리별 평균 점수입니다. |
daily_trend | array | 일별 추이입니다. |
캐시 히트율 최적화
캐시 히트율을 높이면 비용을 절감하고 응답 속도를 개선할 수 있습니다.⌘I