﻿{
  "openapi": "3.0.0",
  "info": {
    "title": "climate-data/v1",
    "description": "This REST API at https://stadtklimaanalyse-mannheim.de/wp-json/climate-data/v1/ delivers climate data from climate measuring stations in the city of Mannheim, Germany. All measure dates are given in UTC time. Any use is granted under the terms of the license ´Datenlizenz Deutschland – Namensnennung – Version 2.0´.",
    "version": "1",
    "license": {
      "name": "Datenlizenz Deutschland – Namensnennung – Version 2.0",
      "url": "https://www.govdata.de/dl-de/by-2-0"
    }
  },
  "servers": [
    {
      "url": "https://stadtklimaanalyse-mannheim.de/wp-json/climate-data/v1"
    }
  ],
  "paths": {
    "/current": {
      "get": {
        "description": "Get the latest climate data of all available stations.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/current/{id}": {
      "get": {
        "description": "Get current climate data of one specific station.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The specififc station ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/historic/{id}/{startdate}/{enddate}": {
      "get": {
        "description": "Get historic climate data of one specific station between a startdate and an enddate, both formatted YYYY-MM-DD.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The specififc station ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startdate",
            "in": "path",
            "description": "The startdate of data queried, formatted YYYY-MM-DD.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "enddate",
            "in": "path",
            "description": "The enddate of data queried, formatted YYYY-MM-DD.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/station": {
      "get": {
        "description": "Get details of all available climate stations.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/station/{id}": {
      "get": {
        "description": "Get details of one specific climate station.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The specififc station ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/parameters": {
      "get": {
        "description": "Get list of available climate parameters, stations and averages.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    }
  },
  "security": []
}