Ablecity 万年暦・四柱推命 API Reference
万年暦・四柱推命・相性・命名・画像系占いAPIをアプリやWebサービスに連携するための開発者向けドキュメントです。認証、リクエストパラメータ、JSONレスポンス、v2 add-on API、callback flow、error code、rate limit、APIキー発行手順を案内します。
200+
Global Partners
Dec 2025
Since Launch
0
Critical Errors
Live
SSEHADA Engine
内部運用、テストキー発行、パートナー環境を基準にした表記です。Ablecity APIは2025年12月ローンチ以降、APIレベルの無停止運用を継続しています。正式なSLAは契約範囲ごとに定義し、公開文書では内部判断ロジックではなく連携に必要な契約仕様のみを案内します。
万年暦・四柱推命API v2連携基準
- この文書はv2専用です。新規テストキーと本番キーは
/api/v2/...パス基準で発行されます。 - 同期endpointはJSONを即時返却します。非同期分析endpointは
POSTとX-Callback-URLを使用します。 - 相性、命名、画像系分析はpayload構造が異なります。例示されたキー名をそのまま使用してください。
- v1 pathは終了しているため、この文書では案内しません。
クイックスタート
5分で最初の呼び出しを成功させる
サーバー側で管理するAPIキーを準備し、基本の万年暦endpointをGETで呼び出します。相性、命名、年運、愛情運、財運のような生成時間が必要な分析はPOST + callbackで連携します。
1. APIキーを準備
すべてのリクエストは Authorization: Bearer <API_KEY> を使用します。キー発行後、キー保有者は API Dashboard に登録し、使用量、サブスクリプション状態、API照会を確認できます。
2. 単一照会はGET
基本の四柱推命endpointは命式と公開構造化フィールドをJSONで即時返却します。
3. 分析系はcallback
相性、命名、財運・愛情運・年運、画像系モジュールはリクエスト受付後、callback endpointへ結果を送信します。
基本の万年暦照会
curl -X GET \
"https://api.ablecity.kr/api/v2/saju/fortune?birth=1990-01-01T01:00:00&gender=male&city=Seoul&calendar=solar&midnightType=0" \
-H "Authorization: Bearer <API_KEY>" \
-H "Accept: application/json"
1. 認証
すべてのリクエストはHTTP headerにBearer tokenを含める必要があります。APIキーはサーバー側で管理し、クライアントアプリに埋め込まず、連携担当者が変わる場合はローテーションしてください。
Authorization: Bearer <API_KEY>
2. 共通レスポンス形式
すべてのendpointはREST JSON envelopeを返します。エラー時も同じtop-level構造を維持するため、クライアント側で成功・失敗を一貫して処理できます。
{
"status": "success",
"message": "Request completed.",
"data": {}
}
3. 運用基準
Ablecity APIは単発計算だけでなく、実サービス連携を前提に設計されています。認証、使用量管理、課金範囲、モニタリング、SLAオプションを導入時にまとめて整理します。
| Area | Common risk | Ablecity standard |
|---|---|---|
| Response structure | Mixed HTML or text | REST JSON envelope |
| Usage control | No key-level visibility | Key-based request and monthly usage tracking |
| Domain fields | Only final text output | Structured chart, elements, relations, void branches and approved SIS fields |
| Integration mode | Synchronous calls only | Synchronous GET + asynchronous POST/callback |
| Support | General inquiry only | Contract-defined SLA option |
4. GET /api/v2/saju/fortune
現行標準生年月日、性別、任意の出生地、子時処理方式、暦種別を基に、公開v2万年暦payloadを計算します。公開フィールドには四柱命式、五行、運勢cycle、干支相性、空亡、承認済みキーで利用可能なSIS関連構造が含まれます。
v2使用基準
- すべての新規キーは
GET /api/v2/saju/fortune基準で発行されます。 - top-levelの
status,message,data構造はクライアント処理のため安定して維持されます。 - 内部debug fieldと独自判断ロジックは公開文書から意図的に除外しています。
SIS add-on案内
- 基本照会ではfull SIS add-onをデフォルト公開しません。
- 承認済みAPIキーでは
sinsal,relations_ui,gongmangなどのフィールドを含めることができます。 - 実서비스連携に必要な公開フィールドのみ文書化しています。
コード例
curl -X GET \
"https://api.ablecity.kr/api/v2/saju/fortune?birth=1990-01-01T01:00:00&gender=male&city=Seoul&calendar=solar&midnightType=0" \
-H "Authorization: Bearer <API_KEY>" \
-H "Accept: application/json"
import requests
url = "https://api.ablecity.kr/api/v2/saju/fortune"
params = {
"birth": "1990-01-01T01:00:00",
"gender": "male",
"city": "Seoul",
"calendar": "solar",
"midnightType": 0,
}
headers = {"Authorization": "Bearer <API_KEY>"}
print(requests.get(url, params=params, headers=headers).json())
const axios = require("axios");
const res = await axios.get("https://api.ablecity.kr/api/v2/saju/fortune", {
params: {
birth: "1990-01-01T01:00:00",
gender: "male",
city: "Seoul",
calendar: "solar",
midnightType: 0
},
headers: { Authorization: "Bearer <API_KEY>" }
});
console.log(res.data);
OkHttpClient client = new OkHttpClient();
HttpUrl url = HttpUrl.parse("https://api.ablecity.kr/api/v2/saju/fortune").newBuilder()
.addQueryParameter("birth", "1990-01-01T01:00:00")
.addQueryParameter("gender", "male")
.addQueryParameter("city", "Seoul")
.addQueryParameter("calendar", "solar")
.addQueryParameter("midnightType", "0")
.build();
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization", "Bearer <API_KEY>")
.build();
クエリパラメータ
| Name | Type | Required | Description |
|---|---|---|---|
| birth | string | Yes | Birth datetime in YYYY-MM-DDTHH:mm:ss format. |
| gender | string | Yes | male or female. |
| city | string | Optional | Birth city for local mean time correction. If omitted, Seoul is used as the default basis. |
| midnightType | integer | Optional | 0: split late/early midnight, default. 1: treat 23:00-00:59 as next-day midnight branch. |
| calendar | string | Optional | solar, lunar, or leap. |
対応都市例
正確な本番連携のため、可能な場合は韓国の行政区域名を使用してください。例: 서울특별시, 부산광역시, 대구광역시, 인천광역시, 광주광역시, 대전광역시, 울산광역시, 세종특별자치시, 수원시, 고양시, 용인시, 성남시, 태안군. 海外向けサービスでは導入時にcity値の正規化方針を確認します。
5. 公開レスポンスフィールド
レスポンスは連携向け公開フィールドを返します。内部score logic、private rule table、debug fieldは公開文書に含めません。
{
"status": "success",
"message": "Request completed.",
"data": {
"saju": {
"year": { "heaven": "庚", "earth": "午" },
"month": { "heaven": "戊", "earth": "子" },
"day": { "heaven": "丙", "earth": "寅" },
"hour": { "heaven": "己", "earth": "丑" }
},
"five_elements": { "wood": 2, "fire": 2, "earth": 2, "metal": 1, "water": 1 },
"ten_gods": [],
"daeun": [],
"gongmang": [],
"zodiac_compat": [],
"sinsal": []
}
}
命式フィールド
saju, heavenly stems, earthly branches and display-ready chart values used for Four Pillars screens.
五行・関係フィールド
five_elements, ten_gods and relationship structures support visual balance charts and relationship copy.
運勢cycleフィールド
daeun, yearly/monthly flow fields and luck-flow add-ons support time-series UX.
承認済みSISフィールド
sinsal, gongmang and relations_ui can be exposed only for approved API keys and integration scopes.
6. v2 add-ons と分析API
基本の万年暦照会に加えて、v2は日運、luck-flow、詳細分析モジュールを提供します。fortune/request-analysis/ 配下のendpointはPOST + callback方式です。
- GET:
/fortune,/daily,/zodiac-luck,/luck-flowreturn immediately. - POST:
/fortune/request-analysis/...returns an accepted response first and sends final content toX-Callback-URL. - CHECK: Compatibility, naming and image modules use distinct payload shapes.
| Method | Endpoint | Use |
|---|---|---|
| GET | /api/v2/saju/fortune/daily | Daily fortune |
| GET | /api/v2/saju/fortune/zodiac-luck | Daily zodiac-style luck |
| GET | /api/v2/saju/fortune/luck-flow | Major, yearly and monthly flow data |
| POST | /api/v2/saju/fortune/request-analysis/this-year-luck | This-year fortune, callback required |
| POST | /api/v2/saju/fortune/request-analysis/telling | Traditional Saju reading, callback required |
| POST | /api/v2/saju/fortune/request-analysis/match | Two-person compatibility, callback required |
| POST | /api/v2/saju/fortune/request-analysis/week-luck | Weekly fortune, callback required |
| POST | /api/v2/saju/fortune/request-analysis/love-luck | This-year love luck, callback required |
| POST | /api/v2/saju/fortune/request-analysis/rich-luck | This-year wealth luck, callback required |
| POST | /api/v2/saju/fortune/request-analysis/naming | Naming recommendation and interpretation, callback required |
| POST | /api/v2/saju/fortune/request-analysis/face | Face image analysis, callback required |
| POST | /api/v2/saju/fortune/request-analysis/palmistry | Palm image analysis, callback required |
POST + Callback Recipe
7. 相性API例
相性APIは一人分の命式照会より難しく、male と female の二つのnested objectが必要です。また、最終分析結果は即時返却ではなくcallback URLへ送信されます。
1. Callback URLを準備
結果payloadを受信できるHTTPS endpointを作成します。
2. 相性リクエスト送信
male, female, X-Callback-URL を一緒に送信します。
3. 結果受信
最初のレスポンスは受付確認です。最終結果はcallbackで到着します。
完成形cURL例
curl -X POST \
"https://api.ablecity.kr/api/v2/saju/fortune/request-analysis/match" \
-H "Authorization: Bearer <API_KEY>" \
-H "X-Callback-URL: https://your-server.com/webhook/saju-match" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"male": {
"birth": "1999-04-10T00:30:00",
"gender": "male",
"midnightType": 0,
"city": "서울특별시",
"calendar": "solar"
},
"female": {
"birth": "1998-03-10T00:10:00",
"gender": "female",
"midnightType": 0,
"city": "태안군",
"calendar": "solar"
}
}'
ペイロードフィールド
| Field | Required | Description |
|---|---|---|
| male | Yes | Birth-data object for the male user or first person. |
| female | Yes | Birth-data object for the female user or second person. |
| birth | Yes | YYYY-MM-DDTHH:mm:ss birth datetime. |
| gender | Yes | male or female. |
| midnightType | Yes | Midnight handling. Start with 0 for standard integration. |
| city | Yes | Birth city, such as 서울특별시 or 태안군. |
| calendar | Yes | solar for solar calendar. |
受付レスポンス
{
"status": "success",
"message": "Analysis request accepted.",
"data": {
"request_id": "match_20260409_000001",
"service": "match",
"callback_status": "queued",
"callback_url": "https://your-server.com/webhook/saju-match"
}
}Node.js callback受信例
app.post("/webhook/saju-match", express.json(), (req, res) => {
console.log("Compatibility result:", req.body);
res.status(200).json({ ok: true });
});Callback結果構造
{
"request_id": "match_20260409_000001",
"service": "match",
"status": "success",
"data": {
"summary": "二人の関係傾向と補完ポイント。",
"score": 82,
"sections": [
{ "title": "相性傾向", "content": "関係の流れを説明します。" },
{ "title": "注意点", "content": "衝突しやすいポイントを説明します。" }
]
}
}
よくある失敗
X-Callback-URL: https://...のコロンを省略しないでください。maleとfemaleのキー名を変更しないでください。- JSON bodyを送信する場合は
Content-Type: application/jsonを指定してください。 - 外部から到達可能なHTTPS callback endpointを使用してください。
汎用POST/callback例
curl -X POST \
"https://api.ablecity.kr/api/v2/saju/fortune/request-analysis/rich-luck" \
-H "Authorization: Bearer <API_KEY>" \
-H "X-Callback-URL: https://your-server.com/webhook/result" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"birth": "1990-01-01T00:00:00",
"gender": "male",
"city": "서울특별시",
"calendar": "solar",
"midnightType": 0
}'
8. 占星術API draft
今後の拡張に備えて占星術API専用ページを準備しています。製品仕様が確定するまではnoindexで運用し、本番ドキュメントではなく設計用のページとして扱います。
Draftページを見る9. エラーコード
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Malformed request or missing required fields. |
| 401 | UNAUTHORIZED | Authentication failed or token expired. |
| 404 | NOT_FOUND | Requested resource or endpoint was not found. |
| 429 | RATE_LIMIT | Request limit exceeded. |
| 500 | SERVER_ERROR | Internal server error. |
Common messages
Request completed.Server processing error occurred.Service not found.
Auth / rate messages
Invalid API Key.Per-minute request limit exceeded.Daily request limit exceeded.Service is not allowed for this key.
Saju-specific messages
invalid birth date formatgender must be 'male' or 'female'invalid timezone
10. レート制限
本番サービスを安定させるため、発行されたAPIキー単位でリクエスト量を制限します。より高い上限は事業規模と契約範囲に応じて相談できます。
Per Minute
60 requests
Per Day
50,000 requests
上限を超過した場合、APIはHTTP 429 Too Many Requests とレート制限関連メッセージを返します。
11. FAQ
どのAPI versionで連携すべきですか?
v2のみを使用してください。新規テストキーと本番キーは /api/v2/... パス基準で発行されます。
相性APIが基本照会より難しい理由は?
male と female の二つのnested birth-data objectが必要で、最終分析結果は X-Callback-URL に送信されるためです。
X-Callback-URLには何を入れますか?
分析結果を受信するHTTPS endpointを指定します。例: https://your-server.com/webhook/saju-match。header syntaxは X-Callback-URL: https://... のように指定してください。
料金はどうなりますか?
テストは最初の100件まで無料です。その後は契約プランと範囲により、subscription型で適用されます。基準は JPY料金表 を参照し、最終見積はプラン、呼び出し量、範囲で確定します。
どのプログラミング言語で利用できますか?
HTTP clientを使える言語・プラットフォームであれば利用できます。Python、JavaScript/Node.js、Java、PHP、Goなどに対応可能です。
API Dashboardはいつ使いますか?
APIキー発行後、キー保有者は API Dashboard に登録し、使用量、サブスクリプション状態、API照会を確認できます。
12. サポート
連携前の問い合わせはメールでご連絡ください。キー発行後はAPI Dashboardで使用量、サブスクリプション、API照会を確認できます。