Jump to content
Sign in to follow this  
aperson

No endpoint found on sample price history query

Recommended Posts

fetch(`https://ciapi.cityindex.com/TradingAPI/market/401166448/barhistory?interval=MINUTE&span=15&PriceBars=20&PriceType=BID`,{
  method:'POST',
  headers:{
    'Accept': 'application/json',
    'Content-Type':'application/json',
    'Session':'*****',
    'UserName':'*****
  }
}).then(res => res.json())
.then(res=>{
  console.log(res);
})

 

Hi I'm using node with the node-fetch module and am trying to get a sample query, but am getting  {httpstatus:404  errormessage:'Endpoint not found'}

I'm on a demo account and was told to use the live API which is this but all my sample queries end up in this error.

Is my account working or i just don't understand something really simple here?....

 

Thanks!


 

Share this post


Link to post

Hello,

Which brand / region are you trading with? For example, are you a Forex.com US client?

I suspect the MarketId you are using is not available for your account. You can perform the instructions detailed at: http://docs.labs.gaincapital.com/#How Do I/Find Market ID.htm%3FTocPath%3DHow%20Do%20I...%3F|_____1 to search for a MarketId that your account can trade.

Kind Regards, PM

Share this post


Link to post

Hello,

You mentioned you are using a demo account - since this is the case, please send me a private message on this forum with your demo account credentials. I'm going to try sending some calls with the account to check that everything is working.

With the test accounts I am using, the endpoints are responding normally / as expected.

Many thanks, PM

Share this post


Link to post

Hi @aperson,

Thank you for sending the account details. I have spotted the problem with your first initial call for GetLatestPriceBars, and presumably it is the same issue when you tried the ListMarketSearch call.

Both calls are HTTP GET calls. In your first post, I see you put:

method: 'POST',

It should be GET. Using your account and a GET call I can retrieve price bars for the market as expected. Please change the POST to GET and it should work for you too.

image.png

 

Kind Regards, PM

 

Share this post


Link to post

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
Sign in to follow this  
×