Journeys v1

Where occupants go next: how often an occupant's visit to one of your buildings was followed by a visit to another, over a range of dates.

A journey is one visit followed by the same occupant's next visit, when the next visit is to a different building and starts no more than max_gap_minutes after the first one ends (240 by default). The limit keeps a journey to one stretch of activity, so a visit on Friday evening followed by one on Monday morning isn't a journey. Visits are paired in the order they started, and only visits on the days of the week you ask for are paired: with days_of_week set to Monday to Friday, a Friday visit and the following Monday's are consecutive, and too far apart to count.

Journeys cover the buildings your credentials can access, so there is no building parameter. A journey to or from any other building isn't counted.

group_by chooses how journeys are grouped:

  • route: one row per route, an ordered pair of buildings, most journeys first. Library → Gym and Gym → Library are different routes.
  • building: one row per building, with the journeys that start or end there and connected_buildings, the number of other buildings it shares a journey with in either direction. Buildings are ranked by connected_buildings, then by journeys, then by building ID, so journey_count doesn't always decrease down the list. Each journey counts at both of its buildings, so these shares add up to 2, not 1.
  • hour: one row per hour, 00 to 23, empty hours included. A journey is counted in the hour its first visit started, in the local time of that visit's building. With then_by=route, each hour also lists its routes in children, each with its share_within the hour.

top_n limits the rows returned: routes or buildings, or with group_by=hour and then_by=route, the routes in each hour. It's 100 when omitted. There's no maximum: for every row, ask for a top_n at least as large as the number of rows, which coverage gives (and each hour's truncation, for the routes in an hour). For a large organization, every row can make a very large response. All 24 hours are always returned. Shares are always out of every journey, including those past the limit. With group_by=hour, each hour's truncation says what the limit left out; for a route's share of only the routes returned, divide its journey_count by truncation.journeys_returned. Routes with the same number of journeys are ordered by origin building ID, then destination building ID.

A building without a name is returned with a null name and keeps its place in the order. Building IDs are always included.

start and end are dates in each 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 paired to those weekdays, and the range must include at least one of them.

The response has three parts:

  • data: the rows described above.
  • applied: the parameters used, including any defaults you left out.
  • coverage: n_journeys, the number of journeys counted, and depending on group_by, how many routes, buildings or buildings in scope that covers.

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 journeys 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
date

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

date

Required. The last date of the range, in each 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 journeys are grouped. route gives one row per route, building one row per building, and hour one row per local hour.

Allowed:
string
enum

With group_by=hour only. route lists each hour's routes.

Allowed:
integer
≥ 1
Defaults to 100

The most rows to return: routes, buildings, or with group_by=hour and then_by=route, routes in each hour. A whole number from 1, with no maximum; 100 when omitted.

integer
1 to 1440
Defaults to 240

The longest time, in whole minutes from 1 to 1,440, from the end of one visit to the start of the next for the two to count as a journey.

days_of_week
array of objects

Pair 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.

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, then_by with a group_by other than hour, top_n with group_by=hour but no then_by, a top_n that isn't a whole number of 1 or more, or a max_gap_minutes that isn't a whole number from 1 to 1,440.

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