Provides R functions for querying the U.S. Fish and Wildlife Service ServCat REST API. The package includes helpers for searching references, retrieving reference records and reference-associated metadata, downloading digital files, retrieving saved-collection contents, and accessing ServCat fixed-list lookup values.
Details
The package uses the public ServCat API by default. Functions that support
secured services include secure and api_key arguments. If secure = TRUE
and api_key is omitted, the package attempts to read an API key from the
SERVCAT_API_KEY environment variable.
Most metadata functions return tibbles. Detailed reference profile requests return named lists because the ServCat API response contains nested metadata. Nested API fields, such as linked resources or associated units in composite search results, may be returned as list-columns.
Search functions return one page of results by default. search_references()
can retrieve all pages with all_pages = TRUE, and stores ServCat paging
metadata in the "page_detail" attribute of the returned tibble.
File downloads are performed by download_files(), which returns a tibble
reporting the local file path, download status, and any per-file error
message.
Main functions
get_references()retrieves detailed ServCat reference profiles by reference ID.get_reference_summaries()retrieves summary metadata for one or more ServCat reference IDs.search_references()executes ServCat Advanced Search requests, including optional composite results and all-page retrieval.get_collection_references()retrieves references in a saved collection.download_files()downloads one or more ServCat digital files from a reference.service_version()returns the ServCat service version.
Reference metadata functions
get_owners()retrieves owners associated with a reference.get_keywords()retrieves keywords associated with a reference.get_links()retrieves external links associated with a reference.get_files()retrieves digital file metadata associated with a reference.get_bibliography()retrieves bibliography metadata for a reference.get_lifecycle()retrieves lifecycle metadata for a reference.get_units()retrieves units associated with a reference.get_bboxes()retrieves geographic bounding boxes associated with a reference.get_subjects()retrieves subject categories associated with a reference.get_taxa()retrieves taxa associated with a reference.
Lookup-list functions
list_access_constraints()lists access constraint values.list_date_precisions()lists date precision values.list_file_tags()lists file tag values.list_reference_type_groups()lists reference type groups.list_reference_types()lists reference types.list_subject_categories()lists subject category values.list_web_service_types()lists web service type values.
Internal helpers
Internal helper functions support request construction, retry and timeout behavior, response validation, fixed-list lookup retrieval, JSON conversion, file-download path construction, and input validation.
Author
Maintainer: McCrea Cobb mccrea_cobb@fws.gov (ORCID)
