The total number that was returned from the API is actually higher compared to what's being shown in the UI.
Screenshot attached shows Users total count is 5,275. (https://i.stack.imgur.com/3DEyB.jpg)
However, the API shows 6152 users in total. (https://i.stack.imgur.com/bJANs.jpg)
Any ideas on how to get valid users count?


The report you are looking at on Google analytics is
Dimension
Metric
You have added
datehourin your report the results of the report will not be the same unless the request is the same as the report you are looking at