Hi,
The API can deliver an array of the 'point in time' detections as you've quite rightly highlighted. From that there is typically a job to do to sort through these individual detections and work out those which are in the middle of a visit..
When we've done this previously we've maintained an intermediary SQL based database and some logic in the receiver script/program, broadly outlined as follows:
For each recorded detection:
"have I seen this Mac address in the last 3 minutes?"
- if yes, update the last_seen on a visit entry.
- if no, create a new visit and add the information.
We've found this is the best way of cleanly doing it. This then allows you the ability to hold a table full of 'visits' which can be analysed separately to 'detections'.
Hope that helps,
Chris