gpt4 book ai didi

javascript - Foursquare 未从搜索中返回所有属性

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:23:39 26 4
gpt4 key购买 nike

我正在使用

向 Foursquare 发出请求
GET https://api.foursquare.com/v2/venues/search 

试图获取“价格”属性。但是,它似乎并未返回此文档页面详细说明的所有列出的属性。

https://developer.foursquare.com/docs/api/venues/search

这是我收到的对象:

   id: '4c93ae9594a0236aea808512',
name: 'China Garden',
contact: {},
location: [Object],
categories: [Array],
verified: false,
stats: [Object],
hasMenu: true,
menu: [Object],
allowMenuUrlEdit: true,
beenHere: [Object],
specials: [Object],
referralId: 'v-1516988384',
venueChains: [],
hasPerk: false

如您所见,价格属性(以及其他一些属性)不是响应对象的一部分。这些也是我用来进行搜索的参数:

var params = {
"near": "exmouth uk",
"categoryId": catID,
"intent": "browse",
"limit": 50,
"time": "any",
"day": "any",
};

有人知道为什么返回的只有这些属性吗?

最佳答案

有一个新的 /search/recommendations endpoint听起来它会做你想做的事。

首先,它允许查询 nearcategoryIdlimitlocalTimelocalDay 等。

并且响应包含价格等。

这是一个响应示例:

[{
"displayType": "venue",
"venue": {
"id": "4fa445c8e4b0baf7cc71e811",
"name": "Boudoir",
"contact": {
"phone": "+441382225968",
"formattedPhone": "+44 1382 225968"
},
"location": {
"address": "1 Temple Lane",
"lat": 56.459587391243105,
"lng": -2.978718040375153,
"labeledLatLngs": [{
"label": "display",
"lat": 56.459587391243105,
"lng": -2.978718040375153
}],
"postalCode": "DD1 4HA",
"cc": "GB",
"city": "Dundee",
"state": "Dundee City",
"country": "United Kingdom",
"formattedAddress": [
"1 Temple Lane",
"Dundee",
"Dundee City",
"DD1 4HA",
"United Kingdom"
]
},
"categories": [{
"id": "4bf58dd8d48988d146941735",
"name": "Deli / Bodega",
"pluralName": "Delis / Bodegas",
"shortName": "Deli / Bodega",
"icon": {
"prefix": "https://ss3.4sqi.net/img/categories_v2/food/deli_",
"suffix": ".png"
},
"primary": true
}],
"verified": false,
"stats": {
"checkinsCount": 73,
"usersCount": 46,
"tipCount": 0
},
"url": "http://www.boudoir.wickedweb.biz",
"price": {
"tier": 3,
"message": "Expensive",
"currency": "£"
},
"dislike": false,
"ok": false,
"allowMenuUrlEdit": true,
"beenHere": {
"count": 0,
"marked": false,
"lastCheckinExpiredAt": 0
}
},
"id": "5a86bea63b830731dbaff394",
"photo": {
"id": "51d8959a498ebc1f8cfe6ca1",
"createdAt": 1373148570,
"prefix": "https://igx.4sqi.net/img/general/",
"suffix": "/2773213_EBnYq-AmD-arj7VH3pP47B7HMi1lP2LYdb76CSsJJ9o.jpg",
"width": 720,
"height": 960,
"visibility": "public"
},
"snippets": {
"count": 1,
"items": [{}]
}
}]

关于javascript - Foursquare 未从搜索中返回所有属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48469324/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com