business_search: Search for businesses

Description Usage Arguments Value References Examples

View source: R/business-search.R

Description

Use the Yelp business search API to find businesses close to a give location.

Usage

1
2
3
4
5
6
business_search(term, location, latitude = NULL, longitude = NULL,
  radius_m = 40000, categories = NULL, locale = get_yelp_locale(),
  limit = 20, offset = 0, sort_by = c("best_match", "rating",
  "review_count", "distance"), price = 1:4, open_now = FALSE,
  open_at = NULL, attributes = NULL,
  access_token = Sys.getenv("YELP_ACCESS_TOKEN", NA))

Arguments

term

A string denoting the search term.

location

A string describing the location. If this is not provided, then latitude and longitude are compulsory.

latitude

A number representing the latitude to search close to.

longitude

A number representing the longitude to search close to.

radius_m

A number giving the radius, in metres, of the search circle around the specified location.

categories

A character vector of search categories to filter on, or NULL to return everything. See SUPPORTED_CATEGORY_ALIASES for allowed values.

locale

A string naming the locale. See SUPPORTED_LOCALES for allowed values.

limit

An integer giving the maximum number of businesses to return. Maximum 50.

offset

An integer giving the number of businesses to skip before returning. Allows you to return more than 50 businesses (split between multiple searches).

sort_by

A string naming the metric to order results by.

price

A vector of integers in 1 (cheap) to 4 (expensive) denoting price brackets.

open_now

A logical value of whether or not to only return businesses that are currently open.

open_at

A time when to check if businesses are open.

attributes

A character vector of business attributes to filter on. See SUPPORTED_BUSINESS_ATTRIBUTES.

access_token

A string giving an access token to authenticate the API call. See get_access_token.

Value

A data frame with 24 columns. Each row corresponds to one business.

References

https://www.yelp.com/developers/documentation/v3/business_search

Examples

1
2
3
## Marked as don't test because an access token is needed
delis_in_queens <- business_search("deli", "Queens, New York")
if(interactive()) View(delis_in_queens) else str(delis_in_queens)

richierocks/yelp documentation built on May 3, 2019, 4:08 p.m.