Я пытаюсь реализовать бизнес-поиск в слиянии. Но я не смог получить результаты, я дал категорию, чтобы получить отфильтрованный код:
function yelpSearchReuslt(latitude,longitude,radius,listOfResult){
const searchRequest = {
categories:"Restaurants",
latitude:latitude,
longitude:longitude,
radius:radius
};
const client = yelp.client(API_KEY);
client.search(searchRequest).then(response => {
const firstResult = response.jsonBody.businesses;
})
В o/p я получаю такие категории, как Playground и parks o/p:
{
"id": "U2lT4qo4R80vsYKUFaBoCA",
"alias": "lost-hills-wonderful-park-lost-hills",
"name": "Lost Hills Wonderful Park",
"image_url": "https://s3-media1.fl.yelpcdn.com/bphoto/t5y8zHqDfx5mN2v7wtvUxw/o.jpg",
"is_closed": false,
"url": "https://www.yelp.com/biz/lost-hills-wonderful-park-lost-hills?adjust_creative=KOlGv8v3EO9ZpCUlYru9eg&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_search&utm_source=KOlGv8v3EO9ZpCUlYru9eg",
"review_count": 10,
"categories": [
{
"alias": "playgrounds",
"title": "Playgrounds"
},
{
"alias": "parks",
"title": "Parks"
}
],
"rating": 4.5,
"coordinates": {
"latitude": 35.6164124330499,
"longitude": -119.689275188145
},
"transactions": [],
"location": {
"address1": "14688 Lost Hills Rd",
"address2": "",
"address3": "",
"city": "Lost Hills",
"zip_code": "93249",
"country": "US",
"state": "CA",
"display_address": [
"14688 Lost Hills Rd",
"Lost Hills, CA 93249"
]
},
"phone": "+16614482149",
"display_phone": "(661) 448-2149",
"distance": 13784.418058437912
}