Héichwaasser API

Publié le 22 décembre 2017

Voir la réutilisation

heichwaasser.lu

heichwaasser.lu provides iOS and Android Apps and an API for current and past water levels in Luxembourg.

2 réutilisations

  • heichwaasser
  • hydrographie
  • inondations
  • water-levels

Informations

Type
API
Thématique
Autres
ID
5a3d1c42cc765e59af4a3b67

Publication

Intégrer sur votre site

URL stable

Description

This uses the Measured water levels and creates a JSON API.

Source code available on Github.

Documentation

Important notice: The time is given in Western European Time all year, the European Summer Time is not considered. You may have to adapt the time to your needs.

Root

https://heichwaasser.lu/api/v1

Endpoints

Rivers

[
    {
        "id": 17,
        "name": "Alzette",
        "stations": [
            {
                "id": 61,
                "city": "Ettelbr\u00fcck",
                "latitude": 49.84373,
                "longitude": 6.09713,
                "trend": "rest",
                "current": {
                    "timestamp": "2017-12-27T16:45:00",
                    "value": 69.8,
                    "unit": "cm"
                },
                "minimum": {
                    "timestamp": "2017-12-27T15:30:00",
                    "value": 65.5,
                    "unit": "cm"
                },
                "maximum": {
                    "timestamp": "2017-12-27T16:45:00",
                    "value": 69.8,
                    "unit": "cm"
                },
                "alert_levels": [
                    {
                        "name": "Level 1",
                        "value": 180,
                        "unit": "cm"
                    },
                    {
                        "name": "Level 2",
                        "value": 230,
                        "unit": "cm"
                    }
                ]
            },...
        ]
    }
]
[
    {
        "id": 17,
        "name": "Alzette",
        "stations": [
            {
                "id": 61,
                "city": "Ettelbr\u00fcck",
                "latitude": 49.84373,
                "longitude": 6.09713,
                "trend": "rest",
                "current": {
                    "timestamp": "2017-12-27T16:45:00",
                    "value": 69.8,
                    "unit": "cm"
                },
                "minimum": {
                    "timestamp": "2017-12-27T15:30:00",
                    "value": 65.5,
                    "unit": "cm"
                },
                "maximum": {
                    "timestamp": "2017-12-27T16:45:00",
                    "value": 69.8,
                    "unit": "cm"
                },
                "alert_levels": [
                    {
                        "name": "Level 1",
                        "value": 180,
                        "unit": "cm"
                    },
                    {
                        "name": "Level 2",
                        "value": 230,
                        "unit": "cm"
                    }
                ]
            },...
        ]
    }
]

Stations

  • GET /stations
    [
      {
          "id": 81,
          "river": {
              "id": 3,
              "name": "S\u00fbre"
          },
          "city": "Bigonville",
          "latitude": 49.86875,
          "longitude": 5.79996,
          "trend": "rest",
          "current": {
              "timestamp": "2017-12-27T16:45:00",
              "value": 108.2,
              "unit": "cm"
          },
          "minimum": {
              "timestamp": "2017-12-27T16:45:00",
              "value": 108.2,
              "unit": "cm"
          },
          "maximum": {
              "timestamp": "2017-12-27T16:45:00",
              "value": 108.2,
              "unit": "cm"
          },
          "alert_levels": [
              {
                  "name": "Level 1",
                  "value": 250,
                  "unit": "cm"
              },
              {
                  "name": "Level 2",
                  "value": 300,
                  "unit": "cm"
              }
          ]
      },...
    ]
    
  • GET /stations/:id

The measurements are displayed in a descending order.

{
    "id": 81,
    "river": {
        "id": 3,
        "name": "S\u00fbre"
    },
    "city": "Bigonville",
    "latitude": 49.86875,
    "longitude": 5.79996,
    "trend": "rest",
    "current": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "minimum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "maximum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "measurements": [
        {
            "timestamp": "2017-12-27T16:45:00",
            "value": 108.2,
            "unit": "cm"
        },..
    ],
    "alert_levels": [
        {
            "name": "Level 1",
            "value": 250,
            "unit": "cm"
        },
        {
            "name": "Level 2",
            "value": 300,
            "unit": "cm"
        }
    ]
}

The measurements are displayed in an ascending order.

{
    "id": 81,
    "river": {
        "id": 3,
        "name": "S\u00fbre"
    },
    "city": "Bigonville",
    "latitude": 49.86875,
    "longitude": 5.79996,
    "trend": "rest",
    "current": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "minimum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "maximum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "measurements": [
        {
            "timestamp": "2017-12-27T16:45:00",
            "value": 108.2,
            "unit": "cm"
        },..
    ],
    "alert_levels": [
        {
            "name": "Level 1",
            "value": 250,
            "unit": "cm"
        },
        {
            "name": "Level 2",
            "value": 300,
            "unit": "cm"
        }
    ]
}

The measurements are displayed in a descending order and limited to :count items.

{
    "id": 81,
    "river": {
        "id": 3,
        "name": "S\u00fbre"
    },
    "city": "Bigonville",
    "latitude": 49.86875,
    "longitude": 5.79996,
    "trend": "rest",
    "current": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "minimum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "maximum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "measurements": [
        {
            "timestamp": "2017-12-27T16:45:00",
            "value": 108.2,
            "unit": "cm"
        },..
    ],
    "alert_levels": [
        {
            "name": "Level 1",
            "value": 250,
            "unit": "cm"
        },
        {
            "name": "Level 2",
            "value": 300,
            "unit": "cm"
        }
    ]
}

The measurements are displayed in an ascending order and limited to :count items.

{
    "id": 81,
    "river": {
        "id": 3,
        "name": "S\u00fbre"
    },
    "city": "Bigonville",
    "latitude": 49.86875,
    "longitude": 5.79996,
    "trend": "rest",
    "current": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "minimum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "maximum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "measurements": [
        {
            "timestamp": "2017-12-27T16:45:00",
            "value": 108.2,
            "unit": "cm"
        },..
    ],
    "alert_levels": [
        {
            "name": "Level 1",
            "value": 250,
            "unit": "cm"
        },
        {
            "name": "Level 2",
            "value": 300,
            "unit": "cm"
        }
    ]
}

The returned measurements are strictly greater than the start timestamp and strictly smaller than the end timestamp.

The measurements are displayed in a descending order.

:timestamp must be provided as UNIX timestamp in seconds since Jan 01 1970.

{
    "id": 81,
    "river": {
        "id": 3,
        "name": "S\u00fbre"
    },
    "city": "Bigonville",
    "latitude": 49.86875,
    "longitude": 5.79996,
    "trend": "rest",
    "current": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "minimum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "maximum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "measurements": [
        {
            "timestamp": "2017-12-20T00:15:00",
            "value": 133.6,
            "unit": "cm"
        },..
    ],
    "alert_levels": [
        {
            "name": "Level 1",
            "value": 250,
            "unit": "cm"
        },
        {
            "name": "Level 2",
            "value": 300,
            "unit": "cm"
        }
    ]
}

The returned measurements are strictly greater than the start timestamp and strictly smaller than the end timestamp.

The measurements are displayed in an ascending order.

:timestamp must be provided as UNIX timestamp in seconds since Jan 01 1970.

{
    "id": 81,
    "river": {
        "id": 3,
        "name": "S\u00fbre"
    },
    "city": "Bigonville",
    "latitude": 49.86875,
    "longitude": 5.79996,
    "trend": "rest",
    "current": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "minimum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "maximum": {
        "timestamp": "2017-12-27T16:45:00",
        "value": 108.2,
        "unit": "cm"
    },
    "measurements": [
        {
            "timestamp": "2017-12-20T00:15:00",
            "value": 133.6,
            "unit": "cm"
        },..
    ],
    "alert_levels": [
        {
            "name": "Level 1",
            "value": 250,
            "unit": "cm"
        },
        {
            "name": "Level 2",
            "value": 300,
            "unit": "cm"
        }
    ]
}
Explanation of "trend" field

On import the new water level is compared to the previous one, and the trend field is updated.

  • down new level < previous level
  • rest new level = previous level
  • up new level > previous level

Jeux de données utilisés 1

Discussion entre l'organisation et la communauté à propos de cette réutilisation.

Plus de réutilisations

Découvrez davantage de réutilisations.