ws_api_key: Check API Keys for Various Web of Science APIs

Description Usage Arguments Value Note Examples

Description

Check API Keys for Various Web of Science APIs

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ws_construct_api_key(api_key = NULL, error = TRUE, key_option, sys_env,
  key_filename_option, api_name = "")

ws_api_key(api_key = NULL, error = TRUE, api = names(ws_list_apis()))

ws_api_key_header(api_key = NULL)

ws_list_apis()

ws_auth_header(api_key = NULL)

Arguments

api_key

Web of Science API key

error

Should the function error if api_key = NULL after looking in various places? (See notes)

key_option

option to grab API key using getOption

sys_env

System environment variable to grab API key from Sys.getenv

key_filename_option

Option retrieved from getOption, which is a location of a file with the API key.

api_name

Name of API key

api

an endpoint for the API, see ws_list_apis

Value

API key character string

Note

You can either set the API key using option(ws_API_key) or have it accessible by api_key = Sys.getenv('API_KEY'), where API is one of the Web of Science APIs, such as INCITES

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
api_key = NULL
error = FALSE
  api_key = ws_construct_api_key(
  api_key = api_key,
  error = error,
  key_option = "ws_incites_key",
  sys_env = "INCITES_KEY",
  key_filename_option = "ws_incites_key_filename",
  api_name = "Incites")
ws_list_apis()
ws_auth_header(api_key = "my_api_key")

muschellij2/webofscience documentation built on May 14, 2019, 4:02 a.m.