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: https://hubeau.eaufrance.fr/page/api-hydrometrie

get_hydrometrie_obs_elab(...)

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

get_hydrometrie_sites(..., unique_site = TRUE)

get_hydrometrie_stations(..., code_sandre_reseau_station = FALSE)

Arguments

...

parameters of the queries and their values in the format Param1_Name = "Param1 value", Param2_Name = "Param2 value", 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

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

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

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

Value

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

Examples

# \dontrun{
# Retrieve the hydrometric sites in the department of Aube
get_hydrometrie_sites(code_departement = "10")
#> Warning: The site 'H0203020' has 2 different locations, only the first one is returned
#> # A tibble: 62 × 39
#>    code_site libelle_site          type_site coordonnee_x_site coordonnee_y_site
#>    <chr>     <chr>                 <chr>                 <dbl>             <dbl>
#>  1 F0500001  L'Arce à Merrey-sur-… PONCTUEL             805900           6778301
#>  2 F0520001  La Sarce à Villemori… PONCTUEL             796766           6776813
#>  3 F0730001  L'Hozain à Isle-Aumo… PONCTUEL             783867           6790744
#>  4 F0740001  L'Ousse à Villemereu… PONCTUEL             780089           6789666
#>  5 F0760001  La Hurande à Saint-P… PONCTUEL             778947           6792485
#>  6 F0800001  La Barse à Vendeuvre… PONCTUEL             809868           6793712
#>  7 F0800002  Le ru de Beurey à Ve… PONCTUEL             808870           6793587
#>  8 F0820001  La Boderonne à Villy… PONCTUEL             802551           6789629
#>  9 F1170001  La Bresse à Bar-sur-… PONCTUEL             827499           6794108
#> 10 F1190001  Le Landion à Spoy     PONCTUEL             820567           6793199
#> # ℹ 52 more rows
#> # ℹ 34 more variables: code_projection <int>, longitude_site <dbl>,
#> #   latitude_site <dbl>, altitude_site <dbl>, code_systeme_alti_site <int>,
#> #   surface_bv <dbl>, statut_site <int>, premier_mois_etiage_site <int>,
#> #   premier_mois_annee_hydro_site <int>, influence_generale_site <int>,
#> #   code_entite_hydro_site <chr>, code_troncon_hydro_site <chr>,
#> #   code_commune_site <chr>, code_zone_hydro_site <chr>, …

# The same operation returning 2 rows for the site 'H0203020' which has 2 different locations
get_hydrometrie_sites(code_departement = "10", unique_site = FALSE)
#> # A tibble: 63 × 39
#>    code_site libelle_site          type_site coordonnee_x_site coordonnee_y_site
#>    <chr>     <chr>                 <chr>                 <dbl>             <dbl>
#>  1 F0500001  L'Arce à Merrey-sur-… PONCTUEL             805900           6778301
#>  2 F0520001  La Sarce à Villemori… PONCTUEL             796766           6776813
#>  3 F0730001  L'Hozain à Isle-Aumo… PONCTUEL             783867           6790744
#>  4 F0740001  L'Ousse à Villemereu… PONCTUEL             780089           6789666
#>  5 F0760001  La Hurande à Saint-P… PONCTUEL             778947           6792485
#>  6 F0800001  La Barse à Vendeuvre… PONCTUEL             809868           6793712
#>  7 F0800002  Le ru de Beurey à Ve… PONCTUEL             808870           6793587
#>  8 F0820001  La Boderonne à Villy… PONCTUEL             802551           6789629
#>  9 F1170001  La Bresse à Bar-sur-… PONCTUEL             827499           6794108
#> 10 F1190001  Le Landion à Spoy     PONCTUEL             820567           6793199
#> # ℹ 53 more rows
#> # ℹ 34 more variables: code_projection <int>, longitude_site <dbl>,
#> #   latitude_site <dbl>, altitude_site <dbl>, code_systeme_alti_site <int>,
#> #   surface_bv <dbl>, statut_site <int>, premier_mois_etiage_site <int>,
#> #   premier_mois_annee_hydro_site <int>, influence_generale_site <int>,
#> #   code_entite_hydro_site <chr>, code_troncon_hydro_site <chr>,
#> #   code_commune_site <chr>, code_zone_hydro_site <chr>, …

# Retrieve the hydrometric stations in the department of Aube
get_hydrometrie_stations(code_departement = "10")
#> # A tibble: 35 × 42
#>    code_site libelle_site              code_station libelle_station type_station
#>    <chr>     <chr>                     <chr>        <chr>           <chr>       
#>  1 F1280001  La Voire à Bétignicourt   F128000101   La Voire à Bét… DEB         
#>  2 F2100001  La Seine à Nogent-sur-Se… F210000101   La Seine à Nog… STD         
#>  3 F2100001  La Seine à Nogent-sur-Se… F210000102   La Seine à Nog… STD         
#>  4 F2110001  La Seine au Mériot        F211000101   La Seine au Mé… STD         
#>  5 F2110001  La Seine au Mériot        F211000102   La Seine au Mé… STD         
#>  6 F2110003  Le canal de dérivation d… F211000301   Le canal de dé… STD         
#>  7 F2110003  Le canal de dérivation d… F211000302   Le canal de dé… STD         
#>  8 H0100020  La Seine à Plaines-Saint… H010002001   La Seine à Pla… STD         
#>  9 H0203020  La Laignes aux Riceys et… H020302002   La Laignes aux… STD         
#> 10 H0210010  La Seine à Polisy         H021001001   La Seine à Pol… STD         
#> # ℹ 25 more rows
#> # ℹ 37 more variables: coordonnee_x_station <dbl>, coordonnee_y_station <dbl>,
#> #   code_projection <int>, longitude_station <dbl>, latitude_station <dbl>,
#> #   influence_locale_station <int>, commentaire_station <chr>,
#> #   altitude_ref_alti_station <dbl>, code_systeme_alti_site <int>,
#> #   code_commune_station <chr>, libelle_commune <chr>, code_departement <chr>,
#> #   code_region <chr>, libelle_region <chr>, code_cours_eau <chr>, …

# Which parameters are available for endpoint "obs_elab" of API "hydrometrie"?
list_params("hydrometrie", "obs_elab")
#>  [1] "bbox"                "code_entite"         "cursor"             
#>  [4] "date_debut_obs_elab" "date_fin_obs_elab"   "distance"           
#>  [7] "fields"              "grandeur_hydro_elab" "latitude"           
#> [10] "longitude"           "resultat_max"        "resultat_min"       
#> [13] "size"               

# Retrieve the hydrometric monthly mean flow at site 'H0203020'
get_hydrometrie_obs_elab(code_entite = "H0203020", grandeur_hydro_elab = "QmM")
#> # A tibble: 1,358 × 14
#>    code_site code_station date_obs_elab resultat_obs_elab date_prod  code_statut
#>    <chr>     <chr>        <chr>                     <dbl> <chr>            <int>
#>  1 H0203020  H020302001   1968-02-01                 6246 2025-04-2…          16
#>  2 H0203020  H020302001   1968-03-01                 3578 2025-04-2…          16
#>  3 H0203020  H020302001   1968-04-01                 1993 2025-04-2…          16
#>  4 H0203020  H020302001   1968-05-01                 4934 2025-04-2…          16
#>  5 H0203020  H020302001   1968-06-01                 1610 2025-04-2…          16
#>  6 H0203020  H020302001   1968-07-01                 1022 2025-04-2…          16
#>  7 H0203020  H020302001   1968-08-01                 1040 2025-04-2…          16
#>  8 H0203020  H020302001   1968-09-01                 3451 2025-04-2…          16
#>  9 H0203020  H020302001   1968-10-01                 4242 2025-04-2…          16
#> 10 H0203020  H020302001   1968-11-01                 2675 2025-04-2…          16
#> # ℹ 1,348 more rows
#> # ℹ 8 more variables: libelle_statut <chr>, code_methode <int>,
#> #   libelle_methode <chr>, code_qualification <int>,
#> #   libelle_qualification <chr>, longitude <dbl>, latitude <dbl>,
#> #   grandeur_hydro_elab <chr>

# Retrieve the hydrometric daily mean flow at site 'H0203020' of the last 30 days
get_hydrometrie_obs_elab(code_entite = "H0203020",
                         date_debut_obs_elab = format(Sys.Date() -30, "%Y-%m-%d"),
                         grandeur_hydro_elab = "QmJ")
#> Warning: The parameter `grandeur_hydro_elab = "QmJ"` is deprecated, use `grandeur_hydro_elab = "QmnJ"` instead.
#> # A tibble: 60 × 14
#>    code_site code_station date_obs_elab resultat_obs_elab date_prod  code_statut
#>    <chr>     <chr>        <chr>                     <dbl> <chr>            <int>
#>  1 H0203020  H020302002   2025-03-29                 3418 2025-04-2…           4
#>  2 H0203020  H020302002   2025-03-30                 3301 2025-04-2…           4
#>  3 H0203020  H020302002   2025-03-31                 3215 2025-04-2…           4
#>  4 H0203020  H020302002   2025-04-01                 3157 2025-04-2…           4
#>  5 H0203020  H020302002   2025-04-02                 3061 2025-04-2…           4
#>  6 H0203020  H020302002   2025-04-03                 3061 2025-04-2…           4
#>  7 H0203020  H020302002   2025-04-04                 2874 2025-04-2…           4
#>  8 H0203020  H020302002   2025-04-05                 2878 2025-04-2…           4
#>  9 H0203020  H020302002   2025-04-06                 2817 2025-04-2…           4
#> 10 H0203020  H020302002   2025-04-07                 2752 2025-04-2…           4
#> # ℹ 50 more rows
#> # ℹ 8 more variables: libelle_statut <chr>, code_methode <int>,
#> #   libelle_methode <chr>, code_qualification <int>,
#> #   libelle_qualification <chr>, longitude <dbl>, latitude <dbl>,
#> #   grandeur_hydro_elab <chr>
# }