Good evening everyone,
I need your help on a script.
fetch('https://hubeau.eaufrance.fr/api/v1/hydrometrie/observations_tr?code_entite=H505012001&size=3&pretty&grandeur_hydro=H&fields=code_station,date_debut_serie,date_fin_serie,date_obs,resultat_obs,continuite_obs_hydro')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.log(error));
I get this response
count: 8611,
first: 'https://hubeau.eaufrance.fr/api/v1/hydrometrie/observations_tr?code_entite=H505012001&pretty&grandeur_hydro=H&fields=code_station,date_debut_serie,date_fin_serie,date_obs,resultat_obs,continuite_obs_hydro&cursor=&size=3',
prev: null,
next: 'https://hubeau.eaufrance.fr/api/v1/hydrometrie/observations_tr?code_entite=H505012001&pretty&grandeur_hydro=H&fields=code_station,date_debut_serie,date_fin_serie,date_obs,resultat_obs,continuite_obs_hydro&cursor=AoJw6KDW54sDPwxINTA1MDEyMF9INTA1MDEyMDAxX0hfNF8yMDIzLTExLTE0VDE5OjQwOjAw&size=3',
api_version: '1.0.1',
data: [
{
code_station: 'H505012001',
date_debut_serie: '2023-11-14T00:05:00Z',
date_fin_serie: '2023-11-14T19:50:00Z',
date_obs: '2023-11-14T19:50:00Z',
resultat_obs: 5750,
continuite_obs_hydro: true
},
{
code_station: 'H505012001',
date_debut_serie: '2023-11-14T00:05:00Z',
date_fin_serie: '2023-11-14T19:50:00Z',
date_obs: '2023-11-14T19:45:00Z',
resultat_obs: 5780,
continuite_obs_hydro: true
},
{
code_station: 'H505012001',
date_debut_serie: '2023-11-14T00:05:00Z',
date_fin_serie: '2023-11-14T19:50:00Z',
date_obs: '2023-11-14T19:40:00Z',
resultat_obs: 5820,
continuite_obs_hydro: true
}
]
}
How to extract just the first result from resultat_obs ?
Thank you so mutch