David D
David D

Reputation: 141

/venue/id endpoint returns different venue id

I have a venue id that I have stored as a reference. In attempting to pull the info to display to the user from the foursquare API, the venue that I get back from /venues/ is not the same venue as I requested. They are essentially identical, except for the id...

https://api.foursquare.com/v2/venues/4e75fc201495be51715b18f1

Returns venue with id=4e6c56a5483b1f5ebe0a6e0f

How is this possible? I assume the venues were collapsed and this venue was made the primary? Still it seems like an issue as I'd expect to get back the venue I ask for even if it's a duplicate.

Upvotes: 2

Views: 371

Answers (1)

akdotcom
akdotcom

Reputation: 4687

When Venues are merged, the "more popular" of the two venues is the one kept and the secondary entry's values are merged into that object.

So if you request a venue and get back a venue with a different ID, you should update your local database to use this new ID as your canonical foursquare identifier for the location.

Upvotes: 3

Related Questions