Here is rough pass:
function example_get_downloads() {
if ( ! function_exists( 'plugins_api' ) )
require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
$plugin = array( 'slug' => 'your-plugin-slug' );
$call_api = plugins_api( 'plugin_information', $plugin );
if ( is_wp_error( $call_api ) ) {
echo '<pre>' . print_r( $call_api->get_error_message(), true ) . '</pre>';
} else {
update_option( 'my_downloads', $call_api->downloaded );
}
}
add_action( 'my_hourly_actions', 'example_get_downloads' );
This is an example of getting retrieving and saving the downloads counts for a plugin with the slug “your-plugin-slug”. If you var_dump the $call_api you can see how to get all the other data you want. I’ve only done this with plugin data but there is a similar process for theme data and I think you can get there with the info above.