Skip to contents

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

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

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)