edd_get_download_earnings_stats()

This function will retrieve the total amount a particular download has earned in sales.

$earnings = edd_get_download_earnings_stats( $download_id );