serp_google: Get the search engine results pages.

Description Usage Arguments Details Value Examples

View source: R/serp.R

Description

Get the top ten resuls of any query you want, along with several paramters of the search query; the location of the user, language, and the Google domain where you want the query to be run.

Usage

1
2
serp_google(query, cse_id, api_key, lang = "en", user_loc = "us",
  goog_domain = "com")

Arguments

query

the keyword you want to research

cse_id

your google custom search engine ID

api_key

your API key

lang

a two-letter representation of the user langugae

user_loc

location of the user given with the two-letter ISO code

goog_domain

the domain of Google which you want it to search in Simply enter a keyword, with optional parameters, and get the page of search results returned as a data.frame.

Details

You will need to create an account at Google's Developers Console. You also need to create a custom search engine. Then you will need to supply you API key from the developer console, as well as your custom search engine ID (referred to as "cx" by Google).

Value

A data.frame of the ten search results, as they are ranked, together with the supplied parameters; query, language, location, Google domain, and the time the query was run. Each of those parameters has its own column to aid later in any analysis you want to make.

Examples

1
2
3
4
5
## Not run: 
serp_google("credit card", cse_id = "YOUR_CUSTOM_SEARCH_ENGINE_ID",
api_key = "YOUR_API_KEY", lang = "en", user_loc = "jp", goog_domain = "co.jp")

## End(Not run)

eliasdabbas/radvertools documentation built on May 7, 2019, 1:30 p.m.