I want to write react native app. The main functionality of the app is location based - I fetch some locations from Yelp api, but how do I tackle new businesses?
My current solution: I fetch location places with this yelp api. I can search for "bars", or "pizza". Then I have some results, coming in the following format:
{
"total": 8228,
"businesses": [
{
"rating": 4,
"price": "$",
"phone": "+14152520800",
"id": "E8RJkjfdcwgtyoPMjQ_Olg",
"alias": "four-barrel-coffee-san-francisco",
"is_closed": false,
"categories": [
{
"alias": "coffee",
"title": "Coffee & Tea"
}
],
"review_count": 1738,
"name": "Four Barrel Coffee",
"url": "https://www.yelp.com/biz/four-barrel-coffee-san-francisco",
"coordinates": {
"latitude": 37.7670169511878,
"longitude": -122.42184275
},
"image_url": "http://s3-media2.fl.yelpcdn.com/bphoto/MmgtASP3l_t4tPCL1iAsCg/o.jpg",
"location": {
"city": "San Francisco",
"country": "US",
"address2": "",
"address3": "",
"state": "CA",
"address1": "375 Valencia St",
"zip_code": "94103"
},
"distance": 1604.23,
"transactions": ["pickup", "delivery"]
},
// ...
],
What if there is a new location/business which is not yet in Yelp? Should I just let users to create new locations, and tag them, so they can appear in appropriate searches? This means I will have to do 2 endpoint calls - one to the Yelp api, and one to my own database. Is this a good approach?