Category Search in Yelp is not Filtering properly in nodejs. I have given category as "Restaurants" but my o/p is : parks and Playgrounds

It looks like you've almost got it. You just need to use the identifier for 'categories' rather than the name based upon the documentation for the categories parameter which says:

"The value in parenthesis should be used when specifying a search category input."

In your case use restaurants rather than Restaurants. In your code above change the definition for searchRequest to:

const searchRequest = {
         categories:"restaurants",
         latitude:latitude,
         longitude:longitude,
         radius:radius
      };

Hope that helps!

-Darrin

Tags:

Node.Js

Yelp