YelpByLocation: Yelp's search API

Description Usage Arguments Value Examples

View source: R/YelpByLocation.R

Description

Use Yelp's search API to search for a term by location.

Usage

1
YelpByLocation(lon, lat, term, auth, limit)

Arguments

lon

Longitude to search from (can be text or numeric).

lat

Latitude to search from (can be text or number).

term

What to search for (e.g. restaurants, bars, etc).

auth

Authorization from httr's sign_oauth1.0 (see examples).

limit

Maximum number of search results.

Value

Returns a data.frame with the search results.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Your credentials:
consumer.key <- "YOUR CONSUMER KEY"
consumer.secret <- "YOUR CONSUMER SECRET"
token <- "YOUR TOKEN"
token.secret <- "YOUR TOKEN SECRET"

app <- httr::oauth_app("YELP", key = consumer.key, secret = consumer.secret)
auth <- httr::sign_oauth1.0(app, token = token, token_secret = token.secret)

# Search for restaurants near Time Square, NYC:
YelpByLocation(lon = -73.9873197, lat = 40.758895, term = "Restaurants",
               auth = auth, limit = 3)

## End(Not run)

walshc/YelpAPI documentation built on May 3, 2019, 11:50 p.m.