{
 "openapi": "3.1.0",
 "info": {
  "title": "シルギア 自動車の税API",
  "version": "1.0.0",
  "description": "登録不要・無料の自動車の税API。自動車税（乗用車の自家用・営業用・2019年9月以前に登録した車の旧税率）・軽自動車税（三輪・四輪・バイク・原付・小型特殊）・自動車重量税（乗用車・軽自動車・二輪。2026年5月1日からの表）の標準の額と、重課・軽課（グリーン化特例）・旧税率・月割の決まりを返します。地方税法と国土交通省の税額表と照らし合わせて作成し、照合した日を data_version で返します。説明: https://api.shirugear.com/cartax/ 。v1 の中では項目や区分を足すことはあっても、名前や意味は変えません（知らない項目は無視してください）。",
  "termsOfService": "https://api.shirugear.com/terms/",
  "contact": {
   "name": "アナライズギア株式会社（シルギア）",
   "url": "https://shirugear.com/contact"
  }
 },
 "servers": [
  {
   "url": "https://api.shirugear.com"
  }
 ],
 "paths": {
  "/cartax/v1/auto.json": {
   "get": {
    "summary": "自動車税（乗用車）の表と、重課・軽課・旧税率・月割の決まり",
    "operationId": "getAuto",
    "responses": {
     "200": {
      "description": "自動車税",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Auto"
          },
          {
           "type": "object",
           "properties": {
            "fuels": {
             "$ref": "#/components/schemas/Fuels"
            }
           },
           "required": [
            "fuels"
           ]
          },
          {
           "$ref": "#/components/schemas/Version"
          }
         ]
        }
       }
      }
     },
     "403": {
      "description": "日本国内以外から",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "無いファイル",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "GET/HEAD以外",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/cartax/v1/kei.json": {
   "get": {
    "summary": "軽自動車税の表と、重課・軽課・旧税率の決まり",
    "operationId": "getKei",
    "responses": {
     "200": {
      "description": "軽自動車税",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Kei"
          },
          {
           "type": "object",
           "properties": {
            "fuels": {
             "$ref": "#/components/schemas/Fuels"
            }
           },
           "required": [
            "fuels"
           ]
          },
          {
           "$ref": "#/components/schemas/Version"
          }
         ]
        }
       }
      }
     },
     "403": {
      "description": "日本国内以外から",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "無いファイル",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "GET/HEAD以外",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/cartax/v1/weight.json": {
   "get": {
    "summary": "自動車重量税（乗用車・軽自動車・二輪）の1年あたりの額と経過年数の決まり",
    "operationId": "getWeight",
    "responses": {
     "200": {
      "description": "自動車重量税",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Weight"
          },
          {
           "$ref": "#/components/schemas/Version"
          }
         ]
        }
       }
      }
     },
     "403": {
      "description": "日本国内以外から",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "無いファイル",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "GET/HEAD以外",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/cartax/v1/rates.json": {
   "get": {
    "summary": "全部（自動車税・軽自動車税・重量税・燃料・廃止された税）",
    "operationId": "getRates",
    "responses": {
     "200": {
      "description": "全部",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "type": "object",
           "properties": {
            "auto": {
             "$ref": "#/components/schemas/Auto"
            },
            "kei": {
             "$ref": "#/components/schemas/Kei"
            },
            "weight": {
             "$ref": "#/components/schemas/Weight"
            },
            "fuels": {
             "$ref": "#/components/schemas/Fuels"
            },
            "abolished": {
             "$ref": "#/components/schemas/Abolished"
            }
           },
           "required": [
            "auto",
            "kei",
            "weight",
            "fuels",
            "abolished"
           ]
          },
          {
           "$ref": "#/components/schemas/Version"
          }
         ]
        }
       }
      }
     },
     "403": {
      "description": "日本国内以外から",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "無いファイル",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "GET/HEAD以外",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/cartax/v1/meta.json": {
   "get": {
    "summary": "データの版・ファイルの一覧・出典",
    "operationId": "getMeta",
    "responses": {
     "200": {
      "description": "版",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Meta"
        }
       }
      }
     },
     "403": {
      "description": "日本国内以外から",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "無いファイル",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "GET/HEAD以外",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Auto": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "former_name": {
      "type": "string"
     },
     "levied_by": {
      "type": "string"
     },
     "basis": {
      "type": "string"
     },
     "assessment_date": {
      "type": "string"
     },
     "passenger": {
      "type": "object",
      "properties": {
       "bands": {
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "over_cc": {
           "anyOf": [
            {
             "type": "null"
            },
            {
             "type": "integer"
            }
           ]
          },
          "upto_cc": {
           "anyOf": [
            {
             "type": "integer"
            },
            {
             "type": "null"
            }
           ]
          }
         },
         "required": [
          "over_cc",
          "upto_cc"
         ]
        }
       },
       "private": {
        "type": "array",
        "items": {
         "type": "integer"
        }
       },
       "private_before_2019_10": {
        "type": "array",
        "items": {
         "type": "integer"
        }
       },
       "business": {
        "type": "array",
        "items": {
         "type": "integer"
        }
       },
       "heavy": {
        "type": "object",
        "properties": {
         "private_before_2019_10": {
          "type": "array",
          "items": {
           "type": "integer"
          }
         },
         "business": {
          "type": "array",
          "items": {
           "type": "integer"
          }
         }
        },
        "required": [
         "private_before_2019_10",
         "business"
        ]
       },
       "green": {
        "type": "object",
        "properties": {
         "private": {
          "type": "array",
          "items": {
           "type": "integer"
          }
         },
         "business": {
          "type": "array",
          "items": {
           "type": "integer"
          }
         }
        },
        "required": [
         "private",
         "business"
        ]
       }
      },
      "required": [
       "bands",
       "private",
       "private_before_2019_10",
       "business",
       "heavy",
       "green"
      ]
     },
     "new_rate_from": {
      "type": "string"
     },
     "no_displacement": {
      "type": "string"
     },
     "heavy_rule": {
      "type": "object",
      "properties": {
       "approx_percent": {
        "type": "integer"
       },
       "groups": {
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "fuels": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "registered_until": {
           "type": "string"
          },
          "years": {
           "type": "integer"
          }
         },
         "required": [
          "fuels",
          "registered_until",
          "years"
         ]
        }
       },
       "excluded_fuels": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "excluded_private_from": {
        "type": "string"
       },
       "rule": {
        "type": "string"
       }
      },
      "required": [
       "approx_percent",
       "groups",
       "excluded_fuels",
       "excluded_private_from",
       "rule"
      ]
     },
     "green_rule": {
      "type": "object",
      "properties": {
       "approx_percent": {
        "type": "integer"
       },
       "fuels": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "registered_from": {
        "type": "string"
       },
       "registered_until": {
        "type": "string"
       },
       "rule": {
        "type": "string"
       },
       "note": {
        "type": "string"
       }
      },
      "required": [
       "approx_percent",
       "fuels",
       "registered_from",
       "registered_until",
       "rule",
       "note"
      ]
     },
     "monthly": {
      "type": "object",
      "properties": {
       "rule": {
        "type": "string"
       },
       "formula": {
        "type": "string"
       },
       "basis": {
        "type": "string"
       }
      },
      "required": [
       "rule",
       "formula",
       "basis"
      ]
     },
     "note": {
      "type": "string"
     }
    },
    "required": [
     "name",
     "former_name",
     "levied_by",
     "basis",
     "assessment_date",
     "passenger",
     "new_rate_from",
     "no_displacement",
     "heavy_rule",
     "green_rule",
     "monthly",
     "note"
    ],
    "description": "自動車税（都道府県税）。passenger の額の配列は bands と同じ順。"
   },
   "Kei": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "former_name": {
      "type": "string"
     },
     "levied_by": {
      "type": "string"
     },
     "basis": {
      "type": "string"
     },
     "assessment_date": {
      "type": "string"
     },
     "kinds": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "key": {
         "type": "string"
        },
        "label": {
         "type": "string"
        },
        "before_2015_04": {
         "type": "integer"
        },
        "standard": {
         "type": "integer"
        },
        "heavy": {
         "type": "integer"
        },
        "green": {
         "type": "integer"
        }
       },
       "required": [
        "key",
        "label",
        "before_2015_04",
        "standard",
        "heavy",
        "green"
       ]
      }
     },
     "old_rate_until": {
      "type": "string"
     },
     "old_rate_rule": {
      "type": "string"
     },
     "heavy_rule": {
      "type": "object",
      "properties": {
       "years": {
        "type": "integer"
       },
       "excluded_fuels": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "rule": {
        "type": "string"
       }
      },
      "required": [
       "years",
       "excluded_fuels",
       "rule"
      ]
     },
     "green_rule": {
      "type": "object",
      "properties": {
       "fuels": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "registered_from": {
        "type": "string"
       },
       "registered_until": {
        "type": "string"
       },
       "rule": {
        "type": "string"
       },
       "note": {
        "type": "string"
       }
      },
      "required": [
       "fuels",
       "registered_from",
       "registered_until",
       "rule",
       "note"
      ]
     },
     "others": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "key": {
         "type": "string"
        },
        "label": {
         "type": "string"
        },
        "tax": {
         "type": "integer"
        },
        "basis": {
         "type": "string"
        },
        "from": {
         "type": "string"
        }
       },
       "required": [
        "key",
        "label",
        "tax",
        "basis"
       ]
      }
     },
     "others_note": {
      "type": "string"
     },
     "max_multiplier": {
      "type": "number"
     },
     "note": {
      "type": "string"
     }
    },
    "required": [
     "name",
     "former_name",
     "levied_by",
     "basis",
     "assessment_date",
     "kinds",
     "old_rate_until",
     "old_rate_rule",
     "heavy_rule",
     "green_rule",
     "others",
     "others_note",
     "max_multiplier",
     "note"
    ],
    "description": "軽自動車税（市区町村税）。"
   },
   "Weight": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "levied_by": {
      "type": "string"
     },
     "basis": {
      "type": "string"
     },
     "table_from": {
      "type": "string"
     },
     "when": {
      "type": "string"
     },
     "classes": {
      "type": "object",
      "properties": {
       "eco": {
        "type": "string"
       },
       "standard": {
        "type": "string"
       },
       "over13": {
        "type": "string"
       },
       "over18": {
        "type": "string"
       }
      },
      "required": [
       "eco",
       "standard",
       "over13",
       "over18"
      ]
     },
     "passenger": {
      "type": "object",
      "properties": {
       "unit_kg": {
        "type": "integer"
       },
       "rule": {
        "type": "string"
       },
       "private": {
        "type": "object",
        "properties": {
         "eco": {
          "type": "integer"
         },
         "standard": {
          "type": "integer"
         },
         "over13": {
          "type": "integer"
         },
         "over18": {
          "type": "integer"
         }
        },
        "required": [
         "eco",
         "standard",
         "over13",
         "over18"
        ]
       },
       "business": {
        "type": "object",
        "properties": {
         "eco": {
          "type": "integer"
         },
         "standard": {
          "type": "integer"
         },
         "over13": {
          "type": "integer"
         },
         "over18": {
          "type": "integer"
         }
        },
        "required": [
         "eco",
         "standard",
         "over13",
         "over18"
        ]
       },
       "periods": {
        "type": "object",
        "properties": {
         "new_private": {
          "type": "integer"
         },
         "renewal_private": {
          "type": "integer"
         },
         "business": {
          "type": "integer"
         }
        },
        "required": [
         "new_private",
         "renewal_private",
         "business"
        ]
       }
      },
      "required": [
       "unit_kg",
       "rule",
       "private",
       "business",
       "periods"
      ]
     },
     "kei": {
      "type": "object",
      "properties": {
       "rule": {
        "type": "string"
       },
       "private": {
        "type": "object",
        "properties": {
         "eco": {
          "type": "integer"
         },
         "standard": {
          "type": "integer"
         },
         "over13": {
          "type": "integer"
         },
         "over18": {
          "type": "integer"
         }
        },
        "required": [
         "eco",
         "standard",
         "over13",
         "over18"
        ]
       },
       "business": {
        "type": "object",
        "properties": {
         "eco": {
          "type": "integer"
         },
         "standard": {
          "type": "integer"
         },
         "over13": {
          "type": "integer"
         },
         "over18": {
          "type": "integer"
         }
        },
        "required": [
         "eco",
         "standard",
         "over13",
         "over18"
        ]
       },
       "periods": {
        "type": "object",
        "properties": {
         "new_private": {
          "type": "integer"
         },
         "renewal": {
          "type": "integer"
         }
        },
        "required": [
         "new_private",
         "renewal"
        ]
       }
      },
      "required": [
       "rule",
       "private",
       "business",
       "periods"
      ]
     },
     "small_motorcycle": {
      "type": "object",
      "properties": {
       "label": {
        "type": "string"
       },
       "private": {
        "type": "object",
        "properties": {
         "standard": {
          "type": "integer"
         },
         "over13": {
          "type": "integer"
         },
         "over18": {
          "type": "integer"
         }
        },
        "required": [
         "standard",
         "over13",
         "over18"
        ]
       },
       "business": {
        "type": "object",
        "properties": {
         "standard": {
          "type": "integer"
         },
         "over13": {
          "type": "integer"
         },
         "over18": {
          "type": "integer"
         }
        },
        "required": [
         "standard",
         "over13",
         "over18"
        ]
       },
       "periods": {
        "type": "object",
        "properties": {
         "new_private": {
          "type": "integer"
         },
         "renewal": {
          "type": "integer"
         }
        },
        "required": [
         "new_private",
         "renewal"
        ]
       },
       "note": {
        "type": "string"
       }
      },
      "required": [
       "label",
       "private",
       "business",
       "periods",
       "note"
      ]
     },
     "light_motorcycle": {
      "type": "object",
      "properties": {
       "label": {
        "type": "string"
       },
       "once": {
        "type": "object",
        "properties": {
         "private": {
          "type": "integer"
         },
         "business": {
          "type": "integer"
         }
        },
        "required": [
         "private",
         "business"
        ]
       },
       "note": {
        "type": "string"
       }
      },
      "required": [
       "label",
       "once",
       "note"
      ]
     },
     "elapsed_rule": {
      "type": "object",
      "properties": {
       "registered": {
        "type": "string"
       },
       "kei": {
        "type": "string"
       }
      },
      "required": [
       "registered",
       "kei"
      ]
     },
     "eco_car_reduction": {
      "type": "object",
      "properties": {
       "from": {
        "type": "string"
       },
       "until": {
        "type": "string"
       },
       "rule": {
        "type": "string"
       },
       "note": {
        "type": "string"
       }
      },
      "required": [
       "from",
       "until",
       "rule",
       "note"
      ]
     }
    },
    "required": [
     "name",
     "levied_by",
     "basis",
     "table_from",
     "when",
     "classes",
     "passenger",
     "kei",
     "small_motorcycle",
     "light_motorcycle",
     "elapsed_rule",
     "eco_car_reduction"
    ],
    "description": "自動車重量税（国税）。額は1年あたり。乗用車は unit_kg ごと。"
   },
   "Fuels": {
    "type": "object",
    "properties": {
     "gasoline": {
      "type": "string"
     },
     "lpg": {
      "type": "string"
     },
     "diesel": {
      "type": "string"
     },
     "hybrid": {
      "type": "string"
     },
     "phev": {
      "type": "string"
     },
     "ev": {
      "type": "string"
     },
     "cng": {
      "type": "string"
     },
     "methanol": {
      "type": "string"
     },
     "other": {
      "type": "string"
     }
    },
    "required": [
     "gasoline",
     "lpg",
     "diesel",
     "hybrid",
     "phev",
     "ev",
     "cng",
     "methanol",
     "other"
    ]
   },
   "Abolished": {
    "type": "array",
    "items": {
     "type": "object",
     "properties": {
      "name": {
       "type": "string"
      },
      "until": {
       "type": "string"
      },
      "note": {
       "type": "string"
      }
     },
     "required": [
      "name",
      "until",
      "note"
     ]
    }
   },
   "Meta": {
    "type": "object",
    "properties": {
     "data_version": {
      "type": "string"
     },
     "checked_at": {
      "type": "string"
     },
     "files": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "scope": {
      "type": "string"
     },
     "abolished": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "name": {
         "type": "string"
        },
        "until": {
         "type": "string"
        },
        "note": {
         "type": "string"
        }
       },
       "required": [
        "name",
        "until",
        "note"
       ]
      }
     },
     "sources": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "label": {
         "type": "string"
        },
        "url": {
         "type": "string"
        }
       },
       "required": [
        "label",
        "url"
       ]
      }
     }
    },
    "required": [
     "data_version",
     "checked_at",
     "files",
     "scope",
     "abolished",
     "sources"
    ]
   },
   "Version": {
    "type": "object",
    "properties": {
     "currency": {
      "const": "JPY"
     },
     "data_version": {
      "type": "string",
      "format": "date"
     }
    },
    "required": [
     "currency",
     "data_version"
    ]
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "status": {
        "type": "integer"
       },
       "code": {
        "type": "string",
        "enum": [
         "invalid_request",
         "not_found",
         "region_not_allowed",
         "method_not_allowed"
        ]
       },
       "message": {
        "type": "string"
       }
      },
      "required": [
       "status",
       "code",
       "message"
      ]
     }
    },
    "required": [
     "error"
    ]
   }
  }
 }
}
