Developers

Integration API

Connect your system to TORLIN footfall data.

API v1
Updated 21 October 2026

1. Get your first token

A token (API key) provides read-only access to one space with the footfall:read permission. The owner must retain access to that space.

  1. Sign in to TORLIN and open “API access” → “Create integration”.
  2. Enter a name, select an available space and enable automatic token renewal. Confirm by verifying your account again.
  3. Copy the token shown once into your system’s secure storage. Load it into TORLIN_API_KEY for the examples.

2. Read data

Call the API from your server over HTTPS. Keep tokens out of URLs, client applications and logs; they do not work on internal endpoints.

First call GET /spaces. Set SPACE_ID to the returned ID instead of <ID_FROM_GET_SPACES>, then use this variable in the passage query. GET /spaces and GET /spaces/{space_id}/places have no query parameters. All GET requests have no body.

  • The time zone is returned in meta.timezone; it cannot be changed through a request parameter.
  • count measures directional passages, not unique people. 0 is a zero result; null means missing data. The API reads stored results without recalculation.
  • Test and production use separate tokens and data.
Base URLs
EnvironmentURL
Productionhttps://api.neo.torlin.cz/api/v1/external
Testhttps://test.neo.torlin.cz/api/v1/external
Common headers for all requests
HeaderRequiredValueMeaning
AuthorizationYesBearer <TOKEN>A valid API token; TORLIN_API_KEY in the examples.
AcceptYesapplication/jsonResponse in JSON format.
Endpoints
MethodPathResult
GET/spacesThe space available to the token.
GET/spaces/{space_id}/placesCounting locations in the space.
GET/spaces/{space_id}/footfallDaily passages.
Path parameter for /spaces/{space_id}/places and /spaces/{space_id}/footfall
ParameterRequiredFormatMeaning
space_idYesPositive integerSpace ID returned by GET /spaces, not a space name or counting location ID. SPACE_ID in the examples.
Query parameters: GET /spaces/{space_id}/footfall
ParameterRequiredAllowed valuesMeaning
fromYesDate YYYY-MM-DD, e.g. 2026-10-01First included day (inclusive) in the meta.timezone time zone. No time or UTC offset.
toYesDate YYYY-MM-DD, e.g. 2026-10-03End of the period (exclusive); must be after from. For one day, specify the following date.
intervalYesdayThe only supported value: daily totals. Always send interval=day; hourly, weekly and monthly intervals are not available.
Find the space
curl 'https://api.neo.torlin.cz/api/v1/external/spaces' \
  -H "Authorization: Bearer $TORLIN_API_KEY" \
  -H 'Accept: application/json'
Passages for 1 and 2 October
SPACE_ID='<ID_FROM_GET_SPACES>'

curl "https://api.neo.torlin.cz/api/v1/external/spaces/$SPACE_ID/footfall?from=2026-10-01&to=2026-10-03&interval=day" \
  -H "Authorization: Bearer $TORLIN_API_KEY" \
  -H 'Accept: application/json'
Response (SPACE_ID is a placeholder)
{
  "data": [
    {
      "date": "2026-10-01",
      "count": 152
    },
    {
      "date": "2026-10-02",
      "count": null
    }
  ],
  "meta": {
    "space_id": "<SPACE_ID>",
    "metric": "directional_passages",
    "interval": "day",
    "timezone": "Europe/Prague",
    "from": "2026-10-01",
    "to_exclusive": "2026-10-03"
  }
}

3. Renew tokens automatically

Tokens last 90 days; schedule renewal after 60 days. Enabled automatic renewal needs no user involvement and preserves the space and permissions. It does not extend any end date of the integration itself.

POST /keys/current/rotate uses the common headers above plus Idempotency-Key. It has no query parameters or body.

  1. In one coordinated process, generate and persist a UUID as ROTATION_REQUEST_ID. Send POST with the current token and the Idempotency-Key header.
  2. Atomically save the new api_key and switch all workers to it. Follow expires_at; the old token can only read until previous_key_valid_until (at most 10 minutes, never past its expiry).
  3. If the response is lost, retry within 10 minutes and before the original token expires, using the same original token and Idempotency-Key. The same result is returned. Use the new token and a new UUID for the next renewal.
Token renewal header
HeaderRequiredFormatMeaning
Idempotency-KeyYesUUID, e.g. 550e8400-e29b-41d4-a716-446655440000Unique ID of one renewal; ROTATION_REQUEST_ID in the examples. Reuse the value when retrying the same renewal; generate a new one for the next renewal.
Renew token
curl --request POST 'https://api.neo.torlin.cz/api/v1/external/keys/current/rotate' \
  -H "Authorization: Bearer $TORLIN_API_KEY" \
  -H "Idempotency-Key: $ROTATION_REQUEST_ID" \
  -H 'Accept: application/json'
Response (placeholder token)
{
  "api_key": "EXAMPLE_ONLY_NOT_A_VALID_KEY",
  "expires_at": "2027-01-19T12:00:00Z",
  "previous_key_valid_until": "2026-10-21T12:10:00Z"
}

4. Handle errors

The limit is 60 requests per minute per token. If a token leaks, revoke the whole integration in “API access” to invalidate all its tokens.

Error responses
HTTPAction
401Check the current token. Expired or revoked tokens cannot renew; the owner must create a new one.
403Check permissions or whether automatic renewal is enabled.
404Use a space from GET /spaces; check the owner’s access.
422Correct the request parameters.
429Wait according to Retry-After and reduce request frequency.
5xxRetry a limited number of times with increasing delays; preserve Idempotency-Key and the original token for renewal.