reviews: Get reviews for a business

Description Usage Arguments Details Value References Examples

View source: R/reviews.R

Description

Get the Yelp reviews associated with a business ID.

Usage

1
2
reviews(businesses, locale = get_yelp_locale(),
  access_token = Sys.getenv("YELP_ACCESS_TOKEN", NA))

Arguments

businesses

A character vector describing the Yelp IDs of businesses, as returned by business_search, or the data frame returned by that API endpoint.

locale

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

access_token

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

Details

If you pass multiple business IDs (either with a character vector with length greater than one or a data frame with multiple rows), this will result in multiple calls to the API, which you need to bear in mind if your usage is limited.

Value

A data frame with 6 columns. Each row corresponds to one review of the specified business.

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Marked as don't test because an access token is needed
# First lookup businesses
theaters_in_chicago <- business_search("theater", "chicago")
# Get the reviews using the business ID
reviews_of_chicago_theater_id <- reviews(theaters_in_chicago$business_id[1L])
# ...or the alias
reviews_of_chicago_theater_alias <- reviews(theaters_in_chicago$alias[1L])
identical(
  reviews_of_chicago_theater_id,
  reviews_of_chicago_theater_alias
)
if(interactive())
  View(reviews_of_chicago_theater_id) else str(reviews_of_chicago_theater_id)

richierocks/yelp documentation built on Oct. 17, 2018, 2:21 a.m.