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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.