sst_call_api_method: Make a request to Serpstat API endpoint

View source: R/utility_functions.R

sst_call_api_methodR Documentation

Make a request to Serpstat API endpoint

Description

Make a request to Serpstat API endpoint

Usage

sst_call_api_method(api_token, api_method, api_params = NULL)

Arguments

api_token

Serpstat API token from the profile page.

api_method

Internal name of API method.

api_params

A list of API parameters used by api_method. More information about parameters in the official docs.

Value

The list with a response data.

Examples


api_params <- list(
  query = 'serpstat.com',
  page  = 1,
  size  = 5
  )
tryCatch({
  serpstatr:::sst_call_api_method(
    api_token  = Sys.getenv('SERPSTAT_API_TOKEN'),
    api_method = 'SerpstatLimitsProcedure.getStats',
    api_params = api_params
    )
})


serpstatr documentation built on Sept. 9, 2023, 5:06 p.m.