请求完整的响应对象而不是紧凑的响应对象foursquare场所搜索api?

时间:2013-12-05 19:39:02

标签: javascript api integration foursquare

当我们向foursquare请求api调用特定类别的搜索场所时 它返回一个紧凑的响应而不是完整的响应,因为我无法获得有关该地点的完整信息,如果该地方是开放的,价格等仅在完整的响应中返回,我能得到完整的响应而不是紧凑的响应?? more info provided here

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

结果:

{
    "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"
        }]
    }
}

但我没有得到像isOpen Price等的信息,当我们使用探索时,我们会得到完整的回复。

1 个答案:

答案 0 :(得分:2)

API不支持在场地搜索响应中返回完整对象 - 您需要进行单独的venue details调用以获取您正在寻找的信息。我们建议缓存场地详细信息(最多30天),以避免重复调用此端点以检索不一定经常更改的信息。