1

I am trying to connect to Lightstremer to use the IG API streaming, and I would like to use the websockets library. I am wondering if it is possible. What I am struggling with is how to get the URI to use to create the connection with the server. I can get the lightstreamer endpoint from IG and it looks like 'http://demo-apd.marketdatasystem.com'.

If I run

import websockets
import asyncio

ws_url = 'http://demo-apd.marketdatasystem.com/lighstreamer'
connection = await websockets.connect(ws_url)

I get the error https://demo-apd.marketdatasystems.com/lighstreamer isn't a valid URI

If I change the code below

ws_url = 'wss://demo-apd.marketdatasystem.com/lighstreamer'
connection = await websockets.connect(ws_url)

I have a message of failed connection

thanks for your time

Mak_3000
  • 23
  • 5
  • There is an answer to a similar question [here](https://stackoverflow.com/questions/65480735/use-lightstreamer-with-ig-index-api/74336668#74336668) – BugOrFeature Aug 02 '23 at 13:25

1 Answers1

0

Think you need to use a Lightstreamer client instead of WebSockets. As I understand it, they are two different protocols.

Official Python client from Lightstreamer - https://sdk.lightstreamer.com/ls-python-client/1.0.1/api/intro.html

timborden
  • 1,470
  • 4
  • 18
  • 24