> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sajuapi.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 운세 조회

<Info>
  **v1 Enterprise API (Coming Soon)**

  이 엔드포인트는 Enterprise 버전에서 제공될 예정입니다.
  현재는 [v0 API](/api-reference/v0/overview)를 사용하세요.
</Info>

특정 운세의 상세 정보를 조회합니다. 민감한 프로필 정보는 마스킹되어 반환됩니다.

<Note>
  마스킹되지 않은 원본 데이터가 필요한 경우 [운세 복호화 조회](/api-reference/fortunes/unmasked) 엔드포인트를 사용하세요.
</Note>

***

## Path 파라미터

<ParamField path="id" type="string" required>
  조회할 운세의 ID입니다. `ftn_` 접두사로 시작합니다.
</ParamField>

***

## Response

### 성공

운세 조회에 성공하면 Fortune 객체가 반환됩니다.

### 실패

| 상태 코드 | 에러 타입                  | 설명             |
| ----- | ---------------------- | -------------- |
| 401   | `authentication_error` | API 키가 유효하지 않음 |
| 404   | `not_found`            | 운세를 찾을 수 없음    |
| 429   | `rate_limited`         | 요청 한도 초과       |

***

## 요청 예시

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://api.sajuapi.dev/v1/fortunes/ftn_xyz789abc123 \
    -H "X-API-Key: bs_live_xxx"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.sajuapi.dev/v1/fortunes/ftn_xyz789abc123',
    {
      headers: {
        'X-API-Key': 'bs_live_xxx'
      }
    }
  );

  const fortune = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.sajuapi.dev/v1/fortunes/ftn_xyz789abc123',
      headers={'X-API-Key': 'bs_live_xxx'}
  )

  fortune = response.json()
  ```
</CodeGroup>

***

## 응답 예시

```json theme={null}
{
  "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  | 카테고리별 상세 설명     |
