{
 "openapi": "3.0.3",
 "info": {
  "title": "BasinScope Alps data API",
  "version": "1.4.1",
  "description": "Read-only data on glacier-meltwater retention basin sites in the Jungfrau-Aletsch area. Static JSON, no key, open to browser calls from any origin. Screening-level results from terrain, inventory and index-map evidence only. Natural hazards are read from federal index maps, not assessed on site; geology is not assessed. Not a basis for engineering or investment decisions without a feasibility study."
 },
 "servers": [
  {
   "url": "https://gopalinternship-unibasel.github.io/basinscope-alps/api/v1"
  }
 ],
 "paths": {
  "/sites.json": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "The 15 ranked basin sites: location, basin volume, dam length, glacier area upstream, protection, illustrative investment.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Site"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/sites/{id}.json": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "One site by id (1 to 15, its rank in the terrain analysis report).",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "$ref": "#/components/schemas/Site"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such id"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Site id, 1 to 15"
     }
    ]
   }
  },
  "/sites.geojson": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "The same sites as a GeoJSON FeatureCollection in WGS84, for GIS and web maps.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/geo+json": {
        "schema": {
         "type": "object",
         "description": "GeoJSON FeatureCollection of Point features"
        }
       }
      }
     }
    }
   }
  },
  "/candidates.json": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "The 28 further candidate points that did not make the shortlist, with their protection check.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Candidate"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/catchments.json": {
   "get": {
    "tags": [
     "Meltwater"
    ],
    "summary": "The 9 Hydro-CH2018 catchments the sites are matched to.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Catchment"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/catchments/{id}.json": {
   "get": {
    "tags": [
     "Meltwater"
    ],
    "summary": "One catchment with monthly runoff for RCP2.6, 4.5 and 8.5 in the reference period, 2035, 2060 and 2085 (median, minimum, maximum of the model ensemble).",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "$ref": "#/components/schemas/CatchmentRunoff"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such id"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Hydro-CH2018 catchment id: 3003, 3004, 3124, 3143, 4006, 4020, 4022, 4128, 4134"
     }
    ]
   }
  },
  "/glaciers.json": {
   "get": {
    "tags": [
     "Meltwater"
    ],
    "summary": "The ten largest glaciers of the study area.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Glacier"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/exits.json": {
   "get": {
    "tags": [
     "Meltwater"
    ],
    "summary": "Where meltwater leaves the study area, with the glacier area behind each exit.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Exit"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/elevation-bands.json": {
   "get": {
    "tags": [
     "Meltwater"
    ],
    "summary": "Land and glacier area by 500 m elevation band.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/ElevationBand"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/hydropower-plants.json": {
   "get": {
    "tags": [
     "Energy"
    ],
    "summary": "The 127 hydropower plants of 300 kW or more in the map extent: type, status, turbine power, expected yearly production (SFOE).",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Plant"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/dams.json": {
   "get": {
    "tags": [
     "Energy"
    ],
    "summary": "The 33 dams under federal supervision in the map extent: type, height, crest length, reservoir volume (SFOE).",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Dam"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/reservoir-storage.json": {
   "get": {
    "tags": [
     "Energy"
    ],
    "summary": "Energy held in Swiss reservoirs, latest week and the past year, with the capacity (SFOE).",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "$ref": "#/components/schemas/ReservoirStorage"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/grid.json": {
   "get": {
    "tags": [
     "Energy"
    ],
    "summary": "Swiss grid records: mean production by source, consumption and net import per calendar month, hydropower output per year against precipitation, net import per winter, filling of the storage lakes by week since 2000, and the plants matched to each catchment.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "object",
           "description": "Keys: data_up_to, monthly_mean_gwh, hydropower_by_year, winter_net_import_gwh, storage_lakes_percent_full_by_week, plants_by_catchment.",
           "additionalProperties": true
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/glacier-path.json": {
   "get": {
    "tags": [
     "Meltwater"
    ],
    "summary": "Glacier area by year to 2100 as a share of today's, for RCP2.6, 4.5 and 8.5, from a published glacier model (Alps-wide).",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "object",
           "description": "Keys: what, years, emission_paths (RCP26 | RCP45 | RCP85, each with median, lowest, highest in per cent).",
           "additionalProperties": true
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/risk-hindcast.json": {
   "get": {
    "tags": [
     "Risk"
    ],
    "summary": "What the risk outlook works with, for every day since March 2021: zero-degree level, precipitation, rain at each site, and the documented events the rule is tested against.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "object",
           "description": "Keys: from, to, method, zero_degree_level_m and precipitation_mm (one value per day from the first day), site_rain_mm (per site id: [day index, mm]), events.",
           "additionalProperties": true
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/infrastructure-hazards.json": {
   "get": {
    "tags": [
     "Risk"
    ],
    "summary": "Hazard process areas mapped around the hydropower plants of the stress test and the dams near the ranked sites, with their ground height.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "object",
           "description": "Keys: read, square_m, which, method, items (kind, name, type, size, location, hazard_index_percent).",
           "additionalProperties": true
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/federal-report.json": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "The projects of the 2024 Federal Council report on hydropower from glacier melt that lie in the study area, with the report's figures and the ranked site each one matches.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "object",
           "description": "Keys: report, by, date, url, totals, match, projects_in_study_area.",
           "additionalProperties": true
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/satellite.json": {
   "get": {
    "tags": [
     "Satellite"
    ],
    "summary": "Snow and ice left in the study area at the end of each summer since 2015 (Sentinel-2), the two scenes behind the then/now pictures, and glacier thinning measured from space for 2000 to 2019.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "meta": {
           "$ref": "#/components/schemas/Meta"
          },
          "data": {
           "type": "object",
           "description": "Keys: snow_and_ice_at_end_of_summer, scene_pair, glacier_thinning. Extents in km2, rates in metres per year.",
           "additionalProperties": true
          }
         }
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Meta": {
    "type": "object",
    "properties": {
     "api_version": {
      "type": "string"
     },
     "generated": {
      "type": "string",
      "format": "date"
     },
     "notice": {
      "type": "string"
     },
     "docs": {
      "type": "string"
     },
     "count": {
      "type": "integer"
     }
    }
   },
   "Protection": {
    "type": "object",
    "properties": {
     "level": {
      "type": "string",
      "enum": [
       "none",
       "landscape",
       "strict"
      ]
     },
     "strict": {
      "type": "boolean"
     },
     "areas": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "kind": {
         "type": "string",
         "enum": [
          "floodplain",
          "mire_landscape",
          "fen",
          "bog",
          "hydro_waiver",
          "unesco",
          "bln",
          "game_reserve"
         ]
        },
        "label": {
         "type": "string"
        },
        "level": {
         "type": "string"
        },
        "name": {
         "type": "string"
        }
       }
      }
     }
    }
   },
   "Site": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "report_rank": {
      "type": "integer"
     },
     "name": {
      "type": "string"
     },
     "type": {
      "type": "string",
      "enum": [
       "new",
       "reservoir",
       "lake",
       "settlement"
      ]
     },
     "type_label": {
      "type": "string"
     },
     "valley": {
      "type": "string"
     },
     "location": {
      "type": "object",
      "properties": {
       "easting_lv95": {
        "type": "integer"
       },
       "northing_lv95": {
        "type": "integer"
       },
       "longitude": {
        "type": "number"
       },
       "latitude": {
        "type": "number"
       },
       "elevation_m": {
        "type": "integer"
       }
      }
     },
     "glacier_area_upstream_km2": {
      "type": "number"
     },
     "basin": {
      "type": "object",
      "properties": {
       "volume_10m_dam_mio_m3": {
        "type": "number"
       },
       "volume_20m_dam_mio_m3": {
        "type": "number"
       },
       "lake_area_ha": {
        "type": "number"
       },
       "dam_length_m": {
        "type": "number"
       }
      }
     },
     "illustrative_investment_chf_m": {
      "type": "object",
      "description": "Basin volume scaled in a straight line from the KWO Trift project (CHF 387 m for 85 Mio m3). Order of magnitude only.",
      "properties": {
       "dam_10m": {
        "type": "number"
       },
       "dam_20m": {
        "type": "number"
       }
      }
     },
     "catchment_id": {
      "type": "integer"
     },
     "protection": {
      "$ref": "#/components/schemas/Protection"
     },
     "hazard_index_percent": {
      "type": "object",
      "nullable": true,
      "description": "Share of the square reaching 250 m from the site (500 m across) that the federal index maps mark, in per cent. An indication for the hazard assessment, not a hazard map.",
      "properties": {
       "debris_flow": {
        "type": "number"
       },
       "shallow_landslide": {
        "type": "number"
       },
       "rockfall": {
        "type": "number"
       },
       "permafrost": {
        "type": "number"
       }
      }
     },
     "confidence_note": {
      "type": "string",
      "nullable": true
     },
     "notes": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    }
   },
   "Candidate": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "location": {
      "type": "object",
      "properties": {
       "easting_lv95": {
        "type": "integer"
       },
       "northing_lv95": {
        "type": "integer"
       },
       "longitude": {
        "type": "number"
       },
       "latitude": {
        "type": "number"
       },
       "elevation_m": {
        "type": "integer"
       }
      }
     },
     "protection": {
      "$ref": "#/components/schemas/Protection"
     }
    }
   },
   "Catchment": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "river": {
      "type": "string"
     },
     "gauge_place": {
      "type": "string"
     },
     "area_km2": {
      "type": "number"
     },
     "glacier_cover_percent": {
      "type": "number"
     },
     "site_ids": {
      "type": "array",
      "items": {
       "type": "integer"
      }
     }
    }
   },
   "CatchmentRunoff": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Catchment"
     },
     {
      "type": "object",
      "properties": {
       "runoff_unit": {
        "type": "string"
       },
       "runoff": {
        "type": "object",
        "description": "Keys: RCP26 | RCP45 | RCP85, then ref | 2035 | 2060 | 2085, then med | min | max, then jan to dec.",
        "additionalProperties": true
       }
      }
     }
    ]
   },
   "Glacier": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "area_km2": {
      "type": "number"
     },
     "length_km": {
      "type": "number"
     },
     "lowest_m": {
      "type": "integer"
     },
     "highest_m": {
      "type": "integer"
     }
    }
   },
   "Exit": {
    "type": "object",
    "properties": {
     "path": {
      "type": "string"
     },
     "glacier_area_km2": {
      "type": "number"
     },
     "description": {
      "type": "string"
     },
     "warning": {
      "type": "string"
     }
    }
   },
   "ElevationBand": {
    "type": "object",
    "properties": {
     "band_from_m": {
      "type": "integer"
     },
     "area_km2": {
      "type": "number"
     },
     "glacier_area_km2": {
      "type": "number"
     }
    }
   },
   "Plant": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "place": {
      "type": "string"
     },
     "type": {
      "type": "string"
     },
     "status": {
      "type": "string"
     },
     "turbine_power_mw": {
      "type": "number"
     },
     "expected_production_gwh_per_year": {
      "type": "number"
     },
     "in_operation_since": {
      "type": "integer"
     },
     "location": {
      "type": "object",
      "properties": {
       "easting_lv95": {
        "type": "integer"
       },
       "northing_lv95": {
        "type": "integer"
       },
       "longitude": {
        "type": "number"
       },
       "latitude": {
        "type": "number"
       },
       "elevation_m": {
        "type": "integer"
       }
      }
     }
    }
   },
   "Dam": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "reservoir": {
      "type": "string"
     },
     "type": {
      "type": "string"
     },
     "height_m": {
      "type": "number"
     },
     "crest_length_m": {
      "type": "number"
     },
     "reservoir_volume_mio_m3": {
      "type": "number"
     },
     "built": {
      "type": "integer"
     },
     "purpose": {
      "type": "string"
     },
     "location": {
      "type": "object",
      "properties": {
       "easting_lv95": {
        "type": "integer"
       },
       "northing_lv95": {
        "type": "integer"
       },
       "longitude": {
        "type": "number"
       },
       "latitude": {
        "type": "number"
       },
       "elevation_m": {
        "type": "integer"
       }
      }
     }
    }
   },
   "ReservoirStorage": {
    "type": "object",
    "properties": {
     "date": {
      "type": "string",
      "format": "date"
     },
     "energy_gwh": {
      "type": "number"
     },
     "capacity_gwh": {
      "type": "number"
     },
     "area": {
      "type": "string"
     },
     "past_year": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "date": {
         "type": "string",
         "format": "date"
        },
        "energy_gwh": {
         "type": "number"
        }
       }
      }
     }
    }
   }
  }
 }
}