Please see the Piwik developer zone for more information, tutorials and examples.