0

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?

Greg Burghardt
  • 34,276
  • 8
  • 63
  • 114
newbie coder
  • 111
  • 3
  • 2
    I'm afraid if you need a chatroom to answer your question, then your question is too broad. You will need to focus on one problem only, and a smaller problem. This question will most likely be closed as needing focus. – Greg Burghardt Mar 05 '21 at 15:33
  • @GregBurghardt I edited my question – newbie coder Mar 05 '21 at 15:38
  • This is better. It is still pretty broad, because there a many ways of doing this. I'd like to see what the community here thinks. – Greg Burghardt Mar 05 '21 at 15:43
  • @GregBurghardt Thanks! If there are many ways of doing this - can you list some. I listed one (because I am aware of only this one), but if you know more, happy to hear/read; I dont need detailed solution, just the approach. Also, if you can tell me what do you think of my solution, that would be grant! – newbie coder Mar 05 '21 at 17:20

0 Answers0