Search code examples
javascriptapiintegrationfoursquare

Request a complete response object instead of compact reponse object foursquare venues search api?


When we request a api call to foursquare for search venues of certain category It returns a compact response not complete response because of which i am not able to get complete information about the place like if the place is open, price etc which is only returned in a complete response, can i get a complete response instead of compact response?? more info provided here.

Eg:
call:https://api.foursquare.com/v2/venues/search?ll=18.5308225,73.8474647&categoryId=4bf58dd8d48988d1e1931735&radius=1000&v=20131021&limit=1

Result:

{
    "meta": {
        "code": 200
    },
    "response": {
        "venues": [{
            "id": "4b975471f964a520c9ff34e3",
            "name": "Yana Sizzler & Wok",
            "contact": {
                "phone": "+912066013897",
                "formattedPhone": "+91 20 6601 3897"
            },
            "location": {
                "address": "F C Road",
                "lat": 18.52802688063791,
                "lng": 73.84272476029567,
                "distance": 589,
                "cc": "IN",
                "city": "Pune",
                "state": "India",
                "country": "India"
            },
            "categories": [{
                "id": "4bf58dd8d48988d1df931735",
                "name": "BBQ Joint",
                "pluralName": "BBQ Joints",
                "shortName": "BBQ",
                "icon": {
                    "prefix": "https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/bbq_",
                    "suffix": ".png"
                },
                "primary": true
            }],
            "verified": false,
            "restricted": true,
            "stats": {
                "checkinsCount": 542,
                "usersCount": 402,
                "tipCount": 19
            },
            "specials": {
                "count": 0,
                "items": []
            },
            "hereNow": {
                "count": 0,
                "groups": []
            },
            "referralId": "v-1386276988"
        }]
    }
}

But i am not getting informatiion like isOpen Price etc which we get in the complete response when we use explore.


Solution

  • The API does not support returning complete objects in venue search responses—you need to make a separate venue details call to get the information you're looking for. We recommend caching venue details (for up to 30 days) to avoid having to repeatedly calling this endpoint to retrieve this information that doesn't necessarily change that often.