Cunning!
Badge queries are pretty curly - and they require simply a ‘user_id’ and ‘granted_at’ to be returned. So you’ll need to hack this a bit.
I’d recommend digging into the topics on badge queries (read them carefully) and have a bit of a go. I’d also only run it once a day as it might be a bit heavy otherwise.
Let us know how you get on!