Infra Ops Hub
Authenticated API

Site Health Check

URL を指定すると 9 カテゴリを並列診断し、総合スコア + 改善提案 + ハッシュ(共有 URL)を返却します。サーバー間連携(curl 等)向けの API key 認証エンドポイントです。Web フォームから利用する場合はログイン済みセッションで /api/healthcheck を使ってください。

Endpoint

POST /api/v1/site-health-check

認証

API キー必須。Authorization: Bearer <ioh_live_...> ヘッダで認証してください。

パラメタ

API パラメタ
名前必須説明
urlstring必須診断対象 URL

curl サンプル

curl -X POST "https://infra.yuzlrin.jp/api/v1/site-health-check" \
  -H "Authorization: Bearer ioh_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "content-type: application/json" \
  -d '{"url":"https://example.com"}'

レスポンス例

{
  "hash": "abc123",
  "url": "https://example.com",
  "host": "example.com",
  "overall": { "score": 92, "rank": "A" },
  "categories": {
    "ssl": { "score": 95, "rank": "A", "items": [{ "key": "expiry", "label": "証明書期限", "status": "ok", "value": "83日" }], "durationMs": 210 },
    "dns": { "score": 90, "rank": "A", "items": [], "durationMs": 180 },
    "mail": { "score": 80, "rank": "B", "items": [], "durationMs": 460 },
    "headers": { "score": 72, "rank": "C", "items": [], "durationMs": 190 },
    "http": { "score": 88, "rank": "B", "items": [], "durationMs": 330 },
    "domain": { "score": 100, "rank": "A+", "items": [], "durationMs": 520 },
    "seo": { "score": 84, "rank": "B", "items": [], "durationMs": 400 },
    "wordpress": { "score": 100, "rank": "A+", "items": [], "durationMs": 120 },
    "cdn": { "score": 100, "rank": "A+", "items": [], "durationMs": 90 }
  },
  "suggestions": [
    { "category": "headers", "severity": "medium", "title": "HSTS が未設定", "description": "Strict-Transport-Security を追加してください" }
  ],
  "shareUrl": "https://infra.yuzlrin.jp/check/abc123",
  "durationMs": 3421,
  "persisted": true
}

共通エラー

API 共通エラー
Statuscode意味
400missing_parameter / invalid_host / invalid_url / invalid_parameter / ssrf_blocked入力不正または SSRF 保護による拒否。ssrf_blocked は reason を含む場合があります。
401auth_required / invalid_api_key / api_key_requiredログインまたは API キーが必要です。Site Health Check は API キー専用です。
413 / 415payload_too_large / unsupported_media_typePOST JSON のサイズ超過または Content-Type 不一致。
429rate_limitedレスポンス本文に resetInSec、ヘッダに Retry-After を含みます。
500internal_error内部エラー。エラー応答は Cache-Control: no-store です。
{
  "error": "Invalid URL",
  "code": "invalid_url"
}

{
  "error": "Rate limited",
  "code": "rate_limited",
  "resetInSec": 3600
}

制限事項

  • API key Free プラン: 1000 回 / 日 + 30000 回 / 月。
  • SSRF 保護 — private IP / metadata ホストへのリクエストは拒否。
  • 通信量・対象負荷を配慮した利用をお願いします。
  • API key 必須。Authorization: Bearer <ioh_live_...> ヘッダで認証する。
  • Web フォームから利用する場合はログイン済みセッションで /api/healthcheck を使う。
  • 通常は結果を 365 日間保存し shareUrl を返す。保存に失敗した場合も診断結果は 200 で返り、persisted:false / shareUrl:null になります。

関連ページ