Integration API
Connect your system to TORLIN footfall data.
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.
- Sign in to TORLIN and open “API access” → “Create integration”.
- Enter a name, select an available space and enable automatic token renewal. Confirm by verifying your account again.
- 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.
| Environment | URL |
|---|---|
| Production | https://api.neo.torlin.cz/api/v1/external |
| Test | https://test.neo.torlin.cz/api/v1/external |
| Header | Required | Value | Meaning |
|---|---|---|---|
| Authorization | Yes | Bearer <TOKEN> | A valid API token; TORLIN_API_KEY in the examples. |
| Accept | Yes | application/json | Response in JSON format. |
| Method | Path | Result |
|---|---|---|
| GET | /spaces | The space available to the token. |
| GET | /spaces/{space_id}/places | Counting locations in the space. |
| GET | /spaces/{space_id}/footfall | Daily passages. |
| Parameter | Required | Format | Meaning |
|---|---|---|---|
| space_id | Yes | Positive integer | Space ID returned by GET /spaces, not a space name or counting location ID. SPACE_ID in the examples. |
| Parameter | Required | Allowed values | Meaning |
|---|---|---|---|
| from | Yes | Date YYYY-MM-DD, e.g. 2026-10-01 | First included day (inclusive) in the meta.timezone time zone. No time or UTC offset. |
| to | Yes | Date YYYY-MM-DD, e.g. 2026-10-03 | End of the period (exclusive); must be after from. For one day, specify the following date. |
| interval | Yes | day | The only supported value: daily totals. Always send interval=day; hourly, weekly and monthly intervals are not available. |
curl 'https://api.neo.torlin.cz/api/v1/external/spaces' \
-H "Authorization: Bearer $TORLIN_API_KEY" \
-H 'Accept: application/json'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'{
"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.
- In one coordinated process, generate and persist a UUID as ROTATION_REQUEST_ID. Send POST with the current token and the Idempotency-Key header.
- 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).
- 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.
| Header | Required | Format | Meaning |
|---|---|---|---|
| Idempotency-Key | Yes | UUID, e.g. 550e8400-e29b-41d4-a716-446655440000 | Unique 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. |
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'{
"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.
| HTTP | Action |
|---|---|
| 401 | Check the current token. Expired or revoked tokens cannot renew; the owner must create a new one. |
| 403 | Check permissions or whether automatic renewal is enabled. |
| 404 | Use a space from GET /spaces; check the owner’s access. |
| 422 | Correct the request parameters. |
| 429 | Wait according to Retry-After and reduce request frequency. |
| 5xx | Retry a limited number of times with increasing delays; preserve Idempotency-Key and the original token for renewal. |
