Foursquare venue search (intent "browse") does not seem to honor categoryId

StackOverflow https://stackoverflow.com/questions/21880141

  •  13-10-2022
  •  | 
  •  

Вопрос

if I make this query:

https://api.foursquare.com/v2/venues/search?categoryId=4e4c9077bd41f78e849722f9%2C4f4531084b9074f6e4fb0101%2C4bf58dd8d48988d1f7941735%2C4bf58dd8d48988d1fa941735%2C5032872391d4c4b30a586d64%2C4bf58dd8d48988d115951735%2C4bf58dd8d48988d1d3941735%2C4bf58dd8d48988d1ef941735%2C4bf58dd8d48988d116951735&client_id=DBYECJMGA0AB1XQP1GW5CV5WNXD4331IODMHARY5D3GSEOIB&intent=browse&limit=50&ne=43.802819%2C11.162109&sw=43.786958%2C11.140137&v=20131109&locale=en&client_secret=CLIENT_SECRET

in which I specify multiple category IDs, I get back this result:

{"meta":{"code":200},"response":{"venues":[{"id":"4f3ccf34e4b030292acf2336","name":"DI TUTTO DI PIU' - Mercatino usato","contact":{},"location":{"address":"Via Manderi, 62, 50013 Campi Bisenzio FI","lat":43.79576849102895,"lng":11.15417380610575,"postalCode":"50013","cc":"IT","city":"Campi Bisenzio","state":"Tuscany","country":"Italy"},"categories":[{"id":"4bf58dd8d48988d127951735","name":"Arts & Crafts Store","pluralName":"Arts & Crafts Stores","shortName":"Arts & Crafts","icon":{"prefix":"https://ss1.4sqi.net/img/categories_v2/shops/artstore_","suffix":".png"},"primary":true}],"verified":false,"restricted":true,"stats":{"checkinsCount":16,"usersCount":15,"tipCount":2},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1392811869"}]}}

which contains a venue whose categoryId is 4bf58dd8d48988d127951735 ("Arts & Crafts Store"), which is not included in the request.

Это было полезно?

Решение

The compact venue result that you posted is only showing the primary category of the venue, which is an arts and crafts store. However, if you run a venue details call with that venue ID, you're able to see that the venue has a secondary category ID of flea market, which you searched for. The search matches on both primary and secondary category IDs

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top