# Package 'hubeau'

March 4, 2024

**Type** Package

**Title** Get Data from the French National Database on Water 'Hub'Eau'

**Version** 0.5.0

**Date** 2024-03-04

**Description** Collection of functions to help retrieving data from 'Hub'Eau' the free and public French National APIs on water <https://hubeau.eaufrance.fr/>.

**License** MIT + file LICENSE

**URL** https://inrae.github.io/hubeau/, https://github.com/inrae/hubeau#readme

**BugReports** https://github.com/inrae/hubeau/issues

**Depends** R (>= 3.5.0)

**Imports** dplyr, htrr, magrittr, purrr, tibble, urllib, tools, utils

**Suggests** ggplot2, Hmisc, knitr, leafpop, lubridate, mapview, rmarkedown, sf, spelling, testthat (>= 3.0.0), tools

**VignetteBuilder** knitr

**Config/testthat/edition** 3

**Encoding** UTF-8

**Language** en-US

**RoxygenNote** 7.3.1

**NeedsCompilation** no

**Author** David Dorchies [aut, cre] (<https://orcid.org/0000-0002-6595-7984>), Pascal Irz [ctb] (<https://orcid.org/0000-0002-2066-8935>), Sébastien Grall [ctb], Philippe Amiotte Suchet [ctb] (<https://orcid.org/0000-0003-3514-1447>)

**Maintainer** David Dorchies <david.dorchies@inrae.fr>

**Repository** CRAN

**Date/Publication** 2024-03-04 13:50:02 UTC
## R topics documented:

<table><tr><td>convert_list_to_tibble</td><td>2</td></tr><tr><td>doApiQuery</td><td>3</td></tr><tr><td>get_ecoulement_stations</td><td>4</td></tr><tr><td>get_hydrobio_stations_hydrobio</td><td>6</td></tr><tr><td>get_hydrometrieobs_elab</td><td>7</td></tr><tr><td>get_indicateurs_services_communes</td><td>8</td></tr><tr><td>get_niveaux_nappes_stations</td><td>10</td></tr><tr><td>get_poisson_observations</td><td>11</td></tr><tr><td>get_prelevements_points_prelevement</td><td>12</td></tr><tr><td>get.qualite_eau_potable_communes_udi</td><td>14</td></tr><tr><td>get.qualite_nappes_analyses</td><td>15</td></tr><tr><td>get.qualite_rivieres_analyse</td><td>16</td></tr><tr><td>getTemperature_stations</td><td>19</td></tr><tr><td>hubeau</td><td>20</td></tr><tr><td>list_apis</td><td>22</td></tr></table>

## Index 23

convert_list_to_tibble

Convert list provided by the APIs into a tibble

### Description

Convert list provided by the APIs into a tibble

### Usage

convert_list_to_tibble(1)

### Arguments

1 a list provided by the API (See doApiQuery)

### Details

This function is used internally by all the retrieving data functions for converting data after the call to doApiQuery.

### Value

A tibble::tibble with one row by record and one column by field.
## Examples

```python
# To get the available APIs in the package
list_apis()
```

```python
# To get the available endpoints in an API
list_endpoints("prelevements")
```

```python
# To get available parameters in endpoint "chroniques" of the API "prelevements"
list_params api = "prelevements", endpoint = "chroniques")
```

```python
# To query the endpoint "chroniques" of the API "prelevements"
# on all devices in the commune of Romilly-sur-Seine in 2018
## Not run:
resp <- doApiQuery api = "prelevements",
  endpoint = "chroniques",
  code_commune_insee = "10323",
  annee = "2018")
convert_list_to_tibble resp
```

```python
## End(Not run)
```

```
doApiQuery
```

```
Main internal functions for querying the Hub'Eau API endpoints
```

## Description

The function `doQueryApi` is called by all the function querying the API endpoints and return the raw data sent by the endpoint.

## Usage

```
doApiQuery api, endpoint, ..., params)
```

## Arguments

api: a character name of the API (e.g.: "indicateurs_services", "prelevements"...), see example for available APIs

endpoint: a character name of the endpoint, see example for available endpoints in an API

...: parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name use the function list_params for a list of the available filter parameters for a given API endpoint and see the API documentation for their description

params: (deprecated) a list the list of parameters of the queries and their values in the format list(ParamName = "Param value", ...). This parameter is replaced by the parameter ...
## Details

Pagination of the queries is handled automatically and the returned list is the concatenation of all the results sent by the API.

The functions `get_[api]_[endpoint]` call the function `doQueryApi` and parse the response in a `tibble::tibble` format for the user (See `convert_list_to_tibble`).

By default the user agent used for the query is `"https://github.com/inrae/hubeau"`. You can redefine the user agent with the global option `"hubeau.user_agent": options(hubeau.user_agent = "My user agent")`.

## Value

A list with the concatenated results returned by the API.

## Examples

```r
# To get the available APIs in the package
list_apis()

# To get the available endpoints in an API
list_endpoints("prelevements")

# To get available parameters in endpoint "chroniques" of the API "prelevements"
list_params/api = "prelevements", endpoint = "chroniques")

# To query the endpoint "chroniques" of the API "prelevements"
# on all devices in the commune of Romilly-sur-Seine in 2018
## Not run:
resp <- doApiQuery/api = "prelevements",
 endpoint = "chroniques",
 code_commune_insee = "10323",
 annee = "2018")

convert_list_to_tibble resp)

## End(Not run)
```

get_ecoulement_stations

Retrieve data from API "Ecoulement des cours d'eau"

## Description

The data originate from the "ONDE" river low waters monitoring network. Available endpoints are:

* `get_ecoulement_stations` retrieves site data and locations

* `get_ecoulement_observations` retrieves flow information

* `get_ecoulement_campagnes` retrieves annual surveys

See the API documentation for available filter parameters: https://hubeau.eaufrance.fr/page/api-ecoulement
## Usage

`get_ecoulement_stations(...)`

`get_ecoulement_observations(...)`

`get_ecoulement_campagnes(...)`

## Arguments

... parameters of the queries and their values in the format `Param1_Name = "Param1 value", Param2_Name use the function `list_params` for a list of the available filter parameters for a given API endpoint and see the API documentation for their description

## Value

A `tibble::tibble` with one row by record and one column by field.

## Examples

```r
## Not run:
# Retrieve 2022 observation campaigns in the Jura French department
get_ecoulement_campagnes(
  list(code Departement = "39",
       date Campagne_min = "2022-01-01",
       date Campagne_max = "2022-12-31")
)
```

```r
# Retrieve river stations
stations_39 <- get_ecoulement_stations(
  list(code Departement = "39",
       fields = "code station, libelle cours eau, libelle commune")
)
stations_39
```

```r
# Get the query parameters for the requested API/endpoint
list_params(API = "ecoulement",
          endpoint = "observations")
```

```r
# Retrieve the river flow data in the Jura departement in 2022 with
# a selection of the fields
onde_39 <- get_ecoulement_observations(
  list(code Departement = "39",
       date Observation_min = "2022-01-01",
       date Observation_max = "2022-12-31",
       fields = "code station, libelle station, date observation, libelle ecoulement")
)
onde_39
```

```r
## End(Not run)
```
get_hydrobio_stations_hydrobio

Retrieve data from API "Hydrobiologie"

## Description

The data originate from the "NAIADES" database. Available endpoints are:

* get_hydrobio_stations_hydrobio retrieves site data and locations

* get_hydrobio_indexes retrieves bioassessment indices values

* get_hydrobio_taxons retrieves taxa data

See the API documentation for available filter parameters: https://hubeau.eaufrance.fr/page/api-hydrobiologie

## Usage

get_hydrobio_stations_hydrobio(...)

get_hydrobio_indexes(...)

get_hydrobio_taxons(...)

## Arguments

... parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name use the function list_params for a list of the available filter parameters for a given API endpoint and see the API documentation for their description

## Value

A tibble::tibble with one row by record and one column by field.

## Examples

## Not run:
# Retrieve the hydrobiology monitoring sites in the Pays-de-Loire region
list_params(API = "hydrobio",
           endpoint = "stations_hydrobio")

get_hydrobio_stations_hydrobio(code_region = 52)

# Retrieve the hydrobiological bioassessment indices in the city of Rennes
list_params(API = "hydrobio",
           endpoint = "indices")

get_hydrobio_indexes(code_commune = 35051)
```python
# species records in the city of Rennes
list_paramsapi = "hydrobio",
                endpoint = "taxons")

get_hydrobio_taxons(code_commune = 35051)

## End(Not run)
```

get_hydrometrie_obselab

Retrieve data from API "Hydrométrie"

## Description

Available endpoints are:

* `get_hydrometrie_obselab` retrieves hydrometric elaborate observations (daily/monthly mean flow)

* `get_hydrometrie_observations_tr` retrieves hydrometric "real time" observations ()

* `get_hydrometrie_sites` retrieves hydrometric sites

* `get_hydrometrie_stations` retrieves hydrometric stations

See the API documentation of each endpoint for available filter parameters: https://hubeau.eaufrance.fr/page/api-hydrometrie

## Usage

```python
get_hydrometrie_obselab(...)

get_hydrometrie_observations_tr(..., entities = "station")

get_hydrometrie_sites(..., unique_site = TRUE)

get_hydrometrie_stations(..., code_sandre_reseauStation = FALSE)
```

## Arguments

<table><tr><td>...</td><td>parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name use the function list_params for a list of the available filter parameters for a given API endpoint and see the API documentation for their description</td></tr><tr><td>entities</td><td>1-length character string filtering the rows of the returned value, possible values are: "station" for filtering on station rows, "site" for filtering on site rows, "both" for keeping all the rows</td></tr><tr><td>unique_site</td><td>optional logical, if set to FALSE sites with several different locations produce one row by different location otherwise the first location found is used for fields code_commune_site, libelle_commune, code Departement, code_region, libelle_region, libelle Departement</td></tr></table>
Arguments

... parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name use the function list_params for a list of the available filter parameters for a given API endpoint and see the API documentation for their description

Value

get_indicateurs_services_communes returns a tibble::tibble with one row by commune, by service and by year and the following columns:

* "code_commune_insee": character identifier of the commune

* "nom_commune": character name of the commune

* "codes_service": integer identifier of the drinking water supply and/or sanitation service

* "annee": integer year of the data

* The following columns are the performance indicators flagged by their respective codes. The documentation of these codes can be found at this URL: https://www.services.eaufrance.fr/indicateurs/indicateurs.

get_indicateurs_services_indicateurs returns a tibble::tibble with one row by service and by year and the following columns:

* "code_service": character identifier of the service

* "nom_service": character name of the service

* "numero_siren": character SIREN identifier of the service

* "typeCollectivite": character kind of community

* "mode_gestion": character management mechanism of the service

* "annee": integer year of the data

* "indicateur": value of the indicator

* "uri_indicateur": the link to the indicator documentation

get_indicateurs_services_services returns a tibble::tibble with one row by commune, by service and by year and the following columns:

* "code_service": character identifier of the service

* "nom_service": character name of the service

* "code_commune_insee": character identifier of the commune

* "nom_commune": character name of the commune

* "numero_siren": character SIREN identifier of the service

* "typeCollectivite": character kind of community

* "mode_gestion": character management mechanism of the service

* "annee": integer year of the data

* The following columns are the performance indicators flagged by their respective codes. The documentation of these codes can be found at this URL: https://www.services.eaufrance.fr/indicateurs/indicateurs.
## Examples

```python
## Not run:
# Retrieve performance indicator time series in the commune of Romilly-sur-Seine
get_indicateurs_services_communes(code_commune = "10323")
```

```python
# Retrieve the drinking water withdrawal indicators of the year 2012 for all services
get_indicateurs_services_indicateurs(code_indicateur = "D102.0", annee = "2012")
```

```python
# Retrieve performance indicator time series of Romilly-sur-Seine with service details
get_indicateurs_services_services(code_commune = "10323")
```

```python
## End(Not run)
```

### get_niveaux_nappes_stations

Retrieve data from API "Piézométrie"

## Description

The available endpoints are:

* `get_niveaux_nappes_stations` retrieves list of piezometric stations

* `get_nappes_chroniques` retrieves piezometric archived time series

* `get_nappes_chroniques_tr` retrieves piezometric "real time" data

See the API documentation for available filter parameters: https://hubeau.eaufrance.fr/page/api-piezometrie

## Usage

```
get_niveaux_nappes_stations(...)
```

```
get_niveaux_nappes_chroniques(...)
```

```
get_niveaux_nappes_chroniques_tr(...)
```

## Arguments

... parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name use the function list_params for a list of the available filter parameters for a given API endpoint and see the API documentation for their description

## Value

A tibble::tibble with one row by record and one column by field.
## Examples

```r
## Not run:
# Retrieve the hydrometric stations in the department of Aube
get_niveaux_nappes_stations(code Departement = "10")

# Retrieve the archived observed piezometric level at station '07548X0009/F' (old BSS identifier)
# for the year 2020
df <- get_niveaux_nappes_chroniques(code_bss = "07548X0009/F",
                                  date_debut_mesure = "2020-01-01",
                                  date_fin_mesure = "2020-12-31")

# Plot the water elevation (NGF)
plot(as.POSIXct(df$mdate_mesure), df$niveau_nappe_eau, type = "l")

# For retrieving the last real time observed piezometric level
# at station 'BSS001VZGZ' (new BSS identifier)
df <- get_niveaux_nappes_chroniques_tr(bss_id = "BSS001VZGZ")

# Plot the water elevation (NGF)
plot(as.POSIXct(df$mdate_mesure), df$niveau_eauNgf, type = "l")

## End(Not run)
```

```
get_poisson_observations
Retrieve data from API "Poisson"
```

## Description

Available endpoint:

* `get_poisson_observations` retrieves data of scientific fishery operations

See the API documentation for available filter parameters: https://hubeau.eaufrance.fr/page/api-poisson

## Usage

```
get_poisson_observations(...)

get_poisson_indicateurs(...)

get_poisson_operations(...)

get_poisson_stations(...)
```

## Arguments

... parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name use the function `list_params` for a list of the available filter parameters for a given API endpoint and see the API documentation for their description
Value

A tibble::tibble with one row by record and one column by field.

Examples

```r
## Not run:
# Get the endpoints available for the API "Poisson"
list_endpoints(API = "poisson")

# List the stations available in Brest
get_poisson_stations.libelle_commune = "Brest")

# List the operations available in Brest
get_poisson_operations.libelle_commune = "Brest")

# List the indicators available in Brest
get_poisson_indicateurs.libelle_commune = "Brest")

# Get the query parameters for the requested API/endpoint
list_params(API = "poisson",
          endpoint = "observations")

# Retrieve selected fields on a river fish sampled in Brest
library(dplyr)
fields <- c("code_operations",
           "date_operations",
           "libelle_point_prelevement_aspe",
           "effectif lot",
           "code_alternatif_taxon")

brest_fishes <- get_poisson_observations(
  list(
    libelle_commune = "Brest",
    fields = fields
  )
) %>%
  group_by_at vars(-effectiflot)) %>%
    summarisenb_individals = sum(effectif lot))

brest_fishes

## End(Not run)
```

get_prelevements_points_prelevement
Retrieve data from API "Prélèvements en eau"
## Description

Available endpoints are:

* `get_prelevements_points_prelevement` retrieves withdrawal points

* `get_prelevements_ouvrages` retrieves withdrawal devices

* `get_prelevements_chroniques` retrieves time series of withdrawals

See the API documentation for available filter parameters: https://hubeau.eaufrance.fr/page/api-prelevements-eau

## Usage

```
get_prelevements_points_prelevement(...)

get_prelevements_ouvrages(...)

get_prelevements_chroniques(...)
```

## Arguments

... parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name use the function `list_params` for a list of the available filter parameters for a given API endpoint and see the API documentation for their description

## Value

A `tibble::tibble` with one row by record and one column by field.

## Examples

```r
## Not run:
# Retrieve the withdrawal points located in Romilly-sur-Seine
get_prelevements_points_prelevement(code_commune_insee = "10323")

# Retrieve the withdrawal devices located in Romilly-sur-Seine
get_prelevements_ouvrages(code_commune_insee = "10323")

# Retrieve the withdrawal time series of the devices located in Romilly-sur-Seine
get_prelevements_chroniques(code_commune_insee = "10323")

## End(Not run)
```
get qualite eau potable communes udi

Retrieve data from API "Qualité de l'eau potable"

## Description

Results of the sanitary control of the distributed water commune by commune: samples and results of the analyses carried out within the framework of the regulatory sanitary control on the distribution units or the installations directly upstream, and links between communes and distribution units. The elements made available in this dataset correspond to a compilation of analysis bulletins published online, commune by commune, on the website of the Ministry of Health: https://sante.gouv.fr/sante-et-environnement/eaux/eau

Available endpoints are:

* get qualite eau potable communes udi retrieves links between "UDI" (Distribution units or networks) and communes

* get qualite eau potable resultats dis retrieves samples, analysis results and sanitary conclusions from the sanitary control of the distributed water commune by commune

See the API documentation for available filter parameters: https://hubeau.eaufrance.fr/page/api-qualite-eau-potable

## Usage

get qualite eau potable communes udi(...)

get qualite eau potable resultats dis(...)

## Arguments

... parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name use the function list_params for a list of the available filter parameters for a given API endpoint and see the API documentation for their description

## Value

A tibble::tibble with one row by record and one column by field.

## Examples

## Not run:
# List of available filter parameters on 'get qualite eau potable communes udi'
list_params("qualite_eau_potable", "communes_udi")

# List of UDI s available in 2022 at Grabels (INSEE code 34116)
get qualite eau potable communes udi(annee = 2022, code commune = 34116)

# List of available filter parameters on 'get qualite eau potable resultats dis'
```python
list_params("qualite_eau_potable", "resultats_dis")

# Get results of analysis realised at Grabels in 2022
get.qualite_eau_potable_resultats_dis(code_commune = 34116,
                                     date_min_prelevement = "2000-01-01",
                                     date_max_prelevement = "2022-12-31")
```

```python
## End(Not run)
```

## get.qualite_nappes_analyses

Retrieve data from API "Qualité des nappes d'eau souterraines"

### Description

The data originate from the "ADES" database (https://ades.eaufrance.fr/). Available endpoints are:

* `get.qualite_nappes_stations` retrieves measuring stations for groundwater quality

* `get.qualite_nappes_analyses` retrieves the result analysis of quality measurement

See the API documentation for available filter parameters: https://hubeau.eaufrance.fr/page/api-qualite-nappes

### Usage

```python
get.qualite_nappes_analyses(...)
```

```python
get.qualite_nappes_stations(...)
```

### Arguments

... parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name use the function `list_params` for a list of the available filter parameters for a given API endpoint and see the API documentation for their description

### Value

A tibble::tibble with one row by record and one column by field.

### Examples

```r
## Not run:
# List of available filter parameters on 'get.qualite_nappes_stations'
list_params("qualite_nappes", "stations")

# List of stations available in Hérault department
get.qualite_nappes_stations(code_commune = 34116)
```
```python
# List of available filter parameters on 'get.qualite_nappes_analyses'
list_params("qualite_nappes", "analyses")

# Get results of analysis realised at Grabels in 2019
get.qualite_nappes_analyses(bss_id = "BSS002GNSA",
                             date_debut_prelevement = "2019-11-12")

## End(Not run)
```

get.qualite_rivieres_analyse

Retrieve data from API "Qualité physico-chimique des cours d'eau"

## Description

The "Quality of rivers" API data comes from the Naïades database. Available for the whole of France (including the French overseas departments and territories), they relate to the results of measurements of the physico-chemical quality of rivers and water bodies transmitted by the Water Agencies.

Available endpoints are:

* get.qualite_rivieresStation retrieves physico-chemical measuring stations

* get.qualite_rivieres_operations retrieves physico-chemical operations

* get.qualite_rivieres_analyse retrieves physico-chemical analyses

* get.qualite_rivieres_condition_environnementale retrieves physico-chemical environmental conditions for analyses (please note that pagination is based on the number of analyses)

See the API documentation for available filter parameters: https://hubeau.eaufrance.fr/page/api-qualite-cours-deau

## Usage

```
get.qualite_rivieres_analyse(...)
get.qualite_rivieres_analyse_pc(...)
get.qualite_rivieres_condition_environnementale(...)
get.qualite_rivieres_condition_environnementale_pc(...)
get.qualite_rivieres_operations(...)
get.qualite_rivieres_operations_pc(...)
get.qualite_rivieresStation(...)
get.qualite_rivieresStation_pc(...)
```
## Arguments

... parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name use the function list_params for a list of the available filter parameters for a given API endpoint and see the API documentation for their description

## Details

Endpoints ending by _pc are aliases of the functions without the suffix _pc.

## Value

A tibble::tibble with one row by record and one column by field.

## Examples

```r
## Not run:
# Tutorial provided by https://hubeau.eaufrance.fr/page/api-qualite-cours-deau-tuto

# List of stations in Longuyon
get.qualite_rivieresStation.libelle_commune="Longuyon")
# ... with field selection
get.qualite_rivieresStation(
  libelle_commune = "Longuyon",
  fields = c("codeStation",
    "libelleStation",
    "localisation_precise",
    "code_commune",
    "libelle_commune",
    "code_cours_eau",
    "nom_cours_eau")
)

# Query results of nitrate analyses at the station since 2013
get.qualite_rivieres_analyse(
  codeStation = "02115725",
  libelle_parametre = "Nitrates",
  date_debut_prelevement = "2013-01-01",
  code qualification = 1,
  fields = c("codeStation",
    "libelle Station",
    "code parametre",
    "libelle parametre",
    "date prelevement",
    "resultat",
    "symbole_unite",
    "code remarque",
    "mnemo remarque",
    "code statut",
    "mnemo statut",
    "code qualification",
    "libelle qualification")
)
```
```R
# dates sorted from most recent to oldest
get.qualite_rivieres_analyse(
  codeStation = "02115725",
  libelleParametre = "Nitrates",
  dateDebutPrelevement = "2013-01-01",
  codeQualification = 1,
  fields = c("codeStation",
    "libelleStation",
    "codeParametre",
    "libelleParametre",
    "datePrelevement",
    "resultat",
    "symboleUnite",
    "codeRemarque",
    "mnemoRemarque",
    "codeStatut",
    "mnemoStatut",
    "codeQualification",
    "libelleQualification"),
  sort = "desc"
)

# Nitrate analysis results since 1 August 2016 for 5 stations
get.qualite_rivieres_analyse(
  codeStation = c("02115725",
    "02115650",
    "02115685",
    "02115700",
    "02115715"),
  libelleParametre = "Nitrates",
  dateDebutPrelevement = "2016-08-01",
  codeQualification = 1,
  fields = c("codeStation",
    "libelleStation",
    "libelleParametre",
    "datePrelevement",
    "resultat",
    "symboleUnite",
    "codeRemarque"),
  sort = "desc"
)

# Geographical search by distance
get.qualite_rivieresšístation(longitude = 5.62,
  latitude = 49.44,
  distance = 8,
  fields = c("codeStation", "libellešístation"))

## End(Not run)
```
getTemperature_stations

Retrieve data from API "Température des cours d'eau"

## Description

Available endpoints are:

* `getTemperature_stations` retrieves temperature stations

* `getTemperature_chronique` retrieves temperature time series

See the API documentation of each endpoint for available filter parameters: https://hubeau.eaufrance.fr/page/api-temperature-continu

## Usage

`getTemperature_stations(...)`

`getTemperature_chronique(...)`

## Arguments

* ... parameters of the queries and their values in the format `Param1_Name = "Param1 value", Param2_Name use the function `list_params` for a list of the available filter parameters for a given API endpoint and see the API documentation for their description

## Value

A `tibble::tibble` with one row by record and one column by field.

## Examples

```r
## Not run:
```

```r
# Retrieve the temperature stations in the department of Loiret
getTemperature_stations(code Departement = "45")
```

```r
# Retrieve the temperature from 2012-01-01 to 2012-01-05 at site 04051125
getTemperature_chronique(
  code Station = "04051125",
  date debut mesure = "2012-01-01",
  date fin mesure = "2012-01-05",
  fields = paste("code station, date mesure temp, heure mesure temp, resultat, symbole unite")
)
```

```r
## End(Not run)
```
<table><tr><td>hubeau</td><td>hubeau: A package for retrieving data on the French databases on water 'Hub'Eau'</td></tr></table>

## Description

The 'hubeau' package provides functions for 'Hub'Eau' APIs and their related endpoints. These functions are named as follow: `hubeau::get_[API]_[endpoint]`.

Currently available APIs and related endpoints are listed below.

### API "Ecoulement des cours d'eau":

API documentation: https://hubeau.eaufrance.fr/page/api-ecoulement

Available functions:

* `get_ecoulement_stations()`: site data and locations

* `get_ecoulement_observations()`: flow observations collected during campaigns

* `get_ecoulement_campagnes()`: observation campaign information

### API "Hydrométrie":

API documentation: https://hubeau.eaufrance.fr/page/api-hydrometrie

Available functions:

* `get_hydrometrie_sites()`: hydrometry sites (can contain several stations)

* `get_hydrometrie_stations()`: hydrometry stations

* `get_hydrometrie_observations_tr()`: hydrometry water level and discharge time series

* `get_hydrometrieObsobs_trelab()`: hydrometric elaborate observations (daily/monthly mean flow)

### API "Indicateurs des services":

API documentation: https://hubeau.eaufrance.fr/page/api-indicateurs-services

Available functions:

* `get_indicateurs_services_communes()`: performance indicators by commune

* `get_indicateurs_services_indicateurs()`: performance indicators by indicator

* `get_indicateurs_services_services()`: performance indicators by commune for each service

### API "Piézométrie":

API documentation: https://hubeau.eaufrance.fr/page/api-piezometrie

Available functions:

* `get_niveaux_nappes_chroniques()`: archived time series of piezometric stations

* `get_niveaux_nappes_chroniques_tr()`: real-time time series of piezometric stations

* `get_niveaux_nappes_stations()`: piezometric stations

### API "Poisson":

API documentation: https://hubeau.eaufrance.fr/page/api-poisson

Available function:
* `get_poisson_operations()`: sampling operations carried out at stations measuring the quality of rivers

* `get_poisson_observations()`: fish observations made during sampling operations

* `get_poisson_indicateurs()`: the IPR and IPR+ indicators calculated from fish observations

* `get_poisson_stations()`: stations measuring the quality of rivers

### API "Prélèvements en eau":

API documentation: https://hubeau.eaufrance.fr/page/api-prelevements-eau

Available functions:

* `get_prelevements_chroniques()`: time series of annual withdrawn volumes by device

* `get_prelevements_ouvrages()`: withdrawal devices (can contain several withdrawal points)

* `get_prelevements_points_prelevement()`: withdrawal points

### API "Qualité de l'eau potable":

API documentation: https://hubeau.eaufrance.fr/page/api-qualite-eau-potable

Available functions:

* `get_qualite_eau_potable_communes_udi()`: links between "UDI" (Distribution units or networks) and communes

* `get_qualite_eau_potable_resultats_dis()`: samples, analysis results and sanitary conclusions from the sanitary control of the distributed water commune by commune

### API "Qualité des cours d'eau":

API documentation: https://hubeau.eaufrance.fr/page/api-qualite-cours-deau

Available functions:

* `get_qualite_rivieresStation()`: stations (measuring points) on rivers or water bodies where water samples have been taken for water quality analyses

* `get_qualite_rivieres_operations()`: sampling operations carried out at the stations

* `get_qualite_rivieres_analyse()`: physico-chemical analyses carried out on samples prepared during sampling operations at the stations

* `get_qualite_rivieres_condition_environnementale()`: environmental conditions (air temperature, presence of leaves, moss, iridescence, etc.) observed during physico-chemical sampling operations

### API "Qualité des nappes d'eau souterraines":

API documentation: https://hubeau.eaufrance.fr/page/api-qualite-nappes

Available functions:

* `get_qualite_nappes_stations()`: measuring stations for groundwater quality

* `get_qualite_nappes_analyses()`: analysis results of quality measurement

### API "Température des cours d'eau":

API Documentation: https://hubeau.eaufrance.fr/page/api-temperature-continu

Available functions:

* `getTemperature_stations()`: temperature stations in French rivers

* `getTemperature_chronique()`: river temperature time series
<table><tr><td>list_apis</td><td>List available Hub'Eau APIs, endpoints and filter parameters</td></tr></table>

**Description**

`list_apis()` returns the list of available APIs in the package.

`list_endpoints()` returns the list of available endpoints for an API.

`list_params()` returns the list of available parameters for an API endpoint.

**Usage**

`list_apis()`

`list_endpoints api`

`list_params api, endpoint`

**Arguments**

**api** a character name of the API (e.g.: "indicateurs_services", "prelevements"...), see example for available APIs

**endpoint** a character name of the endpoint, see example for available endpoints in an API

**Details**

The listed APIs correspond to the term `[API]` used in the name of the functions `get_[API]_[endpoint]` used for querying the APIs.

**Value**

character vector of APIs, endpoints or filter parameters

**Examples**

```r
# To get the available APIs in the package
list_apis()
```

```r
# To get the available endpoints in an API
list_endpoints("prelevements")
```

```r
# To get available parameters in endpoint "chroniques" of the API "prelevements"
list_params api = "prelevements", endpoint = "chroniques"
```
# Index

character, 3, 7, 9, 22
convert_list_to_tibble, 2, 4

doApiQuery, 2, 3

get_ecoulement_campagnes
(get_ecoulement_stations), 4

get_ecoulement_campagnes(), 20

get_ecoulement_observations
(get_ecoulement_stations), 4

get_ecoulement_observations(), 20

get_ecoulement_stations, 4

get_ecoulement_stations(), 20

get_hydrobio_indices
(get_hydrobio_stations_hydrobio),
6

get_hydrobio_stations_hydrobio, 6

get_hydrobio_taxons
(get_hydrobio_stations_hydrobio),
6

get_hydrometrieObsElab, 7

get_hydrometrieObsElab(), 20

get_hydrometrie_observations_tr
(get_hydrometrieObsElab), 7

get_hydrometrie_observations_tr(), 20

get_hydrometrie_sites
(get_hydrometrieObsElab), 7

get_hydrometrie_sites(), 20

get_hydrometrie_stations
(get_hydrometrieObsElab), 7

get_hydrometrie_stations(), 20

get_indicateurs_servicesCommunes, 8

get_indicateurs_servicesCommunes(),
20

get_indicateurs_servicesindicateurs
(get_indicateurs_servicesCommunes),
8

get_indicateurs_servicesindicateurs(),
20

get_indicateurs_services_services
(get_indicateurs_servicesCommunes),
8

get_indicateurs_services_services(),
20

get_niveauxnappeschroniques
(get_niveauxnappesstations),
10

get_niveauxnappeschroniques(), 20

get_niveauxnappeschroniques_tr
(get_niveauxnappesstations),
10

get_niveauxnappeschroniques_tr(), 20

get_niveauxnappesstations, 10

get_niveauxnappesstations(), 20

get_poissonindicateurs
(get_poissonobservations), 11

get_poissonindicateurs(), 21

get_poissonobservations, 11

get_poissonobservations(), 21

get_poisson_operations
(get_poissonobservations), 11

get_poisson_operations(), 21

get_poisson_stations
(get_poissonobservations), 11

get_poisson_stations(), 21

get_prelevementschroniques
(get_prelevements_points_prelevement),
12

get_prelevementschroniques(), 21

get_prelevementsouvrages
(get_prelevements_points_prelevement),
12

get_prelevementsouvrages(), 21

get_prelevements_points_prelevement,
12

get_prelevements_points_prelevement(),
21

get qualitieseau_potable_communes_udi,
<table>
  <tr>
    <td>14</td>
    <td>integer, 9</td>
  </tr>
  <tr>
    <td>get.qualite_eau_potable_communes_udi()</td>
    <td>list, 2-4</td>
  </tr>
  <tr>
    <td>get.qualite_eau_potable_resultats_dis</td>
    <td>list_apis, 22</td>
  </tr>
  <tr>
    <td>(get.qualite_eau_potable_communes_udi)</td>
    <td>list_endpoints (list_apis), 22</td>
  </tr>
  <tr>
    <td>14</td>
    <td>list_params, 3, 5-11, 13-15, 17, 19</td>
  </tr>
  <tr>
    <td>get.qualite_eau_potable_resultats_dis()</td>
    <td>list_params (list_apis), 22</td>
  </tr>
  <tr>
    <td>21</td>
    <td>logical, 7, 8</td>
  </tr>
  <tr>
    <td>get.qualite_nappes_analyses, 15</td>
    <td>tibble::tibble, 2, 4-6, 8-10, 12-15, 17, 19</td>
  </tr>
  <tr>
    <td>get.qualite_nappes_analyses(), 21</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_nappes_stations</td>
    <td>vector, 22</td>
  </tr>
  <tr>
    <td>(get.qualite_nappes_analyses), 15</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_nappes_stations(), 21</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_analyse, 16</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_analyse(), 21</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_analyse_pc</td>
    <td></td>
  </tr>
  <tr>
    <td>(get.qualite_rivieres_analyse), 16</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_condition_environnementale</td>
    <td></td>
  </tr>
  <tr>
    <td>(get.qualite_rivieres_analyse), 16</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_condition_environnementale(), 21</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_condition_environnementale_pc</td>
    <td></td>
  </tr>
  <tr>
    <td>(get.qualite_rivieres_analyse), 16</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_operations</td>
    <td></td>
  </tr>
  <tr>
    <td>(get.qualite_rivieres_analyse), 16</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_operations()</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_operations_pc</td>
    <td></td>
  </tr>
  <tr>
    <td>(get.qualite_rivieres_analyse), 16</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_stations</td>
    <td></td>
  </tr>
  <tr>
    <td>(get.qualite_rivieres_analyse), 16</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_stations()</td>
    <td></td>
  </tr>
  <tr>
    <td>get.qualite_rivieres_stations_pc</td>
    <td></td>
  </tr>
  <tr>
    <td>(get.qualite_rivieres_analyse), 16</td>
    <td></td>
  </tr>
  <tr>
    <td>get temperature chronique</td>
    <td></td>
  </tr>
  <tr>
    <td>(getTemperatureStations), 19</td>
    <td></td>
  </tr>
  <tr>
    <td>get temperature chronique()</td>
    <td></td>
  </tr>
  <tr>
    <td>get temperature_stations, 19</td>
    <td></td>
  </tr>
  <tr>
    <td>get temperature_stations()</td>
    <td></td>
  </tr>
</table>

hubeau, 20