{
 "openapi": "3.1.1",
 "info": {
  "title": "루첼라 API — 결과 API",
  "version": "2026-10-21",
  "description": "결과 API. 인증은 머리말 X-Lucela-API-Key 하나, 성공·오류는 같은 네 칸 봉투(status · data · error · meta)."
 },
 "servers": [
  {
   "url": "https://apis.lucela.kr"
  }
 ],
 "tags": [
  {
   "name": "결과 API",
   "description": "생활권 · 절기 달력"
  }
 ],
 "paths": {
  "/v1/fusion/neighborhood": {
   "get": {
    "tags": [
     "결과 API"
    ],
    "summary": "시군구 요약",
    "description": "시군구 하나의 버스 정류장 수 · 출처",
    "operationId": "get_v1_fusion_neighborhood",
    "x-lucela-mcp-tool": "lucela_get_neighborhood",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-implementation-status": "AVAILABLE",
    "x-lucela-billing-unit": "성공 응답 1",
    "x-lucela-unit-weight": 1,
    "x-lucela-response-fields": "data(sigungu_code · sigungu_name · bus_stops(count · status · reason(셀 수 없을 때))) · meta(request_id · environment · synthetic · schema_version · warnings · as_of · fusion(spec_id · spec_version · dataset_version · output_hash · state) · sources[](provider · dataset_id · dataset_version · fetched_at · source_updated_at · license_state · role · status · contributes[]) · attribution[])",
    "responses": {
     "200": {
      "description": "성공 — 봉투 한 모양",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "data": {
             "type": "object",
             "properties": {
              "sigungu_code": {},
              "sigungu_name": {},
              "bus_stops": {
               "type": "object",
               "properties": {
                "count": {},
                "status": {},
                "reason": {}
               },
               "required": [
                "count",
                "status"
               ]
              }
             },
             "required": [
              "sigungu_code",
              "sigungu_name",
              "bus_stops"
             ]
            },
            "meta": {
             "type": "object",
             "properties": {
              "request_id": {},
              "environment": {},
              "synthetic": {},
              "schema_version": {},
              "warnings": {},
              "as_of": {},
              "fusion": {
               "type": "object",
               "properties": {
                "spec_id": {},
                "spec_version": {},
                "dataset_version": {},
                "output_hash": {},
                "state": {}
               },
               "required": [
                "spec_id",
                "spec_version",
                "dataset_version",
                "output_hash",
                "state"
               ]
              },
              "sources": {
               "type": "array",
               "items": {
                "type": "object",
                "properties": {
                 "provider": {},
                 "dataset_id": {},
                 "dataset_version": {},
                 "fetched_at": {},
                 "source_updated_at": {},
                 "license_state": {},
                 "role": {},
                 "status": {},
                 "contributes": {
                  "type": "array",
                  "items": {}
                 }
                },
                "required": [
                 "provider",
                 "dataset_id",
                 "dataset_version",
                 "fetched_at",
                 "source_updated_at",
                 "license_state",
                 "role",
                 "status",
                 "contributes"
                ]
               }
              },
              "attribution": {
               "type": "array",
               "items": {}
              }
             },
             "required": [
              "request_id",
              "environment",
              "synthetic",
              "schema_version",
              "warnings",
              "as_of",
              "fusion",
              "sources",
              "attribution"
             ]
            }
           }
          }
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/E400"
     },
     "401": {
      "$ref": "#/components/responses/E401"
     },
     "403": {
      "$ref": "#/components/responses/E403"
     },
     "429": {
      "$ref": "#/components/responses/E429"
     },
     "503": {
      "$ref": "#/components/responses/E503"
     }
    },
    "parameters": [
     {
      "name": "sigungu_code",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/fusion/solar-calendar": {
   "get": {
    "tags": [
     "결과 API"
    ],
    "summary": "날짜별 달력",
    "description": "날짜별 절기 · 공휴일 · 음력",
    "operationId": "get_v1_fusion_solar_calendar",
    "x-lucela-mcp-tool": "lucela_get_solar_calendar",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-implementation-status": "AVAILABLE",
    "x-lucela-billing-unit": "성공 응답 1",
    "x-lucela-unit-weight": 1,
    "x-lucela-response-fields": "data.days[](date · weekday · holiday · solar_term · lunar(year · month · day · leap) · status(lunar · holiday · solar_term)) · meta(request_id · environment · synthetic · schema_version · warnings · as_of · fusion(spec_id · spec_version · dataset_version · output_hash · state) · sources[](provider · dataset_id · dataset_version · fetched_at · source_updated_at · license_state · role · status · contributes[]) · attribution[])",
    "responses": {
     "200": {
      "description": "성공 — 봉투 한 모양",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "data": {
             "type": "object",
             "properties": {
              "days": {
               "type": "array",
               "items": {
                "type": "object",
                "properties": {
                 "date": {},
                 "weekday": {},
                 "holiday": {},
                 "solar_term": {},
                 "lunar": {
                  "type": "object",
                  "properties": {
                   "year": {},
                   "month": {},
                   "day": {},
                   "leap": {}
                  },
                  "required": [
                   "year",
                   "month",
                   "day",
                   "leap"
                  ]
                 },
                 "status": {
                  "type": "object",
                  "properties": {
                   "lunar": {},
                   "holiday": {},
                   "solar_term": {}
                  },
                  "required": [
                   "lunar",
                   "holiday",
                   "solar_term"
                  ]
                 }
                },
                "required": [
                 "date",
                 "weekday",
                 "holiday",
                 "solar_term",
                 "lunar",
                 "status"
                ]
               }
              }
             },
             "required": [
              "days"
             ]
            },
            "meta": {
             "type": "object",
             "properties": {
              "request_id": {},
              "environment": {},
              "synthetic": {},
              "schema_version": {},
              "warnings": {},
              "as_of": {},
              "fusion": {
               "type": "object",
               "properties": {
                "spec_id": {},
                "spec_version": {},
                "dataset_version": {},
                "output_hash": {},
                "state": {}
               },
               "required": [
                "spec_id",
                "spec_version",
                "dataset_version",
                "output_hash",
                "state"
               ]
              },
              "sources": {
               "type": "array",
               "items": {
                "type": "object",
                "properties": {
                 "provider": {},
                 "dataset_id": {},
                 "dataset_version": {},
                 "fetched_at": {},
                 "source_updated_at": {},
                 "license_state": {},
                 "role": {},
                 "status": {},
                 "contributes": {
                  "type": "array",
                  "items": {}
                 }
                },
                "required": [
                 "provider",
                 "dataset_id",
                 "dataset_version",
                 "fetched_at",
                 "source_updated_at",
                 "license_state",
                 "role",
                 "status",
                 "contributes"
                ]
               }
              },
              "attribution": {
               "type": "array",
               "items": {}
              }
             },
             "required": [
              "request_id",
              "environment",
              "synthetic",
              "schema_version",
              "warnings",
              "as_of",
              "fusion",
              "sources",
              "attribution"
             ]
            }
           }
          }
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/E400"
     },
     "401": {
      "$ref": "#/components/responses/E401"
     },
     "403": {
      "$ref": "#/components/responses/E403"
     },
     "429": {
      "$ref": "#/components/responses/E429"
     },
     "503": {
      "$ref": "#/components/responses/E503"
     }
    },
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "92일 이하"
     }
    ]
   }
  }
 },
 "components": {
  "securitySchemes": {
   "ApiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-Lucela-API-Key"
   },
   "LucelaDelegation": {
    "type": "oauth2",
    "description": "손님 위임 토큰 — 인가 코드 + PKCE(S256). 개인 자료는 이 토큰으로만 엽니다.",
    "flows": {
     "authorizationCode": {
      "authorizationUrl": "https://auth.lucela.kr/realms/lucela/protocol/openid-connect/auth",
      "tokenUrl": "https://auth.lucela.kr/realms/lucela/protocol/openid-connect/token",
      "refreshUrl": "https://auth.lucela.kr/realms/lucela/protocol/openid-connect/token",
      "scopes": {
       "openid": "회원번호(이 앱 전용)",
       "lucela.name.read": "이름",
       "email": "이메일",
       "soompyo.birth.read": "출생 연월일 · 태어난 시 · 양력/음력 · 성별"
      }
     }
    }
   },
   "AtelierProductToken": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "lcpt_",
    "description": "아틀리에 상품등록 토큰 — 범위: atelier.products:read · atelier.products:write · atelier.products:submit · atelier.catalog:review · atelier.catalog:publish · atelier.purchases:read · atelier.purchases:write · atelier.library:download"
   },
   "DirectDelegation": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "lcdd.",
    "description": "루첼라 다이렉트 연결 토큰 — https://direct.lucela.kr/connections 에서 발급 · 실제 키(X-Lucela-API-Key)와 함께 보낸다"
   }
  },
  "schemas": {
   "Envelope": {
    "type": "object",
    "required": [
     "status",
     "data",
     "error",
     "meta"
    ],
    "properties": {
     "status": {
      "const": "ok"
     },
     "data": {},
     "error": {
      "type": "null"
     },
     "meta": {
      "type": "object",
      "properties": {
       "request_id": {
        "type": "string"
       },
       "environment": {
        "enum": [
         "SANDBOX",
         "LIVE"
        ]
       },
       "synthetic": {
        "type": "boolean"
       },
       "schema_version": {
        "type": "string"
       },
       "warnings": {
        "type": "array",
        "items": {}
       }
      }
     }
    }
   },
   "ErrorEnvelope": {
    "type": "object",
    "required": [
     "status",
     "data",
     "error",
     "meta"
    ],
    "properties": {
     "status": {
      "const": "error"
     },
     "data": {
      "type": "null"
     },
     "error": {
      "type": "object",
      "required": [
       "code",
       "title",
       "status",
       "type",
       "detail",
       "instance"
      ],
      "properties": {
       "code": {
        "enum": [
         "ambiguous_birth_place",
         "approval_required",
         "birth_place_required",
         "birth_time_required",
         "consent_required",
         "contract_required",
         "delegation_required",
         "dependency_unavailable",
         "dpa_required",
         "engine_unavailable",
         "environment_mismatch",
         "idempotency_conflict",
         "insufficient_scope",
         "invalid_answers",
         "invalid_credential",
         "invalid_date",
         "invalid_features",
         "invalid_longitude",
         "invalid_time",
         "malformed_request",
         "media_not_ready",
         "method_not_allowed",
         "not_owner",
         "payload_too_large",
         "precondition_required",
         "processing_timeout",
         "provision_ack_required",
         "purpose_not_allowed",
         "quota_exhausted",
         "rate_limited",
         "resource_expired",
         "resource_not_found",
         "rights_denied",
         "sandbox_requires_fixture",
         "scale_version_mismatch",
         "scope_required",
         "service_paused",
         "source_failed",
         "state_conflict",
         "subject_age_not_supported",
         "time_nonexistent",
         "unknown_city_code",
         "unsafe_content",
         "unsupported_calendar",
         "unsupported_capability",
         "unsupported_jasi_method",
         "unsupported_lunar_basis",
         "unsupported_ruleset",
         "unsupported_timezone",
         "validation_blocked",
         "version_conflict"
        ]
       },
       "title": {
        "type": "string"
       },
       "status": {
        "type": "integer"
       },
       "type": {
        "type": "string"
       },
       "detail": {
        "type": "string"
       },
       "instance": {
        "type": "string",
        "format": "uri"
       },
       "field": {
        "type": "string"
       }
      }
     },
     "meta": {
      "type": "object",
      "properties": {
       "request_id": {
        "type": "string"
       }
      }
     }
    }
   }
  },
  "responses": {
   "E400": {
    "description": "malformed_request: 요청 형식이 맞지 않습니다 · provision_ack_required: 제공 개시 확인이 필요합니다",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorEnvelope"
      }
     }
    }
   },
   "E401": {
    "description": "invalid_credential: 인증할 수 없습니다",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorEnvelope"
      }
     }
    }
   },
   "E403": {
    "description": "scope_required: 이 키로는 쓸 수 없는 기능입니다 · contract_required: 이용 계약이 필요합니다 · rights_denied: 제공할 수 없는 자료입니다 · environment_mismatch: 환경이 맞지 않습니다 · dpa_required: 처리 위탁 문서 동의가 필요합니다 · delegation_required: 손님 위임 토큰이 필요합니다 · insufficient_scope: 허락받지 않은 범위입니다 · not_owner: 이 자료의 주인이 아닙니다 · approval_required: 사람 승인이 필요합니다",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorEnvelope"
      }
     }
    }
   },
   "E429": {
    "description": "rate_limited: 요청이 너무 잦습니다 · quota_exhausted: 포함량을 모두 썼습니다",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorEnvelope"
      }
     }
    }
   },
   "E503": {
    "description": "engine_unavailable: 계산 엔진을 쓸 수 없습니다 · dependency_unavailable: 지금은 처리할 수 없습니다 · service_paused: 서비스가 잠시 멈춰 있습니다",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorEnvelope"
      }
     }
    }
   }
  }
 }
}
