To do this calculation, your code will need to fetch the issues in the sprint and read the data from them to work it all out.
The Greenhopper api you've found is a deprecated old version of the REST API from before Atlassian renamed it Agile and then Software.
It looks like you're new here. Sign in or register to get started.