Description Usage Arguments Details Value Examples
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.
1 2 | serp_google(query, cse_id, api_key, lang = "en", user_loc = "us",
goog_domain = "com")
|
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. |
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).
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.