This websocket api can be used to retrieve live occupancy data.
To be able to use this, the usage type - Space Occupancy has to be enabled in the device settings page. If unable to enable it, please open a support ticket and reach out to our support team.

Below is an example of retrieving the data from the websocket api in Python.
Please refer to Pulsar WebSocket API | Apache Pulsar for further details.
import websocket
import datetime
import random
import string
import json
import base64
def on_open(ws):
print('WebSocket connection established.')
def on_message(ws, message):
json_data = json.loads(message)
payload = json_data["payload"]
print("-------------------------------------------------------------------------------------")
print('Received data (payload):', base64.b64decode(payload))
print("-------------------------------------------------------------------------------------")
def on_close(ws):
print('WebSocket connection closed.')
def on_error(ws, error):
print('WebSocket error:', error)
subscription_id = f"sub-{int(datetime.datetime.now().timestamp() * 1000)}_{''.join(random.choices(string.ascii_lowercase + string.digits, k=11))}"
subscription_url = f"{subscription_id}?subscriptionType=Exclusive"
websocket.enableTrace(True) # Optional: Enable trace for debugging purposes
ws = websocket.WebSocketApp('wss://[PulsarAddress]/ws/v2/consumer/persistent/public/flink_u/occupancy-data-branch-1/' + subscription_url,
on_open=on_open,
on_message=on_message,
on_close=on_close,
on_error=on_error)
ws.run_forever()
Example websocket api:
wss://[Pulsar address]/ws/v2/consumer/persistent/public/flink_u/occupancy-data-[branch-Id or area-Id]/sub-1686897948800_0xjfbrr0ax8?subscriptionType=Exclusive
For Pulsar address, please get from Footfallcam.
For branch-id or area-id, please get from Footfallcam if unsure.