From bd7ab7683b4472b260dc4ab444ba23a7e5c66db8 Mon Sep 17 00:00:00 2001
From: Dorchies David <david.dorchies@inrae.fr>
Date: Mon, 27 Dec 2021 11:59:06 +0100
Subject: [PATCH] docs: Aggregate documentation pby API

Closes #16
---
 NAMESPACE                                   |   1 +
 NEWS.md                                     |   1 +
 R/doApiQuery.R                              |  15 +-
 R/get_hydrometrie.R                         | 162 ++++++++++++++++++++
 R/get_hydrometrie_obs_elab.R                |  23 ---
 R/get_hydrometrie_observations_tr.R         |  50 ------
 R/get_hydrometrie_sites.R                   |  63 --------
 R/get_hydrometrie_stations.R                |  32 ----
 R/get_indicateurs_services.R                | 117 ++++++++++++++
 R/get_indicateurs_services_communes.R       |  36 -----
 R/get_indicateurs_services_indicateurs.R    |  35 -----
 R/get_indicateurs_services_services.R       |  40 -----
 R/get_niveaux_nappes.R                      |  76 +++++++++
 R/get_niveaux_nappes_chroniques.R           |  30 ----
 R/get_niveaux_nappes_chroniques_tr.R        |  27 ----
 R/get_niveaux_nappes_stations.R             |  25 ---
 R/get_prelevements.R                        |  67 ++++++++
 R/get_prelevements_chroniques.R             |  25 ---
 R/get_prelevements_ouvrages.R               |  27 ----
 R/get_prelevements_points_prelevement.R     |  22 ---
 man-roxygen/param_get_common.R              |   8 +-
 man/convert_list_to_tibble.Rd               |  17 ++
 man/doApiQuery.Rd                           |   6 +-
 man/get_hydrometrie.Rd                      |  89 +++++++++++
 man/get_hydrometrie_obs_elab.Rd             |  27 ----
 man/get_hydrometrie_observations_tr.Rd      |  32 ----
 man/get_hydrometrie_sites.Rd                |  34 ----
 man/get_hydrometrie_stations.Rd             |  34 ----
 man/get_indicateurs_services.Rd             |  98 ++++++++++++
 man/get_indicateurs_services_communes.Rd    |  35 -----
 man/get_indicateurs_services_indicateurs.Rd |  35 -----
 man/get_indicateurs_services_services.Rd    |  39 -----
 man/get_niveaux_nappes.Rd                   |  66 ++++++++
 man/get_niveaux_nappes_chroniques.Rd        |  34 ----
 man/get_niveaux_nappes_chroniques_tr.Rd     |  31 ----
 man/get_niveaux_nappes_stations.Rd          |  28 ----
 man/get_prelevements.Rd                     |  56 +++++++
 man/get_prelevements_chroniques.Rd          |  28 ----
 man/get_prelevements_ouvrages.Rd            |  28 ----
 man/get_prelevements_points_prelevement.Rd  |  28 ----
 40 files changed, 768 insertions(+), 859 deletions(-)
 create mode 100644 R/get_hydrometrie.R
 delete mode 100644 R/get_hydrometrie_obs_elab.R
 delete mode 100644 R/get_hydrometrie_observations_tr.R
 delete mode 100644 R/get_hydrometrie_sites.R
 delete mode 100644 R/get_hydrometrie_stations.R
 create mode 100644 R/get_indicateurs_services.R
 delete mode 100644 R/get_indicateurs_services_communes.R
 delete mode 100644 R/get_indicateurs_services_indicateurs.R
 delete mode 100644 R/get_indicateurs_services_services.R
 create mode 100644 R/get_niveaux_nappes.R
 delete mode 100644 R/get_niveaux_nappes_chroniques.R
 delete mode 100644 R/get_niveaux_nappes_chroniques_tr.R
 delete mode 100644 R/get_niveaux_nappes_stations.R
 create mode 100644 R/get_prelevements.R
 delete mode 100644 R/get_prelevements_chroniques.R
 delete mode 100644 R/get_prelevements_ouvrages.R
 delete mode 100644 R/get_prelevements_points_prelevement.R
 create mode 100644 man/convert_list_to_tibble.Rd
 create mode 100644 man/get_hydrometrie.Rd
 delete mode 100644 man/get_hydrometrie_obs_elab.Rd
 delete mode 100644 man/get_hydrometrie_observations_tr.Rd
 delete mode 100644 man/get_hydrometrie_sites.Rd
 delete mode 100644 man/get_hydrometrie_stations.Rd
 create mode 100644 man/get_indicateurs_services.Rd
 delete mode 100644 man/get_indicateurs_services_communes.Rd
 delete mode 100644 man/get_indicateurs_services_indicateurs.Rd
 delete mode 100644 man/get_indicateurs_services_services.Rd
 create mode 100644 man/get_niveaux_nappes.Rd
 delete mode 100644 man/get_niveaux_nappes_chroniques.Rd
 delete mode 100644 man/get_niveaux_nappes_chroniques_tr.Rd
 delete mode 100644 man/get_niveaux_nappes_stations.Rd
 create mode 100644 man/get_prelevements.Rd
 delete mode 100644 man/get_prelevements_chroniques.Rd
 delete mode 100644 man/get_prelevements_ouvrages.Rd
 delete mode 100644 man/get_prelevements_points_prelevement.Rd

diff --git a/NAMESPACE b/NAMESPACE
index 8fa7bbe..8ce3143 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -1,5 +1,6 @@
 # Generated by roxygen2: do not edit by hand
 
+export(convert_list_to_tibble)
 export(doApiQuery)
 export(get_available_params)
 export(get_hydrometrie_obs_elab)
diff --git a/NEWS.md b/NEWS.md
index 36f0841..3261770 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -3,6 +3,7 @@ hubeau (development version)
 
 New features
 ------------
+* Aggregate documentation by API (#16)
 * Add informations in DESCRIPTION file (#12)
 * `get_hydrometrie_observations_tr` add an option for handling duplicate entries (#10)
 * Deploy pkgdown website on github (#9)
diff --git a/R/doApiQuery.R b/R/doApiQuery.R
index 93b4ed0..7915a56 100644
--- a/R/doApiQuery.R
+++ b/R/doApiQuery.R
@@ -8,8 +8,10 @@
 #' @details The functions `get_[api]_[operation]` call the function `doQueryApi` and convert the response in a convenient format for the user ([data.frame] or [tibble::tibble])
 #'
 #' @param api a [character] name of the API (e.g.: "indicateurs_services", "prelevements"...), see example for available APIs
-#' @param operation a [character] name of the operation, see example for available operations in an API
-#' @template param_get_common
+#' @param operation a [character] name of the endpoint, see example for available endpoints in an API
+#' @param params a [list] the list of parameters of the queries and their values in the format `list(ParamName = "Param value", ...)`, use the function [get_available_params] for a list of the available filter parameters for a given operation in an API and see the API documentation for their description
+#' @param cfg a [config] object describing the configuration of the APIs. Use the internal package configuration by default
+#'        configuration
 #'
 #' @return A [list] with the concatenated results returned by the API.
 #' @export
@@ -110,12 +112,13 @@ doApiQuery <- function(api,
 }
 
 
-#' Convert list provided by the API into a tibble
+#' Convert list provided by the APIs into a tibble
 #'
-#' @param l a [list] provided by the API
+#' @param l a [list] provided by the API (See [doApiQuery])
 #'
-#' @return a [tibble:tibble] with one row by list item and one column by list sub-item
-#' @noRd
+#' @return a [tibble::tibble] with one row by list item and one column by list sub-item
+#'
+#' @export
 #'
 convert_list_to_tibble <- function(l) {
   l <-
diff --git a/R/get_hydrometrie.R b/R/get_hydrometrie.R
new file mode 100644
index 0000000..cae435b
--- /dev/null
+++ b/R/get_hydrometrie.R
@@ -0,0 +1,162 @@
+#' Retrieve data from API "Hydrométrie"
+#'
+#' @description
+#'
+#' Available endpoints are:
+#'
+#' - `get_hydrometrie_obs_elab` 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:
+#' \url{https://hubeau.eaufrance.fr/page/api-hydrometrie}
+#'
+#' @template param_get_common
+#'
+#' @export
+#' @rdname get_hydrometrie
+#' @examples
+#' # Retrieve the hydrometric sites in the department of Aube
+#' get_hydrometrie_sites(list(code_departement = "10"))
+#'
+#' # The same operation returning 2 rows for the site 'H0203020' which has 2 different locations
+#' get_hydrometrie_sites(list(code_departement = "10"), unique_site = FALSE)
+#'
+#' \dontrun{
+#' # This function is currently (2021-12-23) unstable and can be unavailable
+#' # (See https://github.com/BRGM/hubeau/issues/85)
+#' # Retrieve the hydrometric stations in the department of Aube
+#' get_hydrometrie_stations(list(code_departement = "10"))
+#' }
+#'
+#' # Which parameters are available for endpoint "obs_elab" of API "hydrometrie"?
+#' get_available_params("hydrometrie", "obs_elab")
+#'
+#' # Retrieve the hydrometric monthly mean flow at site 'H0203020'
+#' get_hydrometrie_obs_elab(list(code_entite = "H0203020", grandeur_hydro_elab = "QmM"))
+#'
+#' # Retrieve the hydrometric daily mean flow at site 'H0203020' of the last 30 days
+#' get_hydrometrie_obs_elab(
+#'   list(code_entite = "H0203020",
+#'   date_debut_obs_elab = format(Sys.Date() -30, "%Y-%m-%d"),
+#'   grandeur_hydro_elab = "QmJ"))
+#'
+get_hydrometrie_obs_elab <- function(params,
+                                     cfg = config::get(file = system.file("config.yml",
+                                                                          package = "hubeau"))) {
+  l <- doApiQuery(
+    api = "hydrometrie",
+    operation = "obs_elab",
+    params = params,
+    cfg = cfg
+  )
+  convert_list_to_tibble(l)
+}
+
+#' @param entities 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
+#' @rdname get_hydrometrie
+#' @export
+get_hydrometrie_observations_tr  <- function(params,
+                                             entities = "station",
+                                             cfg = config::get(file = system.file("config.yml",
+                                                        package = "hubeau"))) {
+  # Checks
+  if(!entities %in% c("station", "site", "both")) {
+    stop("Argument 'entities' must be one of these values: 'station', 'site', 'both'")
+  }
+
+  l <- doApiQuery(
+    api = "hydrometrie",
+    operation = "observations_tr",
+    params = params,
+    cfg = cfg
+  )
+  if(!is.null(l)) {
+    l <- lapply(l, function(x) {
+      x$geometry <- NULL
+      if (entities == "station") {
+        if (is.null(x$code_station)) {
+          return(NULL)
+        }
+      } else if (entities == "site") {
+        if (!is.null(x$code_station)) {
+          return(NULL)
+        }
+      }
+      return(x)
+    })
+    l[sapply(l, is.null)] <- NULL
+    l <- convert_list_to_tibble(l)
+  }
+  return(l)
+}
+
+#' @param unique_site 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`
+#' @rdname get_hydrometrie
+#' @export
+get_hydrometrie_sites  <- function(params,
+                                   unique_site = TRUE,
+                                   cfg = config::get(file = system.file("config.yml",
+                                                        package = "hubeau"))) {
+  l <- doApiQuery(
+    api = "hydrometrie",
+    operation = "sites",
+    params = params,
+    cfg = cfg
+  )
+  l <- lapply(l, function(x) {
+    fields <-
+      c(
+        "code_commune_site",
+        "libelle_commune",
+        "code_departement",
+        "code_region",
+        "libelle_region",
+        "libelle_departement"
+      )
+    bFirst <- TRUE
+    for (field in fields) {
+      if (!is.null(x[[field]])) {
+        fieldValue <- unique(unlist(x[[field]]))
+        if (unique_site && length(fieldValue) > 1) {
+          if(bFirst) {
+            warning(
+              "The site '",
+              x$code_site,
+              "' has ",
+              length(fieldValue),
+              " different locations, only the first one is returned",
+              call. = FALSE
+            )
+            bFirst <- FALSE
+          }
+          fieldValue <- x[[field]][[1]]
+        }
+        x[[field]] <- fieldValue
+      }
+    }
+    x$geometry <- NULL
+    x
+  })
+  convert_list_to_tibble(l)
+}
+
+#' @param code_sandre_reseau_station optional [logical] indicating if `code_sandre_reseau_station` field is included in the result; if so, one line is added by item and other fields are repeated
+#' @rdname get_hydrometrie
+#' @export
+get_hydrometrie_stations  <- function(params, code_sandre_reseau_station = FALSE, cfg = config::get(file = system.file("config.yml",
+                                                                                      package = "hubeau"))) {
+  l <- doApiQuery(api = "hydrometrie",
+                  operation = "stations",
+                  params = params,
+                  cfg = cfg)
+  l <- lapply(l, function(x) {
+    if (!code_sandre_reseau_station) {
+      x$code_sandre_reseau_station <- NULL
+    }
+    x$geometry <- NULL
+    x
+  })
+  convert_list_to_tibble(l)
+}
diff --git a/R/get_hydrometrie_obs_elab.R b/R/get_hydrometrie_obs_elab.R
deleted file mode 100644
index c11e57b..0000000
--- a/R/get_hydrometrie_obs_elab.R
+++ /dev/null
@@ -1,23 +0,0 @@
-#' Retrieve hydrometric elaborate observations from API "Hydrométrie"
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie#operations-hydrometrie-observationsElaborees}
-#'
-#' @template param_get_common
-#'
-#' @return a [tibble::tibble] with all available parameters in columns and one row by time step and by station.
-#' @export
-#'
-#' @examples
-#' # Retrieve the hydrometric last real time observed discharge at station 'H020302002'
-#' get_hydrometrie_obs_elab(list(code_entite = "H0203020", grandeur_hydro_elab = "QmM"))
-get_hydrometrie_obs_elab <- function(params,
-                                     cfg = config::get(file = system.file("config.yml",
-                                                                          package = "hubeau"))) {
-  l <- doApiQuery(
-    api = "hydrometrie",
-    operation = "obs_elab",
-    params = params,
-    cfg = cfg
-  )
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_hydrometrie_observations_tr.R b/R/get_hydrometrie_observations_tr.R
deleted file mode 100644
index 8d6e467..0000000
--- a/R/get_hydrometrie_observations_tr.R
+++ /dev/null
@@ -1,50 +0,0 @@
-#' Retrieve hydrometric "real time" observations from API "Hydrométrie"
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie}
-#'
-#' @template param_get_common
-#' @param entities 1-[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
-#'
-#' @return a [tibble::tibble] with all available parameters in columns and one row by time step and by station.
-#' If the query returns no records then the returned value is [NULL].
-#'
-#' @export
-#'
-#' @examples
-#' # Retrieve the hydrometric last real time observed discharge at station 'H020302002'
-#' get_hydrometrie_observations_tr(list(code_entite = "H0203020", grandeur_hydro = "Q"))
-#'
-get_hydrometrie_observations_tr  <- function(params,
-                                             entities = "station",
-                                             cfg = config::get(file = system.file("config.yml",
-                                                        package = "hubeau"))) {
-  # Checks
-  if(!entities %in% c("station", "site", "both")) {
-    stop("Argument 'entities' must be one of these values: 'station', 'site', 'both'")
-  }
-
-  l <- doApiQuery(
-    api = "hydrometrie",
-    operation = "observations_tr",
-    params = params,
-    cfg = cfg
-  )
-  if(!is.null(l)) {
-    l <- lapply(l, function(x) {
-      x$geometry <- NULL
-      if (entities == "station") {
-        if (is.null(x$code_station)) {
-          return(NULL)
-        }
-      } else if (entities == "site") {
-        if (!is.null(x$code_station)) {
-          return(NULL)
-        }
-      }
-      return(x)
-    })
-    l[sapply(l, is.null)] <- NULL
-    l <- convert_list_to_tibble(l)
-  }
-  return(l)
-}
diff --git a/R/get_hydrometrie_sites.R b/R/get_hydrometrie_sites.R
deleted file mode 100644
index 1dbc1f0..0000000
--- a/R/get_hydrometrie_sites.R
+++ /dev/null
@@ -1,63 +0,0 @@
-#' Retrieve hydrometric sites from API "Hydrométrie"
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie}
-#'
-#' @template param_get_common
-#' @param unique_site 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`
-#'
-#' @return a [tibble::tibble] with all available parameters in columns and one row by device, year and usage.
-#' @export
-#'
-#' @examples
-#' # Retrieve the hydrometric sites in the department of Aube
-#' get_hydrometrie_sites(list(code_departement = "10"))
-#'
-#' # The same operation returning 2 rows for the site 'H0203020' which has 2 different locations
-#' get_hydrometrie_sites(list(code_departement = "10"), unique_site = FALSE)
-#'
-get_hydrometrie_sites  <- function(params,
-                                   unique_site = TRUE,
-                                   cfg = config::get(file = system.file("config.yml",
-                                                        package = "hubeau"))) {
-  l <- doApiQuery(
-    api = "hydrometrie",
-    operation = "sites",
-    params = params,
-    cfg = cfg
-  )
-  l <- lapply(l, function(x) {
-    fields <-
-      c(
-        "code_commune_site",
-        "libelle_commune",
-        "code_departement",
-        "code_region",
-        "libelle_region",
-        "libelle_departement"
-      )
-    bFirst <- TRUE
-    for (field in fields) {
-      if (!is.null(x[[field]])) {
-        fieldValue <- unique(unlist(x[[field]]))
-        if (unique_site && length(fieldValue) > 1) {
-          if(bFirst) {
-            warning(
-              "The site '",
-              x$code_site,
-              "' has ",
-              length(fieldValue),
-              " different locations, only the first one is returned",
-              call. = FALSE
-            )
-            bFirst <- FALSE
-          }
-          fieldValue <- x[[field]][[1]]
-        }
-        x[[field]] <- fieldValue
-      }
-    }
-    x$geometry <- NULL
-    x
-  })
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_hydrometrie_stations.R b/R/get_hydrometrie_stations.R
deleted file mode 100644
index ec42999..0000000
--- a/R/get_hydrometrie_stations.R
+++ /dev/null
@@ -1,32 +0,0 @@
-#' Retrieve hydrometric stations from API "Hydrométrie"
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie}
-#'
-#' @template param_get_common
-#' @param code_sandre_reseau_station optional [logical] indicating if `code_sandre_reseau_station` field is included in the result; if so, one line is added by item and other fields are repeated
-#'
-#' @return a [tibble::tibble] with all available parameters in columns and one row by station.
-#' @export
-#'
-#' @examples
-#' \dontrun{
-#' # This function is temporarily unavailable because of https://github.com/BRGM/hubeau/issues/85
-#'
-#' # Retrieve the hydrometric stations in the department of Aube
-#' get_hydrometrie_stations(list(code_departement = "10"))
-#' }
-get_hydrometrie_stations  <- function(params, code_sandre_reseau_station = FALSE, cfg = config::get(file = system.file("config.yml",
-                                                                                      package = "hubeau"))) {
-  l <- doApiQuery(api = "hydrometrie",
-                  operation = "stations",
-                  params = params,
-                  cfg = cfg)
-  l <- lapply(l, function(x) {
-    if (!code_sandre_reseau_station) {
-      x$code_sandre_reseau_station <- NULL
-    }
-    x$geometry <- NULL
-    x
-  })
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_indicateurs_services.R b/R/get_indicateurs_services.R
new file mode 100644
index 0000000..0e3efe6
--- /dev/null
+++ b/R/get_indicateurs_services.R
@@ -0,0 +1,117 @@
+#' Retrieve performance indicators from drinking water supply and sanitation services at commune level
+#'
+#' @description
+#' Available endpoints are:
+#'
+#' -
+#'
+#' See [get_available_params] and the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-indicateurs-services}
+#'
+#' @template param_get_common
+#'
+#' @details
+#' `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: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
+#'
+#' 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: \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
+#' - "type_collectivite": [character] kind of collectivity
+#' - "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
+#' - "type_collectivite": [character] kind of collectivity
+#' - "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: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
+#'
+#' @export
+#' @rdname get_indicateurs_services
+#'
+#' @examples
+#' # Retrieve performance indicator time series in the commune of Romilly-sur-Seine
+#' get_indicateurs_services_communes(list(code_commune = "10323"))
+#'
+#' # Retrieve the drinking water withdrawal indicators of the year 2012 for all services
+#' get_indicateurs_services_indicateurs(list(code_indicateur = "D102.0", annee = "2012"))
+#'
+#' # Retrieve performance indicator time series of Romilly-sur-Seine with service details
+#' get_indicateurs_services_services(list(code_commune = "10323"))
+#'
+get_indicateurs_services_communes <- function(params,
+                                              cfg = config::get(file = system.file("config.yml",
+                                                                                   package = "hubeau"))) {
+
+  l <- doApiQuery(api = "indicateurs_services",
+                  operation = "communes",
+                  params = params,
+                  cfg = cfg)
+
+  l <- lapply(l, function(x) {
+    x <- c(x, x$indicateurs)
+    x$indicateurs <- NULL
+    x
+  })
+  convert_list_to_tibble(l)
+}
+
+#' @export
+#' @rdname get_indicateurs_services
+get_indicateurs_services_indicateurs <- function(params,
+                                                cfg = config::get(file = system.file("config.yml",
+                                                                                     package = "hubeau"))) {
+  l <- doApiQuery(api = "indicateurs_services",
+                  operation = "indicateurs",
+                  params = params,
+                  cfg = cfg)
+
+  l <- lapply(l, function(x) {
+    x$codes_commune <- NULL
+    x$noms_commune <- NULL
+    x
+  })
+  convert_list_to_tibble(l)
+}
+
+#' @export
+#' @rdname get_indicateurs_services
+get_indicateurs_services_services <- function(params,
+                                              cfg = config::get(file = system.file("config.yml",
+                                                                                   package = "hubeau"))) {
+
+  l <- doApiQuery(api = "indicateurs_services",
+                  operation = "services",
+                  params = params,
+                  cfg = cfg)
+
+  l <- lapply(l, function(x) {
+    x <- c(x, x$indicateurs)
+    x$indicateurs <- NULL
+    x
+  })
+  convert_list_to_tibble(l)
+}
diff --git a/R/get_indicateurs_services_communes.R b/R/get_indicateurs_services_communes.R
deleted file mode 100644
index 0353691..0000000
--- a/R/get_indicateurs_services_communes.R
+++ /dev/null
@@ -1,36 +0,0 @@
-#' Retrieve performance indicators from drinking water supply and sanitation services at commune level
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-indicateurs-services}
-#'
-#' @template param_get_common
-#'
-#' @return 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: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
-#'
-#' @export
-#'
-#' @examples
-#' # Retrieve performance indicator time series of the services in Romilly-sur-Seine
-#' get_indicateurs_services_communes(list(code_commune = "10323"))
-#'
-get_indicateurs_services_communes <- function(params,
-                                              cfg = config::get(file = system.file("config.yml",
-                                                                                   package = "hubeau"))) {
-
-  l <- doApiQuery(api = "indicateurs_services",
-                  operation = "communes",
-                  params = params,
-                  cfg = cfg)
-
-  l <- lapply(l, function(x) {
-    x <- c(x, x$indicateurs)
-    x$indicateurs <- NULL
-    x
-  })
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_indicateurs_services_indicateurs.R b/R/get_indicateurs_services_indicateurs.R
deleted file mode 100644
index 828fc16..0000000
--- a/R/get_indicateurs_services_indicateurs.R
+++ /dev/null
@@ -1,35 +0,0 @@
-#' Retrieve performance indicators from drinking water supply and sanitation services at commune level
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-indicateurs-services}
-#'
-#' @template param_get_common
-#'
-#' @return 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: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
-#'
-#' @export
-#'
-#' @examples
-#' # Retrieve the withdrawal time series of the devices located in Romilly-sur-Seine
-#' get_indicateurs_services_indicateurs(list(code_indicateur = "D102.0", annee = "2012"))
-#'
-get_indicateurs_services_indicateurs <- function(params,
-                                                cfg = config::get(file = system.file("config.yml",
-                                                                                     package = "hubeau"))) {
-  l <- doApiQuery(api = "indicateurs_services",
-                  operation = "indicateurs",
-                  params = params,
-                  cfg = cfg)
-
-  l <- lapply(l, function(x) {
-    x$codes_commune <- NULL
-    x$noms_commune <- NULL
-    x
-  })
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_indicateurs_services_services.R b/R/get_indicateurs_services_services.R
deleted file mode 100644
index e1a0b1d..0000000
--- a/R/get_indicateurs_services_services.R
+++ /dev/null
@@ -1,40 +0,0 @@
-#' Retrieve performance indicators from drinking water supply and sanitation services at commune level
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-indicateurs-services}
-#'
-#' @template param_get_common
-#'
-#' @return 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
-#' - "type_collectivite": [character] kind of collectivity
-#' - "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: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
-#'
-#' @export
-#'
-#' @examples
-#' # Retrieve performance indicator time series of the services in Romilly-sur-Seine
-#' get_indicateurs_services_services(list(code_commune = "10323"))
-#'
-get_indicateurs_services_services <- function(params,
-                                              cfg = config::get(file = system.file("config.yml",
-                                                                                   package = "hubeau"))) {
-
-  l <- doApiQuery(api = "indicateurs_services",
-                  operation = "services",
-                  params = params,
-                  cfg = cfg)
-
-  l <- lapply(l, function(x) {
-    x <- c(x, x$indicateurs)
-    x$indicateurs <- NULL
-    x
-  })
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_niveaux_nappes.R b/R/get_niveaux_nappes.R
new file mode 100644
index 0000000..371b6be
--- /dev/null
+++ b/R/get_niveaux_nappes.R
@@ -0,0 +1,76 @@
+#' 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: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
+#'
+#' @template param_get_common
+#'
+#' @rdname get_niveaux_nappes
+#' @export
+#'
+#' @examples
+#' # Retrieve the hydrometric stations in the department of Aube
+#' get_niveaux_nappes_stations(list(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(list(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$date_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(list(bss_id = "BSS001VZGZ"))
+#'
+#' # Plot the water elevation (NGF)
+#' plot(as.POSIXct(df$date_mesure), df$niveau_eau_ngf, type = "l")
+#'
+get_niveaux_nappes_stations  <- function(params, cfg = config::get(file = system.file("config.yml",
+                                                                                      package = "hubeau"))) {
+  l <- doApiQuery(api = "niveaux_nappes",
+                  operation = "stations",
+                  params = params,
+                  cfg = cfg)
+  l <- lapply(l, function(x) {
+    x$geometry <- NULL
+    x
+  })
+  convert_list_to_tibble(l)
+}
+
+#' @rdname get_niveaux_nappes
+#' @export
+get_niveaux_nappes_chroniques  <- function(params,
+                                   cfg = config::get(file = system.file("config.yml",
+                                                        package = "hubeau"))) {
+  l <- doApiQuery(
+    api = "niveaux_nappes",
+    operation = "chroniques",
+    params = params,
+    cfg = cfg
+  )
+  convert_list_to_tibble(l)
+}
+
+#' @rdname get_niveaux_nappes
+#' @export
+get_niveaux_nappes_chroniques_tr  <- function(params,
+                                   cfg = config::get(file = system.file("config.yml",
+                                                        package = "hubeau"))) {
+  l <- doApiQuery(
+    api = "niveaux_nappes",
+    operation = "chroniques_tr",
+    params = params,
+    cfg = cfg
+  )
+  convert_list_to_tibble(l)
+}
diff --git a/R/get_niveaux_nappes_chroniques.R b/R/get_niveaux_nappes_chroniques.R
deleted file mode 100644
index 33f07a2..0000000
--- a/R/get_niveaux_nappes_chroniques.R
+++ /dev/null
@@ -1,30 +0,0 @@
-#' Retrieve piezometric archived time series from API "Piézométrie"
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
-#'
-#' @template param_get_common
-#'
-#' @return a [tibble::tibble] with all available parameters in columns and one row by time step and by station.
-#' @export
-#'
-#' @examples
-#' # Retrieve the archived observed piezometric level at station '07548X0009/F' (old BSS identifier)
-#' # for the year 2020
-#' df <- get_niveaux_nappes_chroniques(list(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$date_mesure), df$niveau_nappe_eau, type = "l")
-#'
-get_niveaux_nappes_chroniques  <- function(params,
-                                   cfg = config::get(file = system.file("config.yml",
-                                                        package = "hubeau"))) {
-  l <- doApiQuery(
-    api = "niveaux_nappes",
-    operation = "chroniques",
-    params = params,
-    cfg = cfg
-  )
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_niveaux_nappes_chroniques_tr.R b/R/get_niveaux_nappes_chroniques_tr.R
deleted file mode 100644
index 633bcb5..0000000
--- a/R/get_niveaux_nappes_chroniques_tr.R
+++ /dev/null
@@ -1,27 +0,0 @@
-#' Retrieve piezometric "real time" chroniques from API "Piézométrie"
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
-#'
-#' @template param_get_common
-#'
-#' @return a [tibble::tibble] with all available parameters in columns and one row by time step and by station.
-#' @export
-#'
-#' @examples
-#' # For retrieving the last real time observed piezometric level
-#' # at station 'BSS001VZGZ' (new BSS identifier)
-#' df <- get_niveaux_nappes_chroniques_tr(list(bss_id = "BSS001VZGZ"))
-#'
-#' # Plot the water elevation (NGF)
-#' plot(as.POSIXct(df$date_mesure), df$niveau_eau_ngf, type = "l")
-get_niveaux_nappes_chroniques_tr  <- function(params,
-                                   cfg = config::get(file = system.file("config.yml",
-                                                        package = "hubeau"))) {
-  l <- doApiQuery(
-    api = "niveaux_nappes",
-    operation = "chroniques_tr",
-    params = params,
-    cfg = cfg
-  )
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_niveaux_nappes_stations.R b/R/get_niveaux_nappes_stations.R
deleted file mode 100644
index 5da5c1b..0000000
--- a/R/get_niveaux_nappes_stations.R
+++ /dev/null
@@ -1,25 +0,0 @@
-#' Retrieve piezometric stations from API "Piézométrie"
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
-#'
-#' @template param_get_common
-#'
-#' @return a [tibble::tibble] with all available parameters in columns and one row by station.
-#' @export
-#'
-#' @examples
-#' # Retrieve the hydrometric stations in the department of Aube
-#' get_niveaux_nappes_stations(list(code_departement = "10"))
-#'
-get_niveaux_nappes_stations  <- function(params, cfg = config::get(file = system.file("config.yml",
-                                                                                      package = "hubeau"))) {
-  l <- doApiQuery(api = "niveaux_nappes",
-                  operation = "stations",
-                  params = params,
-                  cfg = cfg)
-  l <- lapply(l, function(x) {
-    x$geometry <- NULL
-    x
-  })
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_prelevements.R b/R/get_prelevements.R
new file mode 100644
index 0000000..a6224f6
--- /dev/null
+++ b/R/get_prelevements.R
@@ -0,0 +1,67 @@
+#' 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: \url{https://hubeau.eaufrance.fr/page/api-prelevements-eau}
+#'
+#' @template param_get_common
+#'
+#' @rdname get_prelevements
+#' @export
+#'
+#' @examples
+#' # Retrieve the withdrawal points located in Romilly-sur-Seine
+#' get_prelevements_points_prelevement(list(code_commune_insee = "10323"))
+#'
+#' # Retrieve the withdrawal devices located in Romilly-sur-Seine
+#' get_prelevements_ouvrages(list(code_commune_insee = "10323"))
+#'
+#' # Retrieve the withdrawal time series of the devices located in Romilly-sur-Seine
+#' get_prelevements_chroniques(list(code_commune_insee = "10323"))
+#'
+get_prelevements_points_prelevement <- function(params, cfg = config::get(file = system.file("config.yml",
+                                                                        package = "hubeau"))) {
+  l <- doApiQuery(api = "prelevements",
+                  operation = "points_prelevement",
+                  params = params,
+                  cfg = cfg)
+
+  convert_list_to_tibble(l)
+}
+
+#' @rdname get_prelevements
+#' @export
+get_prelevements_ouvrages <- function(params, cfg = config::get(file = system.file("config.yml",
+                                                                                             package = "hubeau"))) {
+  l <- doApiQuery(api = "prelevements",
+                  operation = "ouvrages",
+                  params = params,
+                  cfg = cfg)
+  l <- lapply(l, function(x) {
+    x$geometry <- NULL
+    x$codes_points_prelevements <- NULL
+    x
+  })
+
+  convert_list_to_tibble(l)
+}
+
+#' @rdname get_prelevements
+#' @export
+get_prelevements_chroniques <- function(params, cfg = config::get(file = system.file("config.yml",
+                                                                       package = "hubeau"))) {
+  l <- doApiQuery(api = "prelevements",
+                  operation = "chroniques",
+                  params = params,
+                  cfg = cfg)
+  l <- lapply(l, function(x) {
+    x$geometry <- NULL
+    x
+  })
+  convert_list_to_tibble(l)
+}
diff --git a/R/get_prelevements_chroniques.R b/R/get_prelevements_chroniques.R
deleted file mode 100644
index a94db6f..0000000
--- a/R/get_prelevements_chroniques.R
+++ /dev/null
@@ -1,25 +0,0 @@
-#' Retrieve time series of withdrawals from API "Prélèvements en eau"
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-prelevements-eau}
-#'
-#' @template param_get_common
-#'
-#' @return a [tibble::tibble] with all available parameters in columns and one row by device, year and usage.
-#' @export
-#'
-#' @examples
-#' # Retrieve the withdrawal time series of the devices located in Romilly-sur-Seine
-#' get_prelevements_chroniques(list(code_commune_insee = "10323"))
-#'
-get_prelevements_chroniques <- function(params, cfg = config::get(file = system.file("config.yml",
-                                                                       package = "hubeau"))) {
-  l <- doApiQuery(api = "prelevements",
-                  operation = "chroniques",
-                  params = params,
-                  cfg = cfg)
-  l <- lapply(l, function(x) {
-    x$geometry <- NULL
-    x
-  })
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_prelevements_ouvrages.R b/R/get_prelevements_ouvrages.R
deleted file mode 100644
index 6d44579..0000000
--- a/R/get_prelevements_ouvrages.R
+++ /dev/null
@@ -1,27 +0,0 @@
-#' Retrieve withdrawal devices from API "Prélèvements en eau"
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-prelevements-eau}
-#'
-#' @template param_get_common
-#'
-#' @return a [tibble::tibble] with all available parameters in columns and one row by device.
-#' @export
-#'
-#' @examples
-#' # Retrieve the withdrawal devices located in Romilly-sur-Seine
-#' get_prelevements_ouvrages(list(code_commune_insee = "10323"))
-#'
-get_prelevements_ouvrages <- function(params, cfg = config::get(file = system.file("config.yml",
-                                                                                             package = "hubeau"))) {
-  l <- doApiQuery(api = "prelevements",
-                  operation = "ouvrages",
-                  params = params,
-                  cfg = cfg)
-  l <- lapply(l, function(x) {
-    x$geometry <- NULL
-    x$codes_points_prelevements <- NULL
-    x
-  })
-
-  convert_list_to_tibble(l)
-}
diff --git a/R/get_prelevements_points_prelevement.R b/R/get_prelevements_points_prelevement.R
deleted file mode 100644
index c9d5c93..0000000
--- a/R/get_prelevements_points_prelevement.R
+++ /dev/null
@@ -1,22 +0,0 @@
-#' Retrieve withdrawal points from API "Prélèvements en eau"
-#'
-#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-prelevements-eau#/prelevements/prelevement}
-#'
-#' @template param_get_common
-#'
-#' @return a [tibble::tibble] with all available parameters in columns and one row by withdrawal point.
-#' @export
-#'
-#' @examples
-#' # Retrieve the withdrawal points located in Romilly-sur-Seine
-#' get_prelevements_points_prelevement(list(code_commune_insee = "10323"))
-#'
-get_prelevements_points_prelevement <- function(params, cfg = config::get(file = system.file("config.yml",
-                                                                        package = "hubeau"))) {
-  l <- doApiQuery(api = "prelevements",
-                  operation = "points_prelevement",
-                  params = params,
-                  cfg = cfg)
-
-  convert_list_to_tibble(l)
-}
diff --git a/man-roxygen/param_get_common.R b/man-roxygen/param_get_common.R
index 1142159..e7d4259 100644
--- a/man-roxygen/param_get_common.R
+++ b/man-roxygen/param_get_common.R
@@ -1,3 +1,7 @@
-#' @param params a [list] the list of parameters of the queries and their values in the format `list(ParamName = "Param value", ...)`, use the function [get_available_params] for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters
-#' @param cfg a [config] object Configuration of the communication. Use by default the internal package
+#' @param params a [list] the list of parameters of the queries and their values in the format `list(ParamName = "Param value", ...)`, use the function [get_available_params] for a list of the available filter parameters for a given operation in an API and see the API documentation for their description
+#' @param cfg a [config] object describing the configuration of the APIs. Use the internal package configuration by default
 #'        configuration
+#'
+#' @return a [tibble::tibble] with all available parameters in columns.
+#'
+#' @seealso [doApiQuery] for more details on the API querying process.
diff --git a/man/convert_list_to_tibble.Rd b/man/convert_list_to_tibble.Rd
new file mode 100644
index 0000000..2d7ff9b
--- /dev/null
+++ b/man/convert_list_to_tibble.Rd
@@ -0,0 +1,17 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/doApiQuery.R
+\name{convert_list_to_tibble}
+\alias{convert_list_to_tibble}
+\title{Convert list provided by the APIs into a tibble}
+\usage{
+convert_list_to_tibble(l)
+}
+\arguments{
+\item{l}{a \link{list} provided by the API (See \link{doApiQuery})}
+}
+\value{
+a \link[tibble:tibble]{tibble::tibble} with one row by list item and one column by list sub-item
+}
+\description{
+Convert list provided by the APIs into a tibble
+}
diff --git a/man/doApiQuery.Rd b/man/doApiQuery.Rd
index 261a27f..cd0e8d2 100644
--- a/man/doApiQuery.Rd
+++ b/man/doApiQuery.Rd
@@ -21,11 +21,11 @@ get_available_params(
 \arguments{
 \item{api}{a \link{character} name of the API (e.g.: "indicateurs_services", "prelevements"...), see example for available APIs}
 
-\item{operation}{a \link{character} name of the operation, see example for available operations in an API}
+\item{operation}{a \link{character} name of the endpoint, see example for available endpoints in an API}
 
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
+\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available filter parameters for a given operation in an API and see the API documentation for their description}
 
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
+\item{cfg}{a \link{config} object describing the configuration of the APIs. Use the internal package configuration by default
 configuration}
 }
 \value{
diff --git a/man/get_hydrometrie.Rd b/man/get_hydrometrie.Rd
new file mode 100644
index 0000000..597564e
--- /dev/null
+++ b/man/get_hydrometrie.Rd
@@ -0,0 +1,89 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/get_hydrometrie.R
+\name{get_hydrometrie_obs_elab}
+\alias{get_hydrometrie_obs_elab}
+\alias{get_hydrometrie_observations_tr}
+\alias{get_hydrometrie_sites}
+\alias{get_hydrometrie_stations}
+\title{Retrieve data from API "Hydrométrie"}
+\usage{
+get_hydrometrie_obs_elab(
+  params,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+
+get_hydrometrie_observations_tr(
+  params,
+  entities = "station",
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+
+get_hydrometrie_sites(
+  params,
+  unique_site = TRUE,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+
+get_hydrometrie_stations(
+  params,
+  code_sandre_reseau_station = FALSE,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+}
+\arguments{
+\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available filter parameters for a given operation in an API and see the API documentation for their description}
+
+\item{cfg}{a \link{config} object describing the configuration of the APIs. Use the internal package configuration by default
+configuration}
+
+\item{entities}{1-length \link{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}
+
+\item{unique_site}{optional \link{logical}, if set to \code{FALSE} sites with several different locations produce one row by different location otherwise the first location found is used for fields \code{code_commune_site}, \code{libelle_commune}, \code{code_departement}, \code{code_region}, \code{libelle_region}, \code{libelle_departement}}
+
+\item{code_sandre_reseau_station}{optional \link{logical} indicating if \code{code_sandre_reseau_station} field is included in the result; if so, one line is added by item and other fields are repeated}
+}
+\value{
+a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns.
+}
+\description{
+Available endpoints are:
+\itemize{
+\item \code{get_hydrometrie_obs_elab} retrieves hydrometric elaborate observations (daily/monthly mean flow)
+\item \code{get_hydrometrie_observations_tr} retrieves hydrometric "real time" observations ()
+\item \code{get_hydrometrie_sites} retrieves hydrometric sites
+\item \code{get_hydrometrie_stations} retrieves hydrometric stations
+}
+
+See the API documentation of each endpoint for available filter parameters:
+\url{https://hubeau.eaufrance.fr/page/api-hydrometrie}
+}
+\examples{
+# Retrieve the hydrometric sites in the department of Aube
+get_hydrometrie_sites(list(code_departement = "10"))
+
+# The same operation returning 2 rows for the site 'H0203020' which has 2 different locations
+get_hydrometrie_sites(list(code_departement = "10"), unique_site = FALSE)
+
+\dontrun{
+# This function is currently (2021-12-23) unstable and can be unavailable
+# (See https://github.com/BRGM/hubeau/issues/85)
+# Retrieve the hydrometric stations in the department of Aube
+get_hydrometrie_stations(list(code_departement = "10"))
+}
+
+# Which parameters are available for endpoint "obs_elab" of API "hydrometrie"?
+get_available_params("hydrometrie", "obs_elab")
+
+# Retrieve the hydrometric monthly mean flow at site 'H0203020'
+get_hydrometrie_obs_elab(list(code_entite = "H0203020", grandeur_hydro_elab = "QmM"))
+
+# Retrieve the hydrometric daily mean flow at site 'H0203020' of the last 30 days
+get_hydrometrie_obs_elab(
+  list(code_entite = "H0203020",
+  date_debut_obs_elab = format(Sys.Date() -30, "\%Y-\%m-\%d"),
+  grandeur_hydro_elab = "QmJ"))
+
+}
+\seealso{
+\link{doApiQuery} for more details on the API querying process.
+}
diff --git a/man/get_hydrometrie_obs_elab.Rd b/man/get_hydrometrie_obs_elab.Rd
deleted file mode 100644
index b81c3e1..0000000
--- a/man/get_hydrometrie_obs_elab.Rd
+++ /dev/null
@@ -1,27 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_hydrometrie_obs_elab.R
-\name{get_hydrometrie_obs_elab}
-\alias{get_hydrometrie_obs_elab}
-\title{Retrieve hydrometric elaborate observations from API "Hydrométrie"}
-\usage{
-get_hydrometrie_obs_elab(
-  params,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by time step and by station.
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie#operations-hydrometrie-observationsElaborees}
-}
-\examples{
-# Retrieve the hydrometric last real time observed discharge at station 'H020302002'
-get_hydrometrie_obs_elab(list(code_entite = "H0203020", grandeur_hydro_elab = "QmM"))
-}
diff --git a/man/get_hydrometrie_observations_tr.Rd b/man/get_hydrometrie_observations_tr.Rd
deleted file mode 100644
index fe14c5f..0000000
--- a/man/get_hydrometrie_observations_tr.Rd
+++ /dev/null
@@ -1,32 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_hydrometrie_observations_tr.R
-\name{get_hydrometrie_observations_tr}
-\alias{get_hydrometrie_observations_tr}
-\title{Retrieve hydrometric "real time" observations from API "Hydrométrie"}
-\usage{
-get_hydrometrie_observations_tr(
-  params,
-  entities = "station",
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{entities}{1-\link{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}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by time step and by station.
-If the query returns no records then the returned value is \link{NULL}.
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie}
-}
-\examples{
-# Retrieve the hydrometric last real time observed discharge at station 'H020302002'
-get_hydrometrie_observations_tr(list(code_entite = "H0203020", grandeur_hydro = "Q"))
-
-}
diff --git a/man/get_hydrometrie_sites.Rd b/man/get_hydrometrie_sites.Rd
deleted file mode 100644
index 61130ff..0000000
--- a/man/get_hydrometrie_sites.Rd
+++ /dev/null
@@ -1,34 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_hydrometrie_sites.R
-\name{get_hydrometrie_sites}
-\alias{get_hydrometrie_sites}
-\title{Retrieve hydrometric sites from API "Hydrométrie"}
-\usage{
-get_hydrometrie_sites(
-  params,
-  unique_site = TRUE,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{unique_site}{optional \link{logical}, if set to \code{FALSE} sites with several different locations produce one row by different location otherwise the first location found is used for fields \code{code_commune_site}, \code{libelle_commune}, \code{code_departement}, \code{code_region}, \code{libelle_region}, \code{libelle_departement}}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by device, year and usage.
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie}
-}
-\examples{
-# Retrieve the hydrometric sites in the department of Aube
-get_hydrometrie_sites(list(code_departement = "10"))
-
-# The same operation returning 2 rows for the site 'H0203020' which has 2 different locations
-get_hydrometrie_sites(list(code_departement = "10"), unique_site = FALSE)
-
-}
diff --git a/man/get_hydrometrie_stations.Rd b/man/get_hydrometrie_stations.Rd
deleted file mode 100644
index 5bd19f9..0000000
--- a/man/get_hydrometrie_stations.Rd
+++ /dev/null
@@ -1,34 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_hydrometrie_stations.R
-\name{get_hydrometrie_stations}
-\alias{get_hydrometrie_stations}
-\title{Retrieve hydrometric stations from API "Hydrométrie"}
-\usage{
-get_hydrometrie_stations(
-  params,
-  code_sandre_reseau_station = FALSE,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{code_sandre_reseau_station}{optional \link{logical} indicating if \code{code_sandre_reseau_station} field is included in the result; if so, one line is added by item and other fields are repeated}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by station.
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie}
-}
-\examples{
-\dontrun{
-# This function is temporarily unavailable because of https://github.com/BRGM/hubeau/issues/85
-
-# Retrieve the hydrometric stations in the department of Aube
-get_hydrometrie_stations(list(code_departement = "10"))
-}
-}
diff --git a/man/get_indicateurs_services.Rd b/man/get_indicateurs_services.Rd
new file mode 100644
index 0000000..65936f9
--- /dev/null
+++ b/man/get_indicateurs_services.Rd
@@ -0,0 +1,98 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/get_indicateurs_services.R
+\name{get_indicateurs_services_communes}
+\alias{get_indicateurs_services_communes}
+\alias{get_indicateurs_services_indicateurs}
+\alias{get_indicateurs_services_services}
+\title{Retrieve performance indicators from drinking water supply and sanitation services at commune level}
+\usage{
+get_indicateurs_services_communes(
+  params,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+
+get_indicateurs_services_indicateurs(
+  params,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+
+get_indicateurs_services_services(
+  params,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+}
+\arguments{
+\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available filter parameters for a given operation in an API and see the API documentation for their description}
+
+\item{cfg}{a \link{config} object describing the configuration of the APIs. Use the internal package configuration by default
+configuration}
+}
+\value{
+a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns.
+}
+\description{
+Available endpoints are:
+\itemize{
+\item 
+}
+
+See \link{get_available_params} and the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-indicateurs-services}
+}
+\details{
+\code{get_indicateurs_services_communes} returns a \link[tibble:tibble]{tibble::tibble} with one row by commune, by service and by year and the following columns:
+\itemize{
+\item "code_commune_insee": \link{character} identifier of the commune
+\item "nom_commune": \link{character} name of the commune
+\item "codes_service": \link{integer} identifier of the drinking water supply and/or sanitation service
+\item "annee": \link{integer} year of the data
+\item The following columns are the performance indicators flagged by their respective codes. The documentation of these codes can be found at this URL: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
+}
+
+a \link[tibble:tibble]{tibble::tibble} with one row by commune, by service and by year and the following columns:
+\itemize{
+\item "code_commune_insee": \link{character} identifier of the commune
+\item "nom_commune": \link{character} name of the commune
+\item "codes_service": \link{integer} identifier of the drinking water supply and/or sanitation service
+\item "annee": \link{integer} year of the data
+\item The following columns are the performance indicators flagged by their respective codes. The documentation of these codes can be found at this URL: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
+}
+
+\code{get_indicateurs_services_indicateurs} returns a \link[tibble:tibble]{tibble::tibble} with one row by service and by year and the following columns:
+\itemize{
+\item "code_service": \link{character} identifier of the service
+\item "nom_service": \link{character} name of the service
+\item "numero_siren ": \link{character} SIREN identifier of the service
+\item "type_collectivite": \link{character} kind of collectivity
+\item "mode_gestion": \link{character} management mechanism of the service
+\item "annee": \link{integer} year of the data
+\item "indicateur": value of the indicator
+\item "uri_indicateur": the link to the indicator documentation
+}
+
+\code{get_indicateurs_services_services} returns a \link[tibble:tibble]{tibble::tibble} with one row by commune, by service and by year and the following columns:
+\itemize{
+\item "code_service": \link{character} identifier of the service
+\item "nom_service": \link{character} name of the service
+\item "code_commune_insee": \link{character} identifier of the commune
+\item "nom_commune": \link{character} name of the commune
+\item "numero_siren ": \link{character} SIREN identifier of the service
+\item "type_collectivite": \link{character} kind of collectivity
+\item "mode_gestion": \link{character} management mechanism of the service
+\item "annee": \link{integer} year of the data
+\item The following columns are the performance indicators flagged by their respective codes. The documentation of these codes can be found at this URL: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
+}
+}
+\examples{
+# Retrieve performance indicator time series in the commune of Romilly-sur-Seine
+get_indicateurs_services_communes(list(code_commune = "10323"))
+
+# Retrieve the drinking water withdrawal indicators of the year 2012 for all services
+get_indicateurs_services_indicateurs(list(code_indicateur = "D102.0", annee = "2012"))
+
+# Retrieve performance indicator time series of Romilly-sur-Seine with service details
+get_indicateurs_services_services(list(code_commune = "10323"))
+
+}
+\seealso{
+\link{doApiQuery} for more details on the API querying process.
+}
diff --git a/man/get_indicateurs_services_communes.Rd b/man/get_indicateurs_services_communes.Rd
deleted file mode 100644
index 04251fb..0000000
--- a/man/get_indicateurs_services_communes.Rd
+++ /dev/null
@@ -1,35 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_indicateurs_services_communes.R
-\name{get_indicateurs_services_communes}
-\alias{get_indicateurs_services_communes}
-\title{Retrieve performance indicators from drinking water supply and sanitation services at commune level}
-\usage{
-get_indicateurs_services_communes(
-  params,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with one row by commune, by service and by year and the following columns:
-\itemize{
-\item "code_commune_insee": \link{character} identifier of the commune
-\item "nom_commune": \link{character} name of the commune
-\item "codes_service": \link{integer} identifier of the drinking water supply and/or sanitation service
-\item "annee": \link{integer} year of the data
-\item The following columns are the performance indicators flagged by their respective codes. The documentation of these codes can be found at this URL: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
-}
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-indicateurs-services}
-}
-\examples{
-# Retrieve performance indicator time series of the services in Romilly-sur-Seine
-get_indicateurs_services_communes(list(code_commune = "10323"))
-
-}
diff --git a/man/get_indicateurs_services_indicateurs.Rd b/man/get_indicateurs_services_indicateurs.Rd
deleted file mode 100644
index 9c96ae2..0000000
--- a/man/get_indicateurs_services_indicateurs.Rd
+++ /dev/null
@@ -1,35 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_indicateurs_services_indicateurs.R
-\name{get_indicateurs_services_indicateurs}
-\alias{get_indicateurs_services_indicateurs}
-\title{Retrieve performance indicators from drinking water supply and sanitation services at commune level}
-\usage{
-get_indicateurs_services_indicateurs(
-  params,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with one row by commune, by service and by year and the following columns:
-\itemize{
-\item "code_commune_insee": \link{character} identifier of the commune
-\item "nom_commune": \link{character} name of the commune
-\item "codes_service": \link{integer} identifier of the drinking water supply and/or sanitation service
-\item "annee": \link{integer} year of the data
-\item The following columns are the performance indicators flagged by their respective codes. The documentation of these codes can be found at this URL: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
-}
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-indicateurs-services}
-}
-\examples{
-# Retrieve the withdrawal time series of the devices located in Romilly-sur-Seine
-get_indicateurs_services_indicateurs(list(code_indicateur = "D102.0", annee = "2012"))
-
-}
diff --git a/man/get_indicateurs_services_services.Rd b/man/get_indicateurs_services_services.Rd
deleted file mode 100644
index 7b98395..0000000
--- a/man/get_indicateurs_services_services.Rd
+++ /dev/null
@@ -1,39 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_indicateurs_services_services.R
-\name{get_indicateurs_services_services}
-\alias{get_indicateurs_services_services}
-\title{Retrieve performance indicators from drinking water supply and sanitation services at commune level}
-\usage{
-get_indicateurs_services_services(
-  params,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with one row by commune, by service and by year and the following columns:
-\itemize{
-\item "code_service": \link{character} identifier of the service
-\item "nom_service": \link{character} name of the service
-\item "code_commune_insee": \link{character} identifier of the commune
-\item "nom_commune": \link{character} name of the commune
-\item "numero_siren ": \link{character} SIREN identifier of the service
-\item "type_collectivite": \link{character} kind of collectivity
-\item "mode_gestion": \link{character} management mechanism of the service
-\item "annee": \link{integer} year of the data
-\item The following columns are the performance indicators flagged by their respective codes. The documentation of these codes can be found at this URL: \url{https://www.services.eaufrance.fr/indicateurs/indicateurs}.
-}
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-indicateurs-services}
-}
-\examples{
-# Retrieve performance indicator time series of the services in Romilly-sur-Seine
-get_indicateurs_services_services(list(code_commune = "10323"))
-
-}
diff --git a/man/get_niveaux_nappes.Rd b/man/get_niveaux_nappes.Rd
new file mode 100644
index 0000000..6695228
--- /dev/null
+++ b/man/get_niveaux_nappes.Rd
@@ -0,0 +1,66 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/get_niveaux_nappes.R
+\name{get_niveaux_nappes_stations}
+\alias{get_niveaux_nappes_stations}
+\alias{get_niveaux_nappes_chroniques}
+\alias{get_niveaux_nappes_chroniques_tr}
+\title{Retrieve data from API "Piézométrie"}
+\usage{
+get_niveaux_nappes_stations(
+  params,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+
+get_niveaux_nappes_chroniques(
+  params,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+
+get_niveaux_nappes_chroniques_tr(
+  params,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+}
+\arguments{
+\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available filter parameters for a given operation in an API and see the API documentation for their description}
+
+\item{cfg}{a \link{config} object describing the configuration of the APIs. Use the internal package configuration by default
+configuration}
+}
+\value{
+a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns.
+}
+\description{
+The available endpoints are:
+\itemize{
+\item \code{get_niveaux_nappes_stations} retrieves list of piezometric stations
+\item \code{get_nappes_chroniques} retrieves piezometric archived time series
+\item \code{get_nappes_chroniques_tr} retrieves piezometric "real time" data
+}
+
+See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
+}
+\examples{
+# Retrieve the hydrometric stations in the department of Aube
+get_niveaux_nappes_stations(list(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(list(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$date_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(list(bss_id = "BSS001VZGZ"))
+
+# Plot the water elevation (NGF)
+plot(as.POSIXct(df$date_mesure), df$niveau_eau_ngf, type = "l")
+
+}
+\seealso{
+\link{doApiQuery} for more details on the API querying process.
+}
diff --git a/man/get_niveaux_nappes_chroniques.Rd b/man/get_niveaux_nappes_chroniques.Rd
deleted file mode 100644
index 3666412..0000000
--- a/man/get_niveaux_nappes_chroniques.Rd
+++ /dev/null
@@ -1,34 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_niveaux_nappes_chroniques.R
-\name{get_niveaux_nappes_chroniques}
-\alias{get_niveaux_nappes_chroniques}
-\title{Retrieve piezometric archived time series from API "Piézométrie"}
-\usage{
-get_niveaux_nappes_chroniques(
-  params,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by time step and by station.
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
-}
-\examples{
-# Retrieve the archived observed piezometric level at station '07548X0009/F' (old BSS identifier)
-# for the year 2020
-df <- get_niveaux_nappes_chroniques(list(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$date_mesure), df$niveau_nappe_eau, type = "l")
-
-}
diff --git a/man/get_niveaux_nappes_chroniques_tr.Rd b/man/get_niveaux_nappes_chroniques_tr.Rd
deleted file mode 100644
index 904f4e9..0000000
--- a/man/get_niveaux_nappes_chroniques_tr.Rd
+++ /dev/null
@@ -1,31 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_niveaux_nappes_chroniques_tr.R
-\name{get_niveaux_nappes_chroniques_tr}
-\alias{get_niveaux_nappes_chroniques_tr}
-\title{Retrieve piezometric "real time" chroniques from API "Piézométrie"}
-\usage{
-get_niveaux_nappes_chroniques_tr(
-  params,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by time step and by station.
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
-}
-\examples{
-# For retrieving the last real time observed piezometric level
-# at station 'BSS001VZGZ' (new BSS identifier)
-df <- get_niveaux_nappes_chroniques_tr(list(bss_id = "BSS001VZGZ"))
-
-# Plot the water elevation (NGF)
-plot(as.POSIXct(df$date_mesure), df$niveau_eau_ngf, type = "l")
-}
diff --git a/man/get_niveaux_nappes_stations.Rd b/man/get_niveaux_nappes_stations.Rd
deleted file mode 100644
index 4efbb7d..0000000
--- a/man/get_niveaux_nappes_stations.Rd
+++ /dev/null
@@ -1,28 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_niveaux_nappes_stations.R
-\name{get_niveaux_nappes_stations}
-\alias{get_niveaux_nappes_stations}
-\title{Retrieve piezometric stations from API "Piézométrie"}
-\usage{
-get_niveaux_nappes_stations(
-  params,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by station.
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
-}
-\examples{
-# Retrieve the hydrometric stations in the department of Aube
-get_niveaux_nappes_stations(list(code_departement = "10"))
-
-}
diff --git a/man/get_prelevements.Rd b/man/get_prelevements.Rd
new file mode 100644
index 0000000..096d867
--- /dev/null
+++ b/man/get_prelevements.Rd
@@ -0,0 +1,56 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/get_prelevements.R
+\name{get_prelevements_points_prelevement}
+\alias{get_prelevements_points_prelevement}
+\alias{get_prelevements_ouvrages}
+\alias{get_prelevements_chroniques}
+\title{Retrieve data from API "Prélèvements en eau"}
+\usage{
+get_prelevements_points_prelevement(
+  params,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+
+get_prelevements_ouvrages(
+  params,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+
+get_prelevements_chroniques(
+  params,
+  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
+)
+}
+\arguments{
+\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available filter parameters for a given operation in an API and see the API documentation for their description}
+
+\item{cfg}{a \link{config} object describing the configuration of the APIs. Use the internal package configuration by default
+configuration}
+}
+\value{
+a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns.
+}
+\description{
+Available endpoints are:
+\itemize{
+\item \code{get_prelevements_points_prelevement} retrieves withdrawal points
+\item \code{get_prelevements_ouvrages} retrieves withdrawal devices
+\item \code{get_prelevements_chroniques} retrieves time series of withdrawals
+}
+
+See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-prelevements-eau}
+}
+\examples{
+# Retrieve the withdrawal points located in Romilly-sur-Seine
+get_prelevements_points_prelevement(list(code_commune_insee = "10323"))
+
+# Retrieve the withdrawal devices located in Romilly-sur-Seine
+get_prelevements_ouvrages(list(code_commune_insee = "10323"))
+
+# Retrieve the withdrawal time series of the devices located in Romilly-sur-Seine
+get_prelevements_chroniques(list(code_commune_insee = "10323"))
+
+}
+\seealso{
+\link{doApiQuery} for more details on the API querying process.
+}
diff --git a/man/get_prelevements_chroniques.Rd b/man/get_prelevements_chroniques.Rd
deleted file mode 100644
index 3f1b8cc..0000000
--- a/man/get_prelevements_chroniques.Rd
+++ /dev/null
@@ -1,28 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_prelevements_chroniques.R
-\name{get_prelevements_chroniques}
-\alias{get_prelevements_chroniques}
-\title{Retrieve time series of withdrawals from API "Prélèvements en eau"}
-\usage{
-get_prelevements_chroniques(
-  params,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by device, year and usage.
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-prelevements-eau}
-}
-\examples{
-# Retrieve the withdrawal time series of the devices located in Romilly-sur-Seine
-get_prelevements_chroniques(list(code_commune_insee = "10323"))
-
-}
diff --git a/man/get_prelevements_ouvrages.Rd b/man/get_prelevements_ouvrages.Rd
deleted file mode 100644
index 80f51d9..0000000
--- a/man/get_prelevements_ouvrages.Rd
+++ /dev/null
@@ -1,28 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_prelevements_ouvrages.R
-\name{get_prelevements_ouvrages}
-\alias{get_prelevements_ouvrages}
-\title{Retrieve withdrawal devices from API "Prélèvements en eau"}
-\usage{
-get_prelevements_ouvrages(
-  params,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by device.
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-prelevements-eau}
-}
-\examples{
-# Retrieve the withdrawal devices located in Romilly-sur-Seine
-get_prelevements_ouvrages(list(code_commune_insee = "10323"))
-
-}
diff --git a/man/get_prelevements_points_prelevement.Rd b/man/get_prelevements_points_prelevement.Rd
deleted file mode 100644
index 3c76aac..0000000
--- a/man/get_prelevements_points_prelevement.Rd
+++ /dev/null
@@ -1,28 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/get_prelevements_points_prelevement.R
-\name{get_prelevements_points_prelevement}
-\alias{get_prelevements_points_prelevement}
-\title{Retrieve withdrawal points from API "Prélèvements en eau"}
-\usage{
-get_prelevements_points_prelevement(
-  params,
-  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
-)
-}
-\arguments{
-\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
-
-\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
-configuration}
-}
-\value{
-a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by withdrawal point.
-}
-\description{
-See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-prelevements-eau#/prelevements/prelevement}
-}
-\examples{
-# Retrieve the withdrawal points located in Romilly-sur-Seine
-get_prelevements_points_prelevement(list(code_commune_insee = "10323"))
-
-}
-- 
GitLab