11-08-2022 09:39
11-08-2022 09:39
I wanted to show real-time heart rate on my Django app, but I am also using the web API to show various summaries.
How can I use both to get to the desired goal?
11-08-2022 11:21
11-08-2022 11:21
The Web API doesn't provide real-time data. It only updates after the device syncs, which can be every 20 minutes or so.
If you really want real-time data, you'll need to use the device and companion APIs. You'll probably also need to write some server code to receive the data (perhaps within your Django app). The comms are difficult.
11-08-2022 11:42
11-08-2022 11:42
Thank you for a quick response.
I have not been able to find any way to integrate Companion API with my Django project. It would be great if you could guide me in the right way.
11-08-2022 11:47
11-08-2022 11:47
The companion can only communicate using fetch() or WebSocket. WebSocket is probably better suited to real-time streaming. You'll need to write server code somewhere to receive the fetch() requests or WebSocket messages.
Be warned that you may need to use https/wss, rather than http/ws, depending on where the server is running.
11-08-2022 13:05
11-08-2022 13:05
Thank you so much for the help. I will try it out and get back to you if it worked.