Package 'glassdoor'

Title: Interface to 'Glassdoor' API
Description: Interacts with the 'Glassdoor' API <https://www.glassdoor.com/developer/index.htm>. Allows the user to search job statistics, employer statistics, and job progression, where 'Glassdoor' provides a breakdown of other jobs a person did after their current one.
Authors: John Muschelli [aut, cre]
Maintainer: John Muschelli <[email protected]>
License: GPL-2
Version: 0.8.1
Built: 2024-10-31 16:33:19 UTC
Source: https://github.com/muschellij2/glassdoor

Help Index


General Glassdoor API function

Description

General Glassdoor API function

Usage

gd_api(query = NULL, action = NULL, agent = gd_user_agent(),
  version = 1, format = "json", url = gd_url(), pid = gd_pid(),
  pat = gd_pat(), ip_address = NULL, add_query = NULL, ...)

Arguments

query

Additional options to pass to the query other than those specified here

action

The particular API call that you would like to make

agent

The User-Agent (browser) of the end user to whom the API results will be shown. Note that you can can obtain this from the "User-Agent" HTTP request header from the end-user

version

The API version. The current version is 1 except for jobs, which is currently version 1.1

format

Either xml or json as you prefer

url

Glassdoor RESTful API URL

pid

Your partner id, as assigned by Glassdoor

pat

Your partner key, as assigned by Glassdoor

ip_address

The IP address of the end user to whom the API results will be shown

add_query

Additional options to pass to the query other than those specified here (named list)

...

Additional options to send to GET

Value

A list of class gd_api

Examples

if (have_gd_pid() && have_gd_pat()) {
res = gd_api(
action = "employers",
other = NULL,
  version = 1,
format = "json",
query =  "pharmaceuticals")

res = gd_api(
action = "employers",
other = NULL,
 version = 1,
format = "json",
query = "pharmaceuticals", config = list())
}

Glassdoor Company Search

Description

Glassdoor Company Search

Usage

gd_company(query = NULL, ..., location = NULL, city = NULL,
  state = NULL, country = NULL, page_number = NULL,
  page_size = NULL)

gd_employer(query = NULL, ..., location = NULL, city = NULL,
  state = NULL, country = NULL, page_number = NULL,
  page_size = NULL)

gd_company_df(...)

gd_employer_df(...)

Arguments

query

Additional options to pass to the query other than those specified here

...

arguments to pass to gd_api

location

Scope the search to a specific location by specifying it here - city, state, or country.

city

Scope the search to a specific city by specifying it here.

state

Scope the search to a specific state by specifying it here.

country

Scope the search to a specific country by specifying it here.

page_number

Page number to retrieve. Default is 1.

page_size

Page size, i.e. the number of jobs returned on each page of results. Default is 20.

Examples

if (have_gd_tokens()) {

res = gd_company_df("walmart")
head(res[, c("id", "name")])
res = gd_company_df("Target")
res = gd_company("Dropbox")
}

Glassdoor Job Progression

Description

Glassdoor Job Progression

Usage

gd_job_prog(..., jobTitle, countryId = 1, query = NULL)

Arguments

...

arguments to pass to gd_api

jobTitle

Job Title - the job title to get related jobs for

countryId

Country Id - only 1 (US) is supported right now.

query

Additional options to pass to the query other than those specified here

Examples

if (have_gd_tokens()) {

paste0("&countryId=1&jobTitle=cashier")
res = gd_job_prog(jobTitle = "cashier", countryId = 1)
}

Glassdoor Job Stats

Description

Glassdoor Job Stats

Usage

gd_job_stats(..., query = NULL, employer = NULL, location = NULL,
  city = NULL, state = NULL, country = NULL, fromAge = NULL,
  jobType = NULL, minRating = NULL, radius = NULL,
  job_title = NULL, job_category = NULL, returnCities = NULL,
  returnStates = NULL, returnJobTitles = NULL,
  returnEmployers = NULL, admLevelRequested = NULL)

Arguments

...

arguments to pass to gd_api

query

Additional options to pass to the query other than those specified here

employer

Scope the search to a specific employer by specifying the name here.

location

Scope the search to a specific location by specifying it here - city, state, or country.

city

Scope the search to a specific city by specifying it here.

state

Scope the search to a specific state by specifying it here.

country

Scope the search to a specific country by specifying it here.

fromAge

Scope the search to jobs that are less than X days old (-1 = show all jobs (default), 1 = 1 day old, 7 = 1 week old, 14 = 2 weeks old, etc.)

jobType

Scope the search to certain job types. Valid values are all (default), fulltime, parttime, internship, contract, internship, temporary

minRating

Scope the search to jobs of companies with rating >= minRating (0 = returns all (default), 1 = more than 1 star, 2 = more than 2 stars, 3 = more than 3 stars, 4 = more than 4 stars)

radius

Scope the search to jobs within a certain radius, in miles, of the location specified.

job_title

Scope the search to a specific job title by specifying it here.

job_category

Job category id to scope the search to - see the Job Category table below - note you must pass the id. This can be a comma separated list of ids if you desire to select more than one category.

returnCities

Results will include geographical data (job counts) broken down by city.

returnStates

Results will include geographical data (job counts, score) broken down by the type of geographical district specified in parameter admLevelRequested.

returnJobTitles

Results will include job data broken down by job title.

returnEmployers

Results will include job data broken down by employer.

admLevelRequested

Geographic district type requested when returnStates is true (1 = states, 2 = counties)

Examples

if (have_gd_tokens()) {

paste0("returnStates=true&admLevelRequested=1")
res = gd_job_stats(returnStates = TRUE, admLevelRequested = 1)
}

Glassdoor Partner ID

Description

Glassdoor Partner ID

Usage

gd_pid(token = NULL, error = TRUE)

gd_pat(token = NULL, error = TRUE)

have_gd_pid(token = NULL)

have_gd_pat(token = NULL)

have_gd_tokens()

Arguments

token

Partner ID or Authentication token

error

Should the function error if no token specified?

Value

A vector of class character

Examples

if (have_gd_pid()) {
gd_pid()
}

Glassdoor Company Search

Description

Glassdoor Company Search

Usage

gd_review(employer_id, ..., page_number = NULL, page_size = NULL,
  query = NULL)

Arguments

employer_id

Glassdoor ID for the company, can be accessed using gd_company

...

arguments to pass to gd_api

page_number

Page number to retrieve. Default is 1.

page_size

Page size, i.e. the number of jobs returned on each page of results. Default is 20.

query

Additional options to pass to the query other than those specified here

Examples

if (have_gd_tokens()) {
res = gd_review(employer_id = 715) # walmart
}

Glassdoor URL

Description

Glassdoor URL

Usage

gd_url()

Value

Object of class character

Examples

gd_url()

Glassdoor User Agent

Description

Glassdoor User Agent

Usage

gd_user_agent()

Value

Character vector

Examples

gd_user_agent()

Get IP Address

Description

Get IP Address

Usage

get_ip(agent = gd_user_agent())

Arguments

agent

User Agent for Header

Value

Character Vector of IP

Note

Inspired by https://github.com/gregce/ipify/blob/master/R/ipify.R

Examples

get_ip()

Results of a Glassdoor object

Description

Calculates the results from Glassdoor object

Usage

results(gd, ...)

## Default S3 method:
results(gd, ...)

## S3 method for class 'gd_api'
results(gd, ...)

## S3 method for class 'gd_job_prog'
results(gd, ...)

Arguments

gd

an object for which we want the results, the output from a Glassdoor call

...

Any additional arguments to be passed to results.

Value

A class of gd_job_prog will return a list of progression_table and job_info.

Examples

if (have_gd_tokens()) {
   gd = gd_job_prog(jobTitle = "cashier", countryId = 1)
   res = results(gd)
}