If you have a filter, let's say [hosts] state = 0, you can immidiately find out how many those hosts are that matches the query, by issuing a GET request to /api/filter/count?query=%5Bhosts%5D%20all