Not specific to the location API, it's common for people to report API data not matching what is visible in Dashboard.
The answer in general is that unless you are exactly replicating Dashboard's internal logic/timing/maths, the result will differ, and as the internal details are not public it's unlikely you'll be able to replicate them, so you'll always get different numbers.
For instance I'm pretty sure Dashboard keeps some periodically calculated/cached info for some things, unless you can hit on the exact match for this, you won't get the same results.
They're not wrong, they're just different because they weren't calculated the same way that Dashboard does it, as long as you know what they mean they are perfectly valid.
There is some explanation of how the numbers for Location Analytics are produced, it might help you get closer, note how RSSI is used for instance...
https://documentation.meraki.com/MR/Monitoring_and_Reporting/Location_Analytics
But if you are using the API, totals still have to be calculated, otherwise I think you'll have to resort to extracting the numbers from the Dashboard page.
The API documentation says you get clientMac in the payload...
https://developer.cisco.com/meraki/scanning-api/3-0/#observation-payloads
...if that's not what you're getting, I suggest open a case to get it fixed or documentation corrected.