This vignette demonstrates a typical workflow using the bunddev package to discover an API, inspect its parameters, set up authentication (if needed), retrieve tidy data, and visualise it.
# Show the first few entries in the bundled registry
available <- bunddev_registry()
head(available)You can filter by tag or authentication type, for example:
Suppose we are interested in the SMARD electricity market API.
You can store your API keys securely in a .Renviron
file, which R loads automatically at startup. Add a line like the
following to ~/.Renviron (or a project‑specific
.Renviron in the package root):
SMARD_API_KEY=your-secret-key
Then reference the variable in R without hard‑coding the key:
Alternatively, for a quick session you can set the variable directly
with Sys.setenv() as shown earlier.
Fetch a time‑series from SMARD and flatten list‑columns:
If you need to enforce a custom rate limit:
All functions come with detailed help pages (e.g.,
?smard_timeseries). Use bunddev_parameters()
and bunddev_parameter_values() to explore allowed enum
values.
This vignette is intentionally simple and runs without contacting any live API (except when you actually execute the examples). It is designed to work during package checks and as a quick reference for users.