Jump to content
  • 0

API calls occasionally return ConnectionResetError10054


nickcamel

Question

Posted (edited)

This week the API has been very shaky for me.

The REST-API

  • login,
  • handshake for retrieving CST and X-SECURITY-TOKEN tokens

and the STREAMING API

  • subscribing

all work pretty decent.

However, other REST-API calls, e.g. 'positions', 'prices', 'watchlists', most of the time return a connection error:

Quote

Connection broken: ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)

Concurrent calls, say 1 in 50, returns an OK response. Concurrent = call, get connection broken response, wait, same call again, i.e. without any new logout / login routines.

I've tried with both live and demo account. Same behavior.

Funny enough, 'positions/otc' seem to work most of the time.

Anyone know what's up?

Edited by nickcamel
added working REST-API call
Link to comment

4 answers to this question

Recommended Posts

  • 1
On 07/07/2022 at 07:26, nickcamel said:

This week the API has been very shaky for me.

The REST-API

  • login,
  • handshake for retrieving CST and X-SECURITY-TOKEN tokens

and the STREAMING API

  • subscribing

all work pretty decent.

However, other REST-API calls, e.g. 'positions', 'prices', 'watchlists', most of the time return a connection error:

Concurrent calls, say 1 in 50, returns an OK response. Concurrent = call, get connection broken response, wait, same call again, i.e. without any new logout / login routines.

I've tried with both live and demo account. Same behavior.

Funny enough, 'positions/otc' seem to work most of the time.

Anyone know what's up?

Hi @nickcamel,

You can reach out to webapisupport@ig.com for assistance on API.  Send them as much information as possible, they will come back to you accordingly.

All the best - Arvin

  • Like 1
Link to comment
  • 0

I think I managed to figure it out and resolve this issue.

Previously (for years) I used to always send a body along with the request

Quote

 body={}
...
requests.request(method, url, headers=headers, json=body)

Even if the body was empty.

This doesn’t seem to be a stable solution any longer for unknown reasons, (first detected 2022-07-04).

That’s also, I believe, why the ‘position/otc’ – POST would work, because it would send a non-empty body (as required).

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • General Statistics

    • Total Topics
      19,581
    • Total Posts
      87,058
    • Total Members
      68,879
    • Most Online
      7,522
      10/06/21 10:53

    Newest Member
    mxsonpxrker
    Joined 19/08/22 02:33
  • Posts

    • I've heard people say "you can draw lines on charts and price will hit them eventually"  & "the trend is your friend until it ends"    my view is, you just have to find the right "fiend" 
    • Elliott Wave Analysis TradingLounge Daily Chart, 19 August 2022, Cardano(ADAUSD) ADAUSD Elliott Wave Technical Analysis Function: Counter trend Mode: Corrective Structure: Flat Position: Wave ((C)) Direction Next higher Degrees: Wave II of Motive Details: corrective Expanded Flat In wave two, wave ((c)) is usual y 1.618 x wave ((A)). Wave Cancel invalid Level: 0.4050 Cardano(ADAUSD) Trading Strategy: As this is a short correction to the uptrend so we should take the opportunity when the second wave is finished to join the trend again. Cardano(ADAUSD) Technical Indicators: MACD crosses the signal line above the zero line. It may be a short-term reversal. TradingLounge Analyst: Kittiampon Somboonsod     Elliott Wave Analysis TradingLounge 4H Chart, 19 August 2022, Cardano(ADAUSD) ADAUSD Elliott Wave Technical Analysis Function: Counter trend Mode: Corrective Structure: Flat Position: Wave ((C)) Direction Next higher Degrees: Wave II of Motive Details: corrective Expanded Flat In wave two, wave ((c)) is usual y 1.618 x wave ((A)). Wave Cancel invalid Level: 0.4050 Cardano(ADAUSD) Trading Strategy: As this is a short correction to the uptrend so we should take the opportunity when the second wave is finished to join the trend again. Cardano(ADAUSD) Technical Indicators: RSI enters Oversold Zone, beware of short term reversal
    • Hi @wendymo, Thank you for your post. Could you please clarify if you are trying to transfer in or out of IG? You might find some help here: https://www.ig.com/uk/help-and-support/investments/transferring-investments Thank you - Arvin
×
×
  • Create New...