Jump to content
  • 0

DEMO API 500 - Internal Server Error


martik

Question

Hello!

I'm facing issues with the API's for DEMO account.
I can successfully connect to the account, but cannot execute any other API calls like fetching open positions.

It works well for LIVE account.
I'm using IG Python Libraries, with below base urls:

D_BASE_URL = {"live": "https://api.ig.com/gateway/deal", "demo": "https://demo-api.ig.com/gateway/deal"}

As it throws 500 (Internal Server Error) this is something on IG end(or at least it doesn't give me a correct output if there is anything on my end). 

Anyone else facing the same issue or has any suggestion how I can proceed?

<-- LOG -->

#DEMO
ACTION:
create
ENDPOINT:
/session
PARAMS:
{'identifier': '***', 'password': '***'}
{'headers': {'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}, 'auth': None, 'proxies': {}, 'hooks': {'response': []}, 'params': {}, 'stream': False, 'verify': True, 'cert': None, 'max_redirects': 30, 'trust_env': True, 'cookies': <RequestsCookieJar[]>, 'adapters': OrderedDict([('https://', <requests.adapters.HTTPAdapter object at 0x7fba0276bcc0>), ('http://', <requests.adapters.HTTPAdapter object at 0x7fba0276bd68>)])}
VERSION:
2
{'accountType': 'CFD', 'accountInfo': {***}
**ACCOUNTID**

Connected to account Demo-cfd(**ACCOUNTID**), Balance : *** SEK

 

trader.fetchOpenPositions - fetching open positions!
trading_ig.fetch_open_positions
ACTION:
read
ENDPOINT:
/positions
PARAMS:
{}
{'headers': {'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}, 'auth': None, 'proxies': {}, 'hooks': {'response': []}, 'params': {}, 'stream': False, 'verify': True, 'cert': None, 'max_redirects': 30, 'trust_env': True, 'cookies': <RequestsCookieJar[]>, 'adapters': OrderedDict([('https://', <requests.adapters.HTTPAdapter object at 0x7fba0276bcc0>), ('http://', <requests.adapters.HTTPAdapter object at 0x7fba0276bd68>)])}
VERSION:
1
<Response [500]>
{'errorCode': None}



#LIVE
ACTION:
create
ENDPOINT:
/session
PARAMS:
{'identifier': '***', 'password': '***'}
{'headers': {'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}, 'auth': None, 'proxies': {}, 'hooks': {'response': []}, 'params': {}, 'stream': False, 'verify': True, 'cert': None, 'max_redirects': 30, 'trust_env': True, 'cookies': <RequestsCookieJar[]>, 'adapters': OrderedDict([('https://', <requests.adapters.HTTPAdapter object at 0x7f71ee767940>), ('http://', <requests.adapters.HTTPAdapter object at 0x7f71ee7679e8>)])}
VERSION:
2
{'accountType': 'CFD', 'accountInfo': {***}
**ACCOUNTID**

Connected to account CFD(**ACCOUNTID**), Balance : *** SEK

 

trader.fetchOpenPositions - fetching open positions!
trading_ig.fetch_open_positions
ACTION:
read
ENDPOINT:
/positions
PARAMS:
{}
{'headers': {'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}, 'auth': None, 'proxies': {}, 'hooks': {'response': []}, 'params': {}, 'stream': False, 'verify': True, 'cert': None, 'max_redirects': 30, 'trust_env': True, 'cookies': <RequestsCookieJar[]>, 'adapters': OrderedDict([('https://', <requests.adapters.HTTPAdapter object at 0x7f71ee767940>), ('http://', <requests.adapters.HTTPAdapter object at 0x7f71ee7679e8>)])}
VERSION:
1
<Response [200]>
{'positions': []}
Open positions : 0



 


 

Link to comment

1 answer to this question

Recommended Posts

  • 0
Guest Stesol

Hi,

I have the same issue since yesterday, just the other way round: OK for Demo, response 500 (errorCode: none) for Live (also in the REST companion).

BR

Stef

 

 

 

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
  • image.png

  • Posts

    • Hi @Nate,  Unfortunately, purchasing Gold on IG isn't available, even if it's digital gold that you can buy, hold, and later sell for updated rates. However, with IG, you can trade Gold on our CFD and Spreadbet platforms using Leverage/Margin and capitalize on price differences. You have the option for spot trading or trading futures, holding positions as long as you have sufficient funds to cover your Margin. It's important to note that with spot trading, you'll incur daily interest fees for the leverage used, whereas futures trading doesn't involve additional interest fees as they are covered within our spread.  I agree that storing gold like Smaug isn't always ideal. You have to constantly worry about Dwarves, Elves, or even Hobbits! Jokes aside, you can research how to trade commodities on our platform with leverage and decide what suits you best. All the best, AshishIG
    • Hi, Placed £200 in a Gold Future deal but when it slightly goes down in value my leftover funds are being used and my equity is raised. Why are my leftover funds being used? Can I not just put everything in gold and keep a 100% equity in the deal? wont loose money unless I sell right? 
    • Elliott Wave Analysis TradingLounge Daily Chart Cardano/ U.S. dollar(ADAUSD) ADAUSD Elliott Wave Technical Analysis Function: Counter Trend Mode: Corrective Structure: Flat Position: Wave C Direction Next higher Degrees: wave (II) of Impulse Wave Cancel invalid level: Details: Wave II Is equal to 61.8% of Wave I at 0.358 Cardano/ U.S. dollar(ADAUSD)Trading Strategy: The second wave correction is likely to go down to test the 0.356 level before rising again in the third wave. Therefore, the overall picture is a short-term pullback to continue rising. Wait for the correction to complete to rejoin the trend. Cardano/ U.S. dollar(ADAUSD)Technical Indicators: The price is above the MA200 indicating a Downtrend, The Wave Oscillator is a Bearish Momentum. Elliott Wave Analysis TradingLounge H4 Chart, Cardano/ U.S. dollar(ADAUSD) LINKUSD Elliott Wave Technical Analysis Function: Follow Trend Mode: Motive Structure: Impulse Position: Wave 5 Direction Next higher Degrees: Wave ((C)) of Zigzag Wave Cancel invalid Level: 81.238 Details: The Five-Wave Decline of Wave ((C)) trend to test 11.582 Level Cardano/ U.S. dollar(ADAUSD)Trading Strategy: The second wave correction is likely to go down to test the 0.356 level before rising again in the third wave. Therefore, the overall picture is a short-term pullback to continue rising. Wait for the correction to complete to rejoin the trend. Cardano/ U.S. dollar(ADAUSD)Technical Indicators: The price is above the MA200 indicating a Downtrend, The Wave Oscillator is a Bearish Momentum. Technical Analyst : Kittiampon Somboonsod  Source : Tradinglounge.com get trial here!    
×
×
  • Create New...
us