How to get total number of results in Search API View?
So after a day, here's the result:

As J. Reynolds suggested, I finished up using $view->total_rows, but:


To populate $views->total_rows, you have to use a pager in your view - that was not an option with the attachments.
If you don't use a pager, you could force populating $view->total_rows by altering the View query before its execution like this:



    function mycustommodule_views_pre_execute(&$view) {
      $view->get_total_rows = TRUE;
    }


And after that you have that $view->total_rows!