List food and product warnings
Source:R/adapt_lebensmittelwarnung.R
lebensmittelwarnung_warnings.RdList food and product warnings
Arguments
- food
Optional request options for food warnings (rows, start, sort, fq).
- products
Optional request options for product warnings (rows, start, sort, fq).
- safe
Logical; if
TRUE(default), apply rate-limiting and cache GET responses totools::R_user_dir("bunddev", "cache").- refresh
Logical; if
TRUE, ignore cached responses and re-fetch from the API (defaultFALSE).- flatten
Logical; if
TRUE, simplify nested list columns according toflatten_mode. DefaultFALSEkeeps list columns as-is.- flatten_mode
How to handle list columns when
flatten = TRUE:"drop"Remove list columns entirely. Use when nested data is not needed.
"json"Convert each list element to a JSON string. Preserves all data in a text-queryable format. This is the default.
"unnest"Expand list columns into multiple rows via
tidyr::unnest_longer(). Warning: this can significantly increase the number of rows.
Value
A tibble with one row per warning:
- type
Warning type from the source index (character).
- archived
Whether the warning is archived (
TRUE/FALSE).- id
Warning identifier (integer).
- link
Link to the warning details page (character).
- title
Warning title (character).
- warning
Warning text/summary (character).
- affected_states
Affected German states (list-column).
- product
Structured product details (list-column).
- rapex_information
RAPEX metadata when present (list-column).
- safety_information
Additional safety metadata (list-column).
- published_date
Published timestamp in milliseconds since epoch (numeric).
- published_date_time
Published timestamp as
POSIXctin Europe/Berlin.- num_found
Total number of matching warnings in the response (integer).
Details
The Lebensmittelwarnungen API returns German food and product safety warnings.
Requests are sent as JSON to the warnings/merged endpoint. API documentation: https://lebensmittelwarnung.api.bund.dev.
https://github.com/bundesAPI/lebensmittelwarnung-api.
The API expects an Authorization header. By default the adapter uses the
public key documented in the OpenAPI spec. Override it with
bunddev_auth_set() if needed.
See also
bunddev_auth_set() to configure the authorization header.