Google Groups

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

Dimi Nov 15, 2011 6:20 AM
Posted in group: Foursquare API

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,