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: 27 × 39
#>    code_site libelle_s…¹ type_…² coord…³ coord…⁴ code_…⁵ longi…⁶ latit…⁷ altit…⁸
#>    <chr>     <chr>       <chr>     <dbl>   <dbl>   <int>   <dbl>   <dbl>   <dbl>
#>  1 F3550001  La Vanne à… REEL     752416 6793820      26    3.71    48.2     115
#>  2 H0100020  La Seine à… REEL     810441 6767194      26    4.48    48.0     179
#>  3 H0203020  La Laignes… REEL     801571 6763252      26    4.36    48.0     180
#>  4 H0210010  La Seine à… REEL     802885 6774610      26    4.38    48.1     158
#>  5 H0321040  L'Ource à … REEL     804893 6776215      26    4.41    48.1     159
#>  6 H0400010  La Seine à… REEL     802511 6780502      26    4.38    48.1     148
#>  7 H0400020  La Seine à… REEL     799402 6782747      26    4.34    48.1     143
#>  8 H0413010  La Sarce à… REEL     796857 6783149      26    4.30    48.1     140
#>  9 H0503010  L'Hozain à… REEL     782364 6794544      26    4.11    48.2     111
#> 10 H0702010  La Barse à… REEL     795978 6793759      26    4.29    48.2     118
#> # … with 17 more rows, 30 more variables: 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>, libelle_commune <chr>,
#> #   code_departement <chr>, code_region <chr>, libelle_region <chr>,
#> #   code_cours_eau <chr>, libelle_cours_eau <chr>, uri_cours_eau <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: 28 × 39
#>    code_site libelle_s…¹ type_…² coord…³ coord…⁴ code_…⁵ longi…⁶ latit…⁷ altit…⁸
#>    <chr>     <chr>       <chr>     <dbl>   <dbl>   <int>   <dbl>   <dbl>   <dbl>
#>  1 F3550001  La Vanne à… REEL     752416 6793820      26    3.71    48.2     115
#>  2 H0100020  La Seine à… REEL     810441 6767194      26    4.48    48.0     179
#>  3 H0203020  La Laignes… REEL     801571 6763252      26    4.36    48.0     180
#>  4 H0203020  La Laignes… REEL     801571 6763252      26    4.36    48.0     180
#>  5 H0210010  La Seine à… REEL     802885 6774610      26    4.38    48.1     158
#>  6 H0321040  L'Ource à … REEL     804893 6776215      26    4.41    48.1     159
#>  7 H0400010  La Seine à… REEL     802511 6780502      26    4.38    48.1     148
#>  8 H0400020  La Seine à… REEL     799402 6782747      26    4.34    48.1     143
#>  9 H0413010  La Sarce à… REEL     796857 6783149      26    4.30    48.1     140
#> 10 H0503010  L'Hozain à… REEL     782364 6794544      26    4.11    48.2     111
#> # … with 18 more rows, 30 more variables: 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>, libelle_commune <chr>,
#> #   code_departement <chr>, code_region <chr>, libelle_region <chr>,
#> #   code_cours_eau <chr>, libelle_cours_eau <chr>, uri_cours_eau <chr>, …

# Retrieve the hydrometric stations in the department of Aube
get_hydrometrie_stations(code_departement = "10")
#> # A tibble: 33 × 42
#>    code_site libelle_s…¹ code_…² libel…³ type_…⁴ coord…⁵ coord…⁶ code_…⁷ longi…⁸
#>    <chr>     <chr>       <chr>   <chr>   <chr>     <dbl>   <dbl>   <int>   <dbl>
#>  1 F1280001  La Voire à… F12800… La Voi… DEB     807678.  6.82e6      26    4.46
#>  2 F2110001  La Seine a… F21100… La Sei… LIMNI   733623   6.82e6      26    3.45
#>  3 F2110001  La Seine a… F21100… La Sei… LIMNI   733612   6.82e6      26    3.45
#>  4 F3550001  La Vanne à… F35500… La Van… LIMNI   752416   6.79e6      26    3.71
#>  5 H0100020  La Seine à… H01000… La Sei… LIMNI   810441   6.77e6      26    4.48
#>  6 H0203020  La Laignes… H02030… La Lai… LIMNI   801571   6.76e6      26    4.36
#>  7 H0210010  La Seine à… H02100… La Sei… LIMNI   802885   6.77e6      26    4.38
#>  8 H0321040  L'Ource à … H03210… L'Ourc… LIMNI   804893   6.78e6      26    4.41
#>  9 H0400010  La Seine à… H04000… La Sei… LIMNI   802352   6.78e6      26    4.38
#> 10 H0400020  La Seine à… H04000… La Sei… LIMNI   799402   6.78e6      26    4.34
#> # … with 23 more rows, 33 more variables: 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>,
#> #   libelle_cours_eau <chr>, uri_cours_eau <chr>, descriptif_station <chr>,
#> #   date_maj_station <chr>, date_ouverture_station <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: 659 × 14
#>    code_site code_stat…¹ date_…² resul…³ date_…⁴ code_…⁵ libel…⁶ code_…⁷ libel…⁸
#>    <chr>     <chr>       <chr>     <dbl> <chr>     <int> <chr>     <int> <chr>  
#>  1 H0203020  H020302001  1968-0…    6246 2021-0…      16 Donnée…      12 Interp…
#>  2 H0203020  H020302001  1968-0…    3578 2021-0…      16 Donnée…      12 Interp…
#>  3 H0203020  H020302001  1968-0…    1993 2021-0…      16 Donnée…      12 Interp…
#>  4 H0203020  H020302001  1968-0…    4934 2021-0…      16 Donnée…      12 Interp…
#>  5 H0203020  H020302001  1968-0…    1610 2021-0…      16 Donnée…      12 Interp…
#>  6 H0203020  H020302001  1968-0…    1022 2021-0…      16 Donnée…      12 Interp…
#>  7 H0203020  H020302001  1968-0…    1040 2021-0…      16 Donnée…      12 Interp…
#>  8 H0203020  H020302001  1968-0…    3451 2021-0…      16 Donnée…      12 Interp…
#>  9 H0203020  H020302001  1968-1…    4242 2021-0…      16 Donnée…      12 Interp…
#> 10 H0203020  H020302001  1968-1…    2675 2021-0…      16 Donnée…      12 Interp…
#> # … with 649 more rows, 5 more variables: code_qualification <int>,
#> #   libelle_qualification <chr>, longitude <dbl>, latitude <dbl>,
#> #   grandeur_hydro_elab <chr>, and abbreviated variable names ¹​code_station,
#> #   ²​date_obs_elab, ³​resultat_obs_elab, ⁴​date_prod, ⁵​code_statut,
#> #   ⁶​libelle_statut, ⁷​code_methode, ⁸​libelle_methode

# 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")
#> # A tibble: 30 × 14
#>    code_site code_stat…¹ date_…² resul…³ date_…⁴ code_…⁵ libel…⁶ code_…⁷ libel…⁸
#>    <chr>     <chr>       <chr>     <dbl> <chr>     <int> <chr>     <int> <chr>  
#>  1 H0203020  H020302002  2023-0…    2418 2023-0…       4 Donnée…      12 Interp…
#>  2 H0203020  H020302002  2023-0…    2305 2023-0…       4 Donnée…      12 Interp…
#>  3 H0203020  H020302002  2023-0…    2245 2023-0…       4 Donnée…      12 Interp…
#>  4 H0203020  H020302002  2023-0…    2244 2023-0…       4 Donnée…      12 Interp…
#>  5 H0203020  H020302002  2023-0…    2181 2023-0…       4 Donnée…      12 Interp…
#>  6 H0203020  H020302002  2023-0…    2089 2023-0…       4 Donnée…      12 Interp…
#>  7 H0203020  H020302002  2023-0…    1921 2023-0…       4 Donnée…      12 Interp…
#>  8 H0203020  H020302002  2023-0…    2014 2023-0…       4 Donnée…      12 Interp…
#>  9 H0203020  H020302002  2023-0…    1889 2023-0…       4 Donnée…      12 Interp…
#> 10 H0203020  H020302002  2023-0…    1898 2023-0…       4 Donnée…      12 Interp…
#> # … with 20 more rows, 5 more variables: code_qualification <int>,
#> #   libelle_qualification <chr>, longitude <dbl>, latitude <dbl>,
#> #   grandeur_hydro_elab <chr>, and abbreviated variable names ¹​code_station,
#> #   ²​date_obs_elab, ³​resultat_obs_elab, ⁴​date_prod, ⁵​code_statut,
#> #   ⁶​libelle_statut, ⁷​code_methode, ⁸​libelle_methode
# }