The quickest way is to just dump the ipset and look for the values. If you want it without dumping it, you'll probably want to write some C using the libipset API.
root@host # ipset save |grep -e 'packets [1-9]'
add ganeti-v4 1.2.3.4 timeout 85663 packets 26 bytes 5876 comment "basedata: @1475359261 /etc/firewall.d/functions/ipset"
add ganeti-v4 1.2.3.5 timeout 85663 packets 30 bytes 6780 comment "basedata: @1475359261 /etc/firewall.d/functions/ipset"
add drbd-v4 4.5.6.7 timeout 85663 packets 4 bytes 240 comment "basedata: @1475359261 /etc/firewall.d/functions/ipset"