Defining x
, y
, and z
as "10013","XXXX","20170104" and using
w <- paste("https://api.foursquare.com/v2/venues/search?near=",x,"§ion='food'&oauth_token=",y,"&v=",z,sep="")
u <- getURL(w)
test <- RJSONIO::fromJSON(u)
does not return a good result, but if I replace section='food'
with query='food'
it will search for food in the name of the location
(I replaced the authorization token with XXXX
here).
The venues/search endpoint you're using doesn't have a
section
parameter. Thesection
parameter is valid with the venues/explore endpoint if that's what you mean to be trying ->https://api.foursquare.com/v2/venues/explore
Note that
/search
and/explore
are designed to accomplish very different things and you should read the docs before you just switch over./explore should be used to return recommended venues near a location. (example: coffee shop)
/search should be used to return a specific venue or venues near a location. (example: Starbucks)