StatsMix provides both officially supported code libraries for some languages (Ruby, PHP) and lists community contributed ones for others.
Ruby gem
gem installation and documentation
source code: https://github.com/tmarkiewicz/statsmix
Ruby (net/http)
https://gist.github.com/762889
PHP
https://github.com/derekscruggs/PHP-library-for-StatsMix-API
Python
https://gist.github.com/735347
C#
https://gist.github.com/735931
Java
https://gist.github.com/625155
ColdFusion
https://gist.github.com/765457
Code examples are also linked from each custom metric page.