Package 'statsearchanalyticsr'

Title: An Interface for the 'STAT Search Analytics' API
Description: Pull data from the 'STAT Search Analytics' API <https://help.getstat.com/knowledgebase/api-services/>. It was developed by the Search Discovery team to help analyze keyword ranking data.
Authors: Ben Woodard [aut, cre], Chima Umeakunne [ctb], Search Discovery, LLC [own] (Visit SearchDiscovery.com for more information)
Maintainer: Ben Woodard <[email protected]>
License: MIT + file LICENSE
Version: 0.1.4.9000
Built: 2025-02-10 03:59:08 UTC
Source: https://github.com/sditools/statsearchanalyticsr

Help Index


Get Bulk Rankings Report

Description

Retrieve a bulk report of all the rankings or for specific sites.

Usage

ssar_bulk_rankings(
  date = Sys.Date() - 1,
  siteid = NULL,
  ranktype = "highest",
  engines = c("google", "bing"),
  currentlytracked = TRUE,
  crawledkeywords = TRUE,
  subdomain = Sys.getenv("SSAR_SUBDOMAIN"),
  apikey = Sys.getenv("SSAR_APIKEY")
)

Arguments

date

The date being requested (required) in 'YYYY-MM-DD' format. Default is set to yesterday.

siteid

The site id. If not provided then all sites will be returned. Comma separated list of specific site IDs, default is all sites.

ranktype

This argument changes the call between getting the highest ranks for the keywords for the date with the value highest, or getting all the ranks for each engine for a keyword for a date with the value all. Defaults to highest if not provided.

engines

This argument lets you choose which search engines to include in the export, defaulting to Google and Bing. Engines can be passed in comma separated to get multiple.

currentlytracked

This argument will cause the API to ouptput only keywords which currently have tracking on at the time the API request is generated.

crawledkeywords

This argument causes the API to only include output for keywords that were crawled on the date argument provided.

subdomain

The account subdomain

apikey

The api key from the account

Value

The dataframe with all keywords ranking information for the requested date


Request Bulk Report

Description

Retrieve a bulk report using a bulk report id. Intended to be used with the get_bulk_rankings function but can be used independently as well.

Usage

ssar_bulk_request(
  id = NULL,
  subdomain = Sys.getenv("SSAR_SUBDOMAIN"),
  apikey = Sys.getenv("SSAR_APIKEY")
)

Arguments

id

Id of the bulk job #required

subdomain

The account subdomain

apikey

The api key from the account

Value

list of the bulk keyword ranking report for the requested ID

Examples

## Not run: 
ssar_bulk_request(id = {report_id})

## End(Not run)

Get Keywords

Description

Retrieve a table of all the keywords in a particular site and the corresponding metadata

Usage

ssar_keywords(
  siteid = NULL,
  start = 0,
  results = 100,
  subdomain = Sys.getenv("SSAR_SUBDOMAIN"),
  apikey = Sys.getenv("SSAR_APIKEY")
)

Arguments

siteid

The site id (required)

start

The default is 0 (zero indexed)

results

The default is 100

subdomain

The account subdomain

apikey

The api key from the account

Value

A dataframe of keywords along with 29 other columns of data

Examples

## Not run: 
ssar_keywords(siteid = {site_id} ) #replace is your site id

## End(Not run)

Get Projects

Description

Receive a list of all the projects on an account accessible through the provided api key

Usage

ssar_projects(
  subdomain = Sys.getenv("SSAR_SUBDOMAIN"),
  apikey = Sys.getenv("SSAR_APIKEY")
)

Arguments

subdomain

The account subdomain

apikey

The api key from the account

Value

A dataframe of available project data your authentication has access to

Examples

## Not run: 
projects(subdomain = Sys.getenv('SSAR_SUBDOMAIN'),
         apikey = Sys.getenv('SSAR_APIKEY'))

## End(Not run)

Get Rankings

Description

Retrieve a table including metadata for all the sites in a particular project

Usage

ssar_rankings(
  keywordid = NULL,
  fromdate = NULL,
  todate = NULL,
  start = 0,
  results = 100,
  subdomain = Sys.getenv("SSAR_SUBDOMAIN"),
  apikey = Sys.getenv("SSAR_APIKEY")
)

Arguments

keywordid

The keyword id (required)

fromdate

Default is 100 most recent results (optional) Format is a string YYYY-MM-DD

todate

Default is most recent ranking day (optional) Format is a string YYYY-MM-DD

start

The default is 0 (zero indexed). The starting result for paginated requests

results

The default is 100

subdomain

The account subdomain

apikey

The api key from the account

Value

A dataframe of all rankings within a defined date range for a specific keyword

Examples

## Not run: 
ssar_rankings(keywordid = {keyword_id}, #replace with your keyword_id 
              fromdate = '2021-01-01', 
              todate = '2021-04-01')

## End(Not run)

Get Sites

Description

Retrieve a table of all the sites and metadata in a specified project

Usage

ssar_sites(
  projectid = NULL,
  start = NULL,
  results = 100,
  subdomain = Sys.getenv("SSAR_SUBDOMAIN"),
  apikey = Sys.getenv("SSAR_APIKEY")
)

Arguments

projectid

The project id. If not provided then all sites will be returned.

start

If more than results are available use start as pagination. Index starts at 0 (default).

results

Default is 100. Max is 5000.

subdomain

The account subdomain

apikey

The api key from the account

Value

A table of the site information within a project

Examples

## Not run: 
ssar_sites(projectid = {project_id}, #replace with your project id
           results = 300)

## End(Not run)

Get Sites Ranking Distribution

Description

This function returns all ranking distribution records for Google and Bing for a site with the specified id. The maximum date range can be no greater than 31 days.

Usage

ssar_sites_ranking_dist(
  siteid = NULL,
  fromdate = as.character(Sys.Date() - 31),
  todate = as.character(Sys.Date() - 1),
  subdomain = Sys.getenv("SSAR_SUBDOMAIN"),
  apikey = Sys.getenv("SSAR_APIKEY")
)

Arguments

siteid

Required The site id.

fromdate

Required Character string in the 'YYYY-MM-DD' format. Default is -31 days from today since the maximum date range can be no greater than 31 days.

todate

Required Character string in the 'YYYY-MM-DD' format. Default is yesterday.

subdomain

The account subdomain

apikey

The api key from the account

Value

A table with Google, GoogleBaseRank, and Bing ranking distributions by date

Examples

## Not run: 
ssar_sites_ranking_dist(siteid = {site_id}, #replace is your site id
                       fromdate = '2021-04-01',
                       todate = '2021-05-31')

## End(Not run)