RayofHope
RayofHope

Reputation: 1187

Foursquare API : Is there any way to search venue with name and city?

Using Foursquare API is there any way to search venue with name and city?

Currently I am using parameter "query" to search venue, how can I pass city name along with venue name to get exact results

I want to search restaurant located in specific city

FSQ API Current Search query which is working for restaurant name search only:

https://api.foursquare.com/v2/venues/search?ll=40.744010080453,-73.985651532083&categoryId=4d4b7105d754a06374d81259&query=starbucks&client_id=your_client_id&client_secret=your_client_secret

In above search query I have used "query=starbucks" to search restaurant "starbucks"

Any one knows how to do search with name and city for venue?

Please help...

Upvotes: 1

Views: 2799

Answers (2)

Stray Dog
Stray Dog

Reputation: 135

I am finding that for place names comprising of two or three words the use of an an underscore works for example:

near=New_York

or

near=Playa_Del_Carmen

near=Hong_Kong

Reason being in a browser a space becomes the characters '%20', however when passing a GET string value to a url such as from a search box or via PHP I found that the string being passed with spaces was not being "read/interpreted" correctly. Adding the underscore seems to resolve that issue.

Upvotes: 0

Related Questions