🔗 Ablecity 만세력·사주·소개팅 API Reference

AI·매칭·렌탈 플랫폼을 위한 REST API 가이드입니다. -업데이트 일자 2025.12.01 v2.0

만세력 API / 사주 API / 운세 API는 생년월일·출생 시각(yyyy-MM-dd HH:mm:ss)과 (선택) 태어난 도시(city 파라미터, LMT 보정용)를 입력받아 음양오행 알고리즘으로 사주팔자(년·월·일·시 기둥), 오행 분포, 격국·용신, 대운과 행운 요소까지 JSON 형태로 제공합니다. 챗봇, 키오스크, 모바일 앱에서 하루 평균 5만 건 이상 호출되며, 무료 체험 키도 지원됩니다.

소개팅 API는 실시간 위치와 선호도 기반 추천 알고리즘을 제공하여, 이커머스·커뮤니티·이벤트 플랫폼에서도 쉽게 매칭 기능을 확장할 수 있습니다. 최대 10,000 QPS까지 스케일링되는 REST 구조로, 모든 언어에서 간단히 연동할 수 있도록 설계되었습니다.

1. Authentication

모든 API 요청에는 HTTP Header에 Bearer Token을 포함해야 합니다.

Authorization: Bearer <API_KEY>

발급된 API 키는 고객센터를 통해 신청하실 수 있습니다.

2. 공통 응답 형식

{
  "status": "success",   // or "error"
  "data": ... ,          // 결과 데이터
  "message": "..."       // 설명 메시지
}

3. Endpoints

3.1 GET /api/v1/saju/fortune

사용자의 생년월일·출생 시각(birth), 성별(gender), (선택) 태어난 도시(city)를 기반으로 만세력(사주팔자)과 오행·격국·용신·대운 및 행운 요소를 계산합니다.

요청 예시

curl -X GET \
  "https://api.ablecity.kr/api/v1/saju/fortune?birth=1990-01-01T01:00:00&gender=male&city=강릉시" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Accept: application/json"

Query Parameters

Name Type Required Description
birth string (datetime) 필수 태어난 시간. yyyy-MM-ddTHH:mm:ss 형식만 지원합니다. (날짜와 시간 사이 대문자 T로 구분)
gender string 필수 성별. 남자: male, 여자: female (그 외 값은 오류).
city string 선택 태어난 도시 이름 (LMT 보정용). 미입력 시 서울특별시 기준으로 계산되며, 지원되는 예시는 강릉시, 서울특별시, 부천시, 제주시 등 전국 주요 도시입니다. (전체 LMT 보정 도시 목록은 내부 자료 또는 별도 안내를 참고하세요.)

성공 응답 예시

HTTP/1.1 200 OK
{
  "status": "success",
  "message": "요청이 완료되었습니다.",
  "data": {
    "year": {
      "branch_sipseong": "정재",
      "stem_sipseong": "정인",
      "hangul": "무인",
      "hanja": "戊寅"
    },
    "month": {
      "branch_sipseong": "정재",
      "stem_sipseong": "정재",
      "hangul": "갑인",
      "hanja": "甲寅"
    },
    "day": {
      "branch_sipseong": "상관",
      "stem_sipseong": "비견",
      "hangul": "신해",
      "hanja": "辛亥"
    },
    "hour": {
      "branch_sipseong": "식신",
      "stem_sipseong": "정인",
      "hangul": "무자",
      "hanja": "戊子"
    },
    "fortune": 9,
    "five": {
      "earth": 2.59,
      "metal": 0.97,
      "fire": 0.66,
      "wood": 6.14,
      "water": 2.90
    },
    "five_pct": {
      "earth": 19.5,
      "metal": 7.3,
      "fire": 5.0,
      "wood": 46.3,
      "water": 21.9
    },
    "five_star": {
      "earth": "★★☆☆☆",
      "metal": "★☆☆☆☆",
      "fire": "★☆☆☆☆",
      "wood": "★★★★★",
      "water": "★★★☆☆"
    },
    "five_kor": {
      "금(金)": 0.97,
      "목(木)": 6.14,
      "토(土)": 2.59,
      "화(火)": 0.66,
      "수(水)": 2.90
    },
    "twelve_growth": {
      "year": "胎",
      "month": "胎",
      "day": "沐浴",
      "hour": "長生"
    },
    "twelve_growth_kor": {
      "year": "태",
      "month": "태",
      "day": "목욕",
      "hour": "장생"
    },
    "strength": "weak",
    "geokguk": {
      "geok_kor": "종재격",
      "geok": "從財格",
      "share": 50.0,
      "category_counts": {
        "인성": 2,
        "관성": 0,
        "비겁": 1,
        "식상": 2,
        "재성": 5
      },
      "is_follower": true
    },
    "yongshin": {
      "primary": "fire",
      "primary_kor": "화(火)",
      "secondary": "earth",
      "secondary_kor": "토(土)"
    },
    "branch_relations": {
      "harmonies": ["寅-亥", "寅-亥"],
      "breaks": [],
      "three_harmonies": [],
      "punishments": [],
      "harms": [],
      "clashes": []
    },
    "branch_relations_kor": {
      "harmonies": ["인-해", "인-해"],
      "breaks": [],
      "three_harmonies": [],
      "punishments": [],
      "harms": [],
      "clashes": []
    },
    "big_luck": [
      { "age_range": "9–18",  "year_range": "2007–2016", "pillar": "癸丑", "pillar_kor": "계축" },
      { "age_range": "19–28", "year_range": "2017–2026", "pillar": "壬子", "pillar_kor": "임자" },
      { "age_range": "29–38", "year_range": "2027–2036", "pillar": "辛亥", "pillar_kor": "신해" },
      { "age_range": "39–48", "year_range": "2037–2046", "pillar": "庚戌", "pillar_kor": "경술" }
    ],
    "lucky": {
      "good_num": 2,
      "bad_num": 7,
      "good_dir": "서쪽",
      "bad_dir": "동쪽",
      "need_elem_kor": "화(火)",
      "need_elem": "fire",
      "good_colors": ["bg-red-300", "bg-orange-300"],
      "bad_color": "bg-gray-300"
    }
  }
}

주요 필드 설명

사주 기둥 year, month, day, hour

각 기둥(柱)의 간지 및 십성 정보 (branch_sipseong, stem_sipseong, hangul, hanja)를 포함합니다.

오행 분포 five, five_pct, five_star, five_kor

오행(土·金·火·木·水)의 절대값, 퍼센트, 별점(★), 한글 키 기반 점수를 제공합니다. 프론트에서는 five_pctfive_star를 바로 시각화에 사용할 수 있습니다.

십이운성 twelve_growth, twelve_growth_kor

각 기둥의 십이운성 정보를 한자(twelve_growth)와 한글(twelve_growth_kor)로 제공합니다.

일간 강약 strength

일간 강약을 weak(신약), balanced(중화), strong(신강) 세 값으로 구분합니다. UI 상에서는 뱃지나 색상 레벨로 바로 매핑 가능합니다.

격국 정보 geokguk

격국 판정(한글/한자), 주도 카테고리 점유율(share), 카테고리별 카운트(인성, 관성, 비겁, 식상, 재성), 종격 여부(is_follower)를 포함합니다.

용신·희신 yongshin

용신(primary)과 희신(secondary)의 오행 정보. 영문 코드(fire, earth 등)와 한글+한자(need_elem_kor)를 함께 제공합니다.

지지 관계 branch_relations, branch_relations_kor

육합/파/삼합/형/해/충 관계 목록을 한자(branch_relations)와 한글(branch_relations_kor)로 제공합니다.

대운 big_luck

10년 단위 대운 배열. 각 원소는 나이 구간(age_range), 연도 구간(year_range), 대운 기둥(pillar, pillar_kor)을 포함합니다.

행운 요소 lucky

행운/불행 숫자(good_num, bad_num), 방향(good_dir, bad_dir), 부족한 오행(need_elem, need_elem_kor), 추천 색상(good_colors)과 피해야 할 색(bad_color)을 포함합니다. UI에서 테마 색·추천 아이템 배경색 등에 바로 사용할 수 있습니다.

3.2 POST /api/v1/matching

소개팅·결혼중개 매칭 요청을 생성하며, 사용자의 선호도와 위치 기반 필터링을 지원합니다.

curl -X POST https://api.ablecity.kr/v1/matching \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "USER123",
    "preferences": {
      "ageRange": [25, 35],
      "interests": ["travel", "music"],
      "location": { "lat": 37.5665, "lng": 126.9780, "radiusKm": 30 }
    },
    "maxResults": 10
  }'
HTTP/1.1 201 Created
{
  "status": "success",
  "data": {
    "requestId": "REQ-67890",
    "status": "processing",
    "submittedAt": "2025-05-10T11:00:00+09:00"
  }
}

3.3 GET /api/v1/matching/{requestId}/results

매칭 진행 상황과 결과 리스트를 페이징 옵션과 함께 조회합니다.

curl -X GET \
  "https://api.ablecity.kr/v1/matching/REQ-67890/results?limit=5&offset=0" \
  -H "Authorization: Bearer <API_KEY>"
HTTP/1.1 200 OK
{
  "status": "success",
  "data": {
    "requestId": "REQ-67890",
    "status": "completed",
    "results": [
      {
        "matchId": "MCH-001",
        "name": "홍길동",
        "age": 29,
        "distanceKm": 3.5,
        "commonInterests": ["travel", "cooking"],
        "matchScore": 0.92,
        "profileImage": "https://ablecity.kr/images/users/hong.jpg"
      },
      {
        "matchId": "MCH-002",
        "name": "김미영",
        "age": 32,
        "distanceKm": 5.8,
        "commonInterests": ["music", "art"],
        "matchScore": 0.88,
        "profileImage": "https://ablecity.kr/images/users/kim.jpg"
      }
    ],
    "totalResults": 8
  }
}

3.4 GET /api/v1/tutoring/availability

과외·돌봄 서비스 제공자의 예약 가능 시간대를 조회합니다.

curl -X GET \
  "https://api.ablecity.kr/v1/tutoring/availability?date=2025-06-15&serviceType=care" \
  -H "Authorization: Bearer <API_KEY>"
HTTP/1.1 200 OK
{
  "status": "success",
  "data": [
    {
      "slotId": "SLT-001",
      "start": "2025-06-15T09:00:00+09:00",
      "end":   "2025-06-15T10:00:00+09:00",
      "price": 35000
    },
    {
      "slotId": "SLT-002",
      "start": "2025-06-15T14:00:00+09:00",
      "end":   "2025-06-15T15:30:00+09:00",
      "price": 50000
    }
  ]
}

3.5 POST /api/v1/tutoring/book

선택한 시간대로 과외·돌봄 서비스를 예약하고 결제 정보를 반환합니다.

curl -X POST https://api.ablecity.kr/v1/tutoring/book \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "userId":       "USER123",
    "slotId":       "SLT-001",
    "paymentMethod":"card",
    "cardInfo": {
      "cardNumber": "4111111111111111",
      "expiry":     "12/25",
      "cvc":        "123"
    }
  }'
HTTP/1.1 201 Created
{
  "status": "success",
  "data": {
    "bookingId":       "BOOK-34567",
    "status":          "confirmed",
    "paidAmount":      35000,
    "confirmationUrl": "https://ablecity.kr/booking/BOOK-34567"
  }
}

3.6 GET /api/v1/otc/listings

거래 가능한 OTC 리스팅을 조회하며, 자산 유형, 최소 수량 필터를 지원합니다.

curl -X GET \
  "https://api.ablecity.kr/v1/otc/listings?assetType=BTC&minQuantity=0.5" \
  -H "Authorization: Bearer <API_KEY>"
HTTP/1.1 200 OK
{
  "status": "success",
  "data": [
    {
      "listingId":    "LST-1001",
      "assetType":    "BTC",
      "quantity":     1.2,
      "pricePerUnit": 50000000,
      "totalPrice":   60000000,
      "sellerId":     "TraderA",
      "escrowStatus": "pending"
    }
  ]
}

3.7 POST /api/v1/otc/order

선택한 리스팅으로 OTC 거래 주문을 생성하고 에스크로 주소를 반환합니다.

curl -X POST https://api.ablecity.kr/v1/otc/order \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "listingId": "LST-1001",
    "buyerId":   "USER456",
    "quantity":  0.8
  }'
HTTP/1.1 201 Created
{
  "status": "success",
  "data": {
    "orderId":       "ORD-2002",
    "escrowAddress": "0xabcd1234ef567890...",
    "expiresAt":     "2025-05-10T12:00:00+09:00"
  }
}

3.8 GET /api/v1/rental/assets

렌탈 가능한 자산 목록을 조회하며, 카테고리 및 위치 필터를 지원합니다.

curl -X GET \
  "https://api.ablecity.kr/v1/rental/assets?category=camera&lat=37.5665&lng=126.9780&radiusKm=10" \
  -H "Authorization: Bearer <API_KEY>"
HTTP/1.1 200 OK
{
  "status": "success",
  "data": [
    {
      "assetId":           "ASSET-3001",
      "name":              "Canon EOS R5",
      "category":          "camera",
      "location": { "lat": 37.5665, "lng": 126.9780 },
      "hourlyRate":        15000,
      "availabilityCount": 3
    }
  ]
}

3.9 POST /api/v1/rental/reserve

선택한 자산을 예약하고 예약 정보를 반환합니다.

curl -X POST https://api.ablecity.kr/v1/rental/reserve \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "userId":    "USER123",
    "assetId":   "ASSET-3001",
    "startTime": "2025-06-20T09:00:00+09:00",
    "endTime":   "2025-06-20T17:00:00+09:00"
  }'
HTTP/1.1 201 Created
{
  "status": "success",
  "data": {
    "reservationId":   "RES-4003",
    "totalCost":       120000,
    "confirmationUrl": "https://ablecity.kr/reservations/RES-4003"
  }
}

4. Error Codes

HTTP Status Code Description
400 INVALID_REQUEST 잘못된 요청입니다.
401 UNAUTHORIZED 인증 실패 또는 토큰 만료.
404 NOT_FOUND 리소스를 찾을 수 없습니다.
429 RATE_LIMIT 요청 한도 초과입니다.
500 SERVER_ERROR 서버 내부 오류.

4.1 공통 message

4.2 인증 / Rate Limit 관련 message

4.3 사주 API(/api/v1/saju/fortune) 전용 message

5. Rate Limiting

모든 엔드포인트는 기본적으로 API Key 기준 분당 60 건, 하루 50,000 건으로 제한됩니다. 서비스별 혹은 전체 한도를 초과하면 HTTP 429(RATE_LIMIT)와 함께 상기 Rate Limit 관련 message가 반환됩니다. 필요 시 고객센터를 통해 상향을 요청할 수 있습니다.

6. Support

추가 도움말은 [email protected] 로 문의해 주세요.

자주 묻는 질문(FAQ)

만세력 API 사용료는 어떻게 되나요?

테스트는 100건까지 무료이며, 이후에는 구독형태에 따라(건당 10원~100원)가 적용됩니다.

일일 호출 한도(Rate Limit)는 어떻게 되나요?

모든 엔드포인트는 기본적으로 분당 60 건, 하루 50,000 건으로 제한됩니다. 필요 시 고객센터를 통해 상향 요청이 가능합니다.

사주 API는 어떤 프로그래밍 언어에서 사용할 수 있나요?

RESTful JSON 응답이므로 Python, JavaScript, Java, PHP 등 HTTP 클라이언트를 지원하는 모든 언어에서 호출할 수 있습니다.

에러 발생 시 재시도 정책은 어떻게 되나요?

429(요청 한도 초과) 또는 5xx 에러 발생 시 지수 백오프(예: 1 s → 2 s → 4 s)로 최대 3회까지 재시도하는 것을 권장합니다.

무료 체험용 API 키는 어떻게 받나요?

https://forms.gle/y3ysWxuDdDCYnfxs7 를 통해 접수해 주시면 관리자가 검토 후 1~2일 이내 회신 드립니다.