3

Currently, there is no practical way to retrieve badge information given its ID. I would like to see title and description added at the very least.

Current method for retrieving the data:

  • call the /badges method
  • loop through every badge
  • at each iteration, check to see if the IDs match

This is inefficient to say the least.

1 Answer 1

3

/badges returns every badge in the system, building a lookup based on id is trivial and costs a single request.

10
  • But fetching the data for every badge wastes bandwidth and processing time. Commented Jun 2, 2010 at 6:00
  • @George - so, rather than return every badge's description/title once per app run you'd rather see it returned once per call to /badges/{id}? Your approach wastes much more bandwidth and processing time. Commented Jun 2, 2010 at 6:17
  • Uh... given one ID of a badge, it would be great if we could get the info for only that badge. Commented Jun 2, 2010 at 6:50
  • ...or add a filter parameter so that only a particular badge is returned. That'd be good too. Commented Jun 2, 2010 at 6:51
  • Anything to avoid iterating over countless badges just to match an ID just to get the description for a badge. Commented Jun 2, 2010 at 6:52
  • @George - just build a map from id->description. O(1) lookup time, one fixed-size request to the API; much better than an unbounded number of requests. Commented Jun 2, 2010 at 6:59
  • Kind of tend to agree with George on this one. It would be nice to be able to fetch the info for one particular badge. Commented Jun 2, 2010 at 7:03
  • Kevin would have a valid point here if the badges list was static, but it isn't. Commented Jun 2, 2010 at 7:37
  • @George - the badge page is updated very rarely (order of days), and if you see an id you haven't before, fetch again! Commented Jun 2, 2010 at 11:35
  • Yes, I would not mind seeing the other badge routes go away. i cannot think of a compelling use case to dedicate 3 routes for such a low volume of easily discernible data Commented Jul 25, 2010 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .