メインコンテンツへスキップ
API v1.0 — Public Beta

退職金最適化シミュレーター API

退職金・iDeCo・年金の受取戦略を税制に基づきシミュレーションするAPI。無料で利用可能。出典リンクの表記をお願いします。

# Quick Start

curl
curl "https://taisyoku.xyz/api/v1/simulate?retirement_bonus_man=2000&years_of_service=30&ideco_amount_man=500&ideco_years=20&current_age=58"
Response
{
  "status": "ok",
  "data": {
    "retirement_bonus": {
      "gross_man": 2000,
      "deduction_man": 1500,
      "taxable_man": 250,
      "tax_man": 51.2,
      "net_man": 1948.8
    },
    "ideco": {
      "gross_man": 500,
      "deduction_man": 400,
      "taxable_man": 50,
      "tax_man": 10.2,
      "net_man": 489.8
    },
    "pension": {
      "annual_man": 180,
      "monthly_man": 15,
      "tax_annual_man": 12.5,
      "net_annual_man": 167.5
    },
    "optimal_strategy": {
      "recommendation": "iDeCoを5年ずらして65歳で受取",
      "total_tax_saving_man": 82.3,
      "explanation": "退職所得控除を退職金とiDeCoで分けて活用することで、税負担を最小化できます。"
    },
    "currency": "JPY"
  },
  "meta": {
    "api_version": "1.0",
    "source": "https://taisyoku.xyz"
  }
}

# Authentication

認証不要。APIキーなしで利用できます。すべてのエンドポイントはパブリックアクセス可能です。

# Endpoints

GETPOST/api/v1/simulate

退職金・iDeCo・年金の最適受取シミュレーションを実行します。GETはクエリパラメータ、POSTはJSONボディで送信。

GET/api/v1/tax-tables

退職所得控除額・所得税率の早見表データを取得します。

# Parameters

NameTypeRequiredDescriptionExample
retirement_bonus_mannumberrequired退職金額(万円)2000
years_of_servicenumberrequired勤続年数30
ideco_amount_mannumberoptionaliDeCo受取予定額(万円)500
ideco_yearsnumberoptionaliDeCo加入年数20
current_agenumberrequired現在の年齢58
retirement_agenumberoptional退職予定年齢(デフォルト: 60)60
public_pension_mannumberoptional公的年金の年額(万円)180
pension_receiving_yearsnumberoptional年金受給予定年数25

# Response Format

200 OK — application/json
{
  "status": "ok",
  "data": {
    "retirement_bonus": {
      "gross_man": 2000,
      "deduction_man": 1500,
      "taxable_man": 250,
      "tax_man": 51.2,
      "net_man": 1948.8
    },
    "ideco": {
      "gross_man": 500,
      "deduction_man": 400,
      "taxable_man": 50,
      "tax_man": 10.2,
      "net_man": 489.8
    },
    "pension": {
      "annual_man": 180,
      "monthly_man": 15,
      "tax_annual_man": 12.5,
      "net_annual_man": 167.5
    },
    "optimal_strategy": {
      "recommendation": "iDeCoを5年ずらして65歳で受取",
      "total_tax_saving_man": 82.3,
      "explanation": "退職所得控除を退職金とiDeCoで分けて活用することで、税負担を最小化できます。"
    },
    "currency": "JPY"
  },
  "meta": {
    "api_version": "1.0",
    "source": "https://taisyoku.xyz"
  }
}
400 Bad Request
{
  "status": "error",
  "error": {
    "code": "INVALID_PARAMS",
    "message": "retirement_bonus_man is required. current_age must be between 18 and 80"
  }
}

# Rate Limits

100
requests / minute

IPアドレスごとに1分間100リクエストまで。制限を超えた場合は429 Too Many Requestsが返されます。

# Attribution

APIを利用する際は、出典リンクの表記をお願いします。以下のHTMLスニペットをご利用ください。

HTML
<a href="https://taisyoku.xyz" target="_blank" rel="noopener">
  退職金データ提供: taisyoku.xyz
</a>

# Code Examples

JavaScript (fetch)
const params = new URLSearchParams({
  retirement_bonus_man: '2000',
  years_of_service: '30',
  ideco_amount_man: '500',
  ideco_years: '20',
  current_age: '58',
});

const res = await fetch(`https://taisyoku.xyz/api/v1/simulate?${params}`);
const data = await res.json();

console.log(data.data.optimal_strategy.total_tax_saving_man);
// => 82.3
Python (requests)
import requests

resp = requests.get("https://taisyoku.xyz/api/v1/simulate", params={
    "retirement_bonus_man": 2000,
    "years_of_service": 30,
    "ideco_amount_man": 500,
    "ideco_years": 20,
    "current_age": 58,
})
data = resp.json()

print(data["data"]["optimal_strategy"]["total_tax_saving_man"])
# => 82.3
PHP
<?php
$query = http_build_query([
    'retirement_bonus_man' => 2000,
    'years_of_service'     => 30,
    'ideco_amount_man'     => 500,
    'ideco_years'          => 20,
    'current_age'          => 58,
]);

$json = file_get_contents("https://taisyoku.xyz/api/v1/simulate?{$query}");
$data = json_decode($json, true);

echo $data['data']['optimal_strategy']['total_tax_saving_man'];
// => 82.3