Query number of tickets per queue

Does anyone have a curl / python script that can query number of open tickets per queue using the RT API?

The REST1 or REST2 API?