brapi_get_call | R Documentation |
Fetches data from an API endpoint, handles pagination by retrieving all pages, and consolidates the results into a single data frame.
brapi_get_call(call_url, nested = TRUE)
call_url |
Character string specifying the base URL of the API endpoint to request. |
nested |
Logical value indicating whether to flatten nested lists in the JSON responses. Defaults to |
This function performs the following steps:
Fetches the first page synchronously to determine the total number of pages.
If multiple pages exist, it asynchronously fetches the remaining pages using get_async_pages()
.
Consolidates the data from all pages into a single data frame.
Updates global state variables with pagination information.
It relies on global variables from qbms_globals
to manage state and configuration.
A list containing the consolidated data and associated metadata from the API response.
Khaled Al-Shamaa, k.el-shamaa@cgiar.org
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.