Yelp / yelp-fusion

Yelp Fusion API
https://yelp.com/developers
MIT License
403 stars 394 forks source link

Response data contains businesses with wrong zip code. #339

Closed antonholovko-cloud closed 6 years ago

antonholovko-cloud commented 6 years ago

Overview

Description

Hi guys, hope you doing well! I have an issue, trying to get a businesses list from api by zip code, got wrong response data, could you help me please!

More information

Response data contains businesses with wrong zip code I'm trying to get restaurants with zip - 88417, but response contains restaurants with zip - 88435

Endpoint

(e.g. Fusion Search API)

Parameters or Sample Request

GraphQL query

{
  {
  search(location: "88417", term: "restaurant") {
    total
    business {
      name
      location {
        city
        zip_code
      }
    }
  }
}

Response

{
  "data": {
    "search": {
      "total": 21,
      "business": [
        {
          "name": "Lake City Diner",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Annie's Restaurant",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Silver Moon Cafe",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Santa Fe Grille",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Comet II Drive In & Restaurant",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Route 66 Restaurant",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Sun & Sand Restaurant",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Diego's Pizza",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Joseph's Bar & Grill",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "SunSpot Cafe",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Joseph's Bar & Grill",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Subway",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Dairy Queen",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "McDonald's",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Carls Jr",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Popeyes Louisiana Kitchen",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Dairy Queen of Santa Rosa",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Carl's Jr.",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Country Pride Restaurant",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        },
        {
          "name": "Jenny's Denny's",
          "location": {
            "city": "Santa Rosa",
            "zip_code": "88435"
          }
        }
      ]
    }
  }
}

Extra information

Have a good day!

mittonk commented 6 years ago

@Goal1488 : Looks like those are neighboring zip codes, and Santa Rosa (population 2800) has a lot more popular businesses than Newkirk (pop 7).

You could try setting smaller radius, but I suspect you'll end up with fewer and fewer businesses. These search results basically mean "If you're in Newkirk and want a restaurant, we suggest driving over to Santa Rosa where there are good restaurants" --- and that seems pretty reasonable.

Have a look at the map view on

Zooming in (basically reducing radius) shows no restaurants around Newkirk and Cuervo:

Does that make sense?

antonholovko-cloud commented 6 years ago

Thanks for your reply! Recently i've searched for: parameters: term=restaurants&latitude=36.13&longitude=-115.17&radius=3000 And i've got result with: Longitude: -115.2053274 Latitude: 35.9987549

image

as i see the distance between 89109 zip and the Inca Vs Azteca restaurant is ~ 13 km

antonholovko-cloud commented 6 years ago

Okay, another kind of issue, lat long: 36.212935997511, -114.986646183705 radius: 20 000 image why those items are not in response? they are in discoverable radius?!