I was thinking of creating a nice question on [Programming Puzzles & Code Golf](https://codegolf.stackexchange.com/) related to [Winter Bash 2014](http://winterbash2014.stackexchange.com/), but I need some specific data for that question - The number of hats of each user.

Is there a way to query the number of hats owned by a user using the stack exchange API?