check_algaebase_api: Check AlgaeBase API Operational Status

View source: R/algaebase_api_functions.R

check_algaebase_apiR Documentation

Check AlgaeBase API Operational Status

Description

Internal function to verify whether the AlgaeBase API is operational. It sends a request to a stable genus endpoint to confirm API availability.

Usage

check_algaebase_api(apikey = NULL, genus_id = 43375)

Arguments

apikey

A string. The API key for accessing the AlgaeBase API. Defaults to NULL.

genus_id

A numeric value. The unique genus ID used to test the API endpoint. Default is 43375, corresponding to the Haematococcus genus record in AlgaeBase.

Details

This function performs a GET request to the AlgaeBase API using a stable genus ID to ensure that the API is accessible and that the provided API key is valid. It is used internally to prevent unnecessary queries when the API is unavailable.

Value

A logical value: TRUE if the API is operational, FALSE otherwise.

Examples

## Not run: 
# Check API status with an API key
check_algaebase_api(apikey = "your_api_key")

## End(Not run)


sharksmhi/SHARK4R documentation built on Jan. 9, 2025, 5:15 p.m.