Visit Length v1

How long visits to one building last: the number of visits in each duration band, and each band's share of all visits, over a range of dates.

A visit is one stay in the building, measured in exact minutes from arrival to departure, and several can happen in one day. Each visit is an event, so a count of visits is not a count of people.

Durations are grouped into bands bin_minutes wide, starting at zero. A band includes its lower edge and not its upper one, so a visit of exactly 60 minutes is in 60-120. Visits of 720 minutes (12 hours) or longer share the last band, 720+. Every band is returned in order, including empty ones at zero, so the same bin_minutes always gives the same rows.

For wider or uneven bands, request a narrower bin_minutes and add neighbouring bands together. For example, with bin_minutes=15, visits of 45 to 90 minutes are the sum of 45-60, 60-75 and 75-90.

start and end are dates in the building's local time, and both are included. The range must cover at least two days and at most two years (731 days). days_of_week limits the visits counted to those days, and the range must include at least one of them.

The response has three parts:

  • data: one row per band, with its label (bucket), its visit_count, and its share of all the visits in the response, from 0 to 1.
  • applied: the parameters used, including any defaults you left out.
  • coverage: n_visits, the total across all bands, and data_complete_through, the latest date there is data for this building. If that is before end, the building has no data for the rest of your range yet.

Figures for the most recent days can change from one day to the next as more activity is taken into account. Figures for older dates are stable, so allow for this when comparing two requests that cover recent dates.

HTTP compression is enabled for responses larger than 500 bytes when the request includes "gzip" in the Accept-Encoding header.

The visits endpoint is rate-limited to 60 requests per minute.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
uuid

Required. ID of the building. A string in UUID format.

date

Required. The first date of the range, in the building's local time, as YYYY-MM-DD. Included.

date

Required. The last date of the range, in the building's local time, as YYYY-MM-DD. Included. The range must cover at least two days and at most 731.

string
enum

Required. How visits are grouped. duration is the only value at present.

Allowed:
integer
5 to 720
Defaults to 60

The width of each duration band, in minutes: at least 5, and it must divide 720 evenly. 5, 10, 15, 30, 45, 60, 90 and 120 are all valid.

days_of_week
array of objects

Count only visits on these days of the week. Repeat the parameter for each day, for example days_of_week=monday&days_of_week=friday. All seven days when omitted. The range must include at least one of the days given.

days_of_week
Allowed:
uuid

ID of tenant (customer account) to query. A string in UUID format. If available, the Tenant ID associated with your API credentials is used by default.

Responses

400

Bad request: no tenant ID could be determined from the request or the credentials, or both an Authorization header and an X-API-Key header were sent. Send one or the other.

401

Missing or invalid credentials: no token or key, an invalid or expired token, or an API key that isn't recognised or has been revoked (Invalid API key) or is past its expiration date (API key has expired).

403

The credentials are valid but don't grant this data: a tenant ID other than your organization's, or no access to the Analyze API or to occupancy data for any building. Contact Lambent to change what your credentials can access.

404

No building with that ID is available to your credentials. This is the same whether the building doesn't exist or your credentials don't include it.

YYYY-MM-DD, start after end, a range of fewer than two days or more than 731, a range with none of the requested days of the week, a missing group_by, or a bin_minutes under 5 or one that doesn't divide 720.

429

Too many requests. The limit is 60 per minute; wait before retrying.

500

An unexpected error on our side. Retry, and contact Lambent if it persists.

503

The credentials couldn't be verified right now (Unable to verify token, Unable to verify access or Unable to verify API key). They may well be valid, so retry after the number of seconds in the Retry-After header rather than requesting new ones.

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json