import requests
from requests.auth import HTTPBasicAuth
from urllib.parse import urlencode
import pandas as pd
import matplotlib.pyplot as plt
# set host, like http://localhost:8000, to where your Data Hub is running
HOST = ''
# in case of basic auth set to HTTPBasicAuth('user', 'password')
AUTH = None
q = {
'datalayer_key': 'copernicus_herbwet',
# Optional filters to narrow down the returned data:
#'shape_id': '',
#'shape_type': '',
#'start_date': '',
#'end_date': '',
}
d = requests.get(f"{HOST}/api/datalayers/data/?{urlencode(q)}", auth=AUTH).json()
copernicus_herbwet_df = pd.DataFrame(d['data'])
copernicus_herbwet_df['year'] = pd.to_datetime(copernicus_herbwet_df['year'], format="%Y")
There is no ready use snippet for API usage in R yet, though you can adapt the Python example to your R needs.