{
  "openapi": "3.1.0",
  "info": {
    "title": "Japan Alert Decoder API",
    "version": "1.0.0",
    "description": "What does that Japanese emergency alert mean, and what do you do? Paste the alert (Japanese or English): Earthquake Early Warning (緊急地震速報), tsunami warnings, the new level-named weather warnings since 2026-05-29 (レベル4土砂災害危険警報 and more), evacuation levels (避難指示), Nankai Trough information, J-ALERT missile alerts, volcano and heat alerts. Get the level, what to do now and the official name in 14 languages.\n\nFree, no API key, CORS open. Fair use: about 120 requests per minute per IP. Also available as MCP tools at https://free-agent-tools.vercel.app/mcp"
  },
  "servers": [
    {
      "url": "https://japan-alert-decoder.vercel.app"
    }
  ],
  "paths": {
    "/api/decode": {
      "get": {
        "operationId": "japanAlertDecode",
        "summary": "Decode a Japanese emergency alert: what it means, the alert level and what to do now",
        "description": "Decodes the text of a Japanese emergency alert (phone emergency mail, TV, app, siren announcement; Japanese or English) or an alert id, using official JMA / Cabinet Office / J-ALERT / Ministry of the Environment rules as of 2026-10-17. Covers the Earthquake Early Warning (緊急地震速報 warning / forecast / cancellation), seismic intensity (shindo 0-7), tsunami (大津波警報 Major Tsunami Warning >3 m, 津波警報 1-3 m, 津波注意報 0.2-1 m, forecast), the new level-named weather warnings in force since 2026-05-29 (Level 5 特別警報 Emergency Warning / Level 4 危険警報 Urgent Warning / Level 3 警報 Warning / Level 2 注意報 Advisory for heavy rain 大雨, landslide 土砂災害, flood 氾濫 and storm surge 高潮, plus Level 1 早期注意情報) and the old names they replaced (土砂災害警戒情報 → レベル4土砂災害危険警報, 洪水警報 abolished, 高潮警報 was Level 4), other warnings without a level (暴風, 大雪, 波浪, 雷…), 気象防災速報 (線状降水帯), municipal evacuation levels (緊急安全確保 / 避難指示 / 高齢者等避難), Nankai Trough Earthquake Extra Information (調査中 / 巨大地震警戒 / 巨大地震注意 / 調査終了), the Hokkaido-Sanriku Subsequent Earthquake Advisory, volcanic alert levels and 噴火速報, J-ALERT missile alerts, and heat-stroke alerts. Returns verdict, a one-line headline, urgency, the primary alert (Japanese and official English name, the name in the requested language from the JMA multilingual dictionary, alert level, colour, who issues it, meaning, doNow tailored to the situation, don't, how long, sources), other alerts in the text, modifiers (cancelled, lifted 解除, drill 訓練), extracted level / shindo / tsunami height, renamed old names, notes and official live-data links. No live data: it explains the alert you already have.\n\nExample: https://japan-alert-decoder.vercel.app/api/decode?text=%E7%B7%8A%E6%80%A5%E5%9C%B0%E9%9C%87%E9%80%9F%E5%A0%B1%20%E5%BC%B7%E3%81%84%E6%8F%BA%E3%82%8C%E3%81%AB%E5%82%99%E3%81%88%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84&situation=train",
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": false,
            "description": "The alert text as received, Japanese or English, e.g. '緊急地震速報 強い揺れに備えてください', 'レベル4土砂災害危険警報', '【警戒レベル4】避難指示', '大津波警報 10m超', 'Missile launch'. Up to 4,000 characters.",
            "schema": {
              "type": "string",
              "description": "The alert text as received, Japanese or English, e.g. '緊急地震速報 強い揺れに備えてください', 'レベル4土砂災害危険警報', '【警戒レベル4】避難指示', '大津波警報 10m超', 'Missile launch'. Up to 4,000 characters."
            }
          },
          {
            "name": "alert",
            "in": "query",
            "required": false,
            "description": "Instead of (or with) text: an alert id from /api/rules, e.g. eew-warning, eew-forecast, eew-cancel, l4-landslide, tsunami-advisory, evac-l4, nankai-megaquake-advisory, missile.",
            "schema": {
              "type": "string",
              "description": "Instead of (or with) text: an alert id from /api/rules, e.g. eew-warning, eew-forecast, eew-cancel, l4-landslide, tsunami-advisory, evac-l4, nankai-megaquake-advisory, missile."
            }
          },
          {
            "name": "situation",
            "in": "query",
            "required": false,
            "description": "Where the person is, to tailor the actions (earthquake, tsunami, missile, rain): indoors, outdoors, driving, train, elevator, crowd, coast, mountain.",
            "schema": {
              "type": "string",
              "description": "Where the person is, to tailor the actions (earthquake, tsunami, missile, rain): indoors, outdoors, driving, train, elevator, crowd, coast, mountain.",
              "enum": [
                "indoors",
                "outdoors",
                "driving",
                "train",
                "elevator",
                "crowd",
                "coast",
                "mountain"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Language for nameLocal (official JMA dictionary names): ja, en, zh-CN, zh-TW, ko, pt, es, id, vi, tl, th, ne, km, my, mn. Explanations are in English.",
            "schema": {
              "type": "string",
              "description": "Language for nameLocal (official JMA dictionary names): ja, en, zh-CN, zh-TW, ko, pt, es, id, vi, tl, th, ne, km, my, mn. Explanations are in English.",
              "enum": [
                "ja",
                "en",
                "zh-CN",
                "zh-TW",
                "ko",
                "pt",
                "es",
                "id",
                "vi",
                "tl",
                "th",
                "ne",
                "km",
                "my",
                "mn"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result as JSON. Always includes a `disclaimer` field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid input. The body explains what to send and gives an example."
          },
          "429": {
            "description": "Too many requests from one IP. Retry after the Retry-After seconds."
          }
        }
      },
      "post": {
        "operationId": "japanAlertDecodePost",
        "summary": "Decode a Japanese emergency alert: what it means, the alert level and what to do now (JSON body)",
        "description": "Decodes the text of a Japanese emergency alert (phone emergency mail, TV, app, siren announcement; Japanese or English) or an alert id, using official JMA / Cabinet Office / J-ALERT / Ministry of the Environment rules as of 2026-10-17. Covers the Earthquake Early Warning (緊急地震速報 warning / forecast / cancellation), seismic intensity (shindo 0-7), tsunami (大津波警報 Major Tsunami Warning >3 m, 津波警報 1-3 m, 津波注意報 0.2-1 m, forecast), the new level-named weather warnings in force since 2026-05-29 (Level 5 特別警報 Emergency Warning / Level 4 危険警報 Urgent Warning / Level 3 警報 Warning / Level 2 注意報 Advisory for heavy rain 大雨, landslide 土砂災害, flood 氾濫 and storm surge 高潮, plus Level 1 早期注意情報) and the old names they replaced (土砂災害警戒情報 → レベル4土砂災害危険警報, 洪水警報 abolished, 高潮警報 was Level 4), other warnings without a level (暴風, 大雪, 波浪, 雷…), 気象防災速報 (線状降水帯), municipal evacuation levels (緊急安全確保 / 避難指示 / 高齢者等避難), Nankai Trough Earthquake Extra Information (調査中 / 巨大地震警戒 / 巨大地震注意 / 調査終了), the Hokkaido-Sanriku Subsequent Earthquake Advisory, volcanic alert levels and 噴火速報, J-ALERT missile alerts, and heat-stroke alerts. Returns verdict, a one-line headline, urgency, the primary alert (Japanese and official English name, the name in the requested language from the JMA multilingual dictionary, alert level, colour, who issues it, meaning, doNow tailored to the situation, don't, how long, sources), other alerts in the text, modifiers (cancelled, lifted 解除, drill 訓練), extracted level / shindo / tsunami height, renamed old names, notes and official live-data links. No live data: it explains the alert you already have.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "The alert text as received, Japanese or English, e.g. '緊急地震速報 強い揺れに備えてください', 'レベル4土砂災害危険警報', '【警戒レベル4】避難指示', '大津波警報 10m超', 'Missile launch'. Up to 4,000 characters."
                  },
                  "alert": {
                    "type": "string",
                    "description": "Instead of (or with) text: an alert id from /api/rules, e.g. eew-warning, eew-forecast, eew-cancel, l4-landslide, tsunami-advisory, evac-l4, nankai-megaquake-advisory, missile."
                  },
                  "situation": {
                    "type": "string",
                    "description": "Where the person is, to tailor the actions (earthquake, tsunami, missile, rain): indoors, outdoors, driving, train, elevator, crowd, coast, mountain.",
                    "enum": [
                      "indoors",
                      "outdoors",
                      "driving",
                      "train",
                      "elevator",
                      "crowd",
                      "coast",
                      "mountain"
                    ]
                  },
                  "lang": {
                    "type": "string",
                    "description": "Language for nameLocal (official JMA dictionary names): ja, en, zh-CN, zh-TW, ko, pt, es, id, vi, tl, th, ne, km, my, mn. Explanations are in English.",
                    "enum": [
                      "ja",
                      "en",
                      "zh-CN",
                      "zh-TW",
                      "ko",
                      "pt",
                      "es",
                      "id",
                      "vi",
                      "tl",
                      "th",
                      "ne",
                      "km",
                      "my",
                      "mn"
                    ],
                    "default": "en"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result as JSON. Always includes a `disclaimer` field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid input. The body explains what to send and gives an example."
          },
          "429": {
            "description": "Too many requests from one IP. Retry after the Retry-After seconds."
          }
        }
      }
    },
    "/api/rules": {
      "get": {
        "operationId": "japanAlertRules",
        "summary": "Every alert type with level, colour, meaning, actions, official names in 14 languages, old→new names, shindo and tsunami tables, sources",
        "description": "Returns all decodable Japanese alert types (earthquake, tsunami, megaquake advisories, level-named weather warnings since 2026-05-29, other weather warnings, 気象防災速報, evacuation levels, volcano, J-ALERT, heat) with ids, Japanese and English names, official names from the JMA multilingual dictionary, alert level, colour, urgency, issuer, meaning, actions and sources; plus the alert-level table, renamed old names, the shindo scale, tsunami categories, EEW criteria, situations, languages and official live-data links. No inputs.",
        "responses": {
          "200": {
            "description": "Rules JSON with dataAsOf and sources.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    }
  }
}