How to efficiently obtain the parent category of a venue from a checkin?

317 views
Skip to first unread message

Dimi

unread,
Nov 15, 2011, 9:20:42 AM11/15/11
to foursqu...@googlegroups.com
Hi, 

I'm accessing the check-in history of users who have authorized my app. Among other things I am interested in the topmost venue category of each check-in.

Using v=20110615, the results returned contain a 'checkins.items[].venue.categories[].parents' attribute with a string of the top most category, e.g. 'Food', 'Professional & Other Places', etc.
This is not the case using newer versions of the API!

Unfortunately foursquare keeps changing some of the names of top categories (e.g. 'Travel Spots' is now 'Travel & Transport'). Now I know it is bad to rely on strings, but since the API returns strings I used them instead of the ids to store the information in my local database. Also mainly because I do not want to have to cache the venues/categories endpoint and refresh this every two weeks as per API guides.

My problem is, that historical data I extracted from foursquare has different names for the same parent categories. Does anyone have an idea how to efficiently compensate this? Or is caching the category hierarchy and doing a lookup really the only way? 
Just out of curiosity, why was the parent name/id removed from the compact venue details in checkins? I would imagine this to be quite useful

thanks in advance,

Dimi

Akshay Patil

unread,
Nov 16, 2011, 5:52:46 PM11/16/11
to foursqu...@googlegroups.com
=/. There's no deterministic way, you'll likely have to hand inspect and merge them. This is why we told you to use IDs and not names -- you've got to trust us when we say these things!

~ak
--
Akshay Patil / Foursquare Platform Evangelist
@akdotcom / @foursquareapi



Reply all
Reply to author
Forward
0 new messages