item_get | R Documentation |
Retrieves an item and its metadata from ScienceBase based on its unique ID. Errors if the requested item ID does not exist or access is restricted due to permissions.
item_get(sb_id, ...)
sb_id |
An |
... |
Additional parameters are passed on to |
An object of class sbitem
# Get an item
item_get("4f4e4b24e4b07f02db6aea14")
# Search for item IDs, then pass to item_get
library("httr")
res <- query_items(list(s = "Search", q = "water", format = "json"))
if(inherits(res, "response") && res$status != 404) {
ids <- vapply(httr::content(res)$items, "[[", "", "id")
lapply(ids[1:3], item_get)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.