Lightstreamer queries

22 posts / 0 new
Last post
Lightstreamer queries

Hi Chris
I'm successfully using the API to access account details etc., but had some issues with Lightstreamer using direct connections. It seems that LS_user is not validated and LS_adapter_set should not be provided though LS documentation says the contrary; if I set LS_adapter_set to 'InVisionProvider' (which I guessed at from the Javascript example and some other code on the web) this gives an error 2, "Requested Adapter Set not available". Could you clarify?

Lightstreamer queries

Hi moggie, welcome to the Community.

This was actually an error with the documentation. You should not have to set the adapter set, so either leave it blank or set it to 'DEFAULT'. We've corrected the documentation to reflect this - sorry for the confusion. Out of interest, where else did you see InVisionProvider?

Hi Chris

Hi Chris

Thanks for clarifying. I got things working in PHP over the weekend.
Something else that wasn't clear. There's a cap of 40 subscriptions, but is that 40 tables (in Lightstreamer terminology), or would 20 table subscriptions each with 2 symbols count as 40?


Edited by Chris 28/07/14 11:44

Lightstreamer queries

Thanks Nick.

The subscription limit of 40 elements in fact applies to Lightstreamer "items", specifically for market items.

This means you can use as many tables as you wish, so long as your overall number of market items does not exceed the limit of 40.

Hope this helps!

Ciao Chris,

Ciao Chris,
i receive the same error of Moggie but i cannot fix it with setting it as "" or "DEFAULT" or " " .

============== below you can find my code ===================

def CREATE_STREAM_CONNECTION (login_data, prod_demo='DEMO'):

LOGIN_URL = prod_demo_url(prod_demo) + '/create_session.txt'

LOGIN_ID = login_data[prod_demo]["USERNAME"]

LOGIN_PWD = login_data[prod_demo]["PASSWORD"]

LOGIN_API_KEY = login_data[prod_demo]["API_KEY"]

"LS_user" : LOGIN_ID,
"LS_password" : LOGIN_PWD,
"LS_adapter_set" : 'DEFAULT' }

r =, data=LOGIN_DATA )

RESPONSE_STATUS_CODE = r.status_code


================= the output of prints ======================

Requested Adapter Set not available


it seams that in every case i receive "Requested Adapter Set not available", I tried "" or "DEFAULT" or " " , both Production and Test environments. I'm doing something wrong ?

Thanks and br,


Hi, an update from my tests: it seems that if I set it with 'DEFAULTS' it returns "wrong user/pwd error", otherwise, if I use blank or any other value, it returns "Requested Adapter Set not available".

So it seems to be an issue of my account, right ?

In the meanwhile I wrote to assistance...

Thanks and br,


Hi Dario, has this been sorted for you? If not, let me know.


Ciao Chris, i partially

Ciao Chris, i partially solved my problem:

- the adapter has to be set as =DEFAULT
- the complete link (DEMO) currently is

but actually I cannot use lightreamer with Python. I already checked:

- : it's a beta of 2 yrs ago and it doesn't work. No documentation is available.
- : the python part here is not clear and not explained.
- : here "femto" tried to use (i indicated), but without success

Since I already easily developed, as "femto", the REST part (obtain tokens, downloading price history, etc), I would like to ask if anyone could provide a minimalist Python code to connect to lighstreamer and subscribe to a market price.

Any help will be appreciated.

Thanks and br,



I'm also still looking for help about streaming API and Python.

About REST API I think that's ok.
now it returns Pandas DataFrame which is very convenient.

but I'm sick with this streaming API.

I asked support directly to IG but I didn't get any help.


Hi All,

Hi All,

just released on GitHub a simple Python script that shows a minimal client-side implementation of the Lightstreamer Server Text mode Protocol.


it will be nice if IG also

it will be nice if IG also could support space in block code in this forum...
that could be useful for Python users.

Sample Python Code

Here is a link to some sample Python code that will stream GBP/USD.

It's a slightly modified version of the py-lightsreamer code. Provided with no guarantees! It works for me under ActivePython with requests added

Chris - Perhaps you could attach the code to this forum somewhere?

Ciao Ixta, I tried your code

Ciao Ixta, I tried your code but I receive following error

Warning (from warnings module):
File "C:\Python27\lib\site-packages\requests\packages\urllib3\", line 734
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See:
New state: connecting Lightstreamer session
New state: disconnected from Lightstreamer

(no new update after this line)
I have Python 2.7.2.

Any idea?

Thanks and br

Same problem here

Same problem here

I will have a look at gianluca.finocchiaro code

As it's easier to collaborate

As it's easier to collaborate using GitHub I have done a project for this available at

Make sure you are running the

Make sure you are running the latest Python 2.7.8

Something similar was happening for me around the time that IG disabled SSLv3 support (due to the vulnerabilities that came out in SSLv3 recently). The SSL library needs to be able to support TLS instead

If you haven't sorted this

If you haven't sorted this yet, you can do so by setting "verify=true" in the statements. If you have the certifi package installed urllib3 will pick up the root certificates from that.

Hi All,

Hi All,
my side this last code provided works, but I would like to ask you the meaning of a part of code:

priceTable = igls.Table(client,
item_ids='L1:CS.D.GBPUSD.CFD.IP', <-------------------- what means here "L1:" ?
item_factory=lambda row: tuple(float(v) for v in row)

my understanding is that there should be inserted a combination of labels as indicated in Chart subscriptions section of ; for this reason I tried to use instead "CHART:CS.D.EURJPY.CFD.IP:TICK" (and only 'OFR' as schema) but it didn't work. Moreover i cannot find "L1" in streaming-api-reference, what it means?

I'm doing something wrong?

Best regards!

Hi Colombao,

Hi Colombao,

Glad to hear the code is working for you.

The L1 should really be changed to MARKET, although either seems to work (I suspect L1 just refers to Level 1 Market Depth). Also note that the EPIC that I provided in the sample code seems to no longer be valid and will need to be replaced with a valid EPIC

Your CHART subscription looks correct, although I have never tried to subscribe to a CHART stream before so I can't really comment any further i'm afraid

Hi all,

Hi all,

Thanks femto for your library !! it works for me

L1 was a V1 and MARKET a V2 ?

L1 was a V1 and MARKET a V2 ???

Or there is a L2 for the one who are doing forex direct or shares ???

New version of my Python

New version of my Python client for IG Stream API

not yet merged with master
not yet publish on PyPi

Log in or register to post comments