Jump to content
  • 0

Historical Prices URL - Status Code 404


jwmshaw

Question

Hi,

I am using a Python script to retrieve historical prices of Brent Crude, logging into the API is fine (status code 200), however, when I use a GET request for retrieving the prices I keep getting a status code of 404 (invalid URL), can anyone point out what I'm doing wrong, I've been at it for a very long time now and give in!

The IG Labs references states that the endpoint is:

 /prices/{epic}/{resolution}/{startDate}/{endDate}

The API companion spits out this:

https://api.ig.com/gateway/deal/prices/IX.D.FTSE.DAILY.IP?resolution=MINUTE_5&from=2015-07-21T00%3A00%3A00&to=2015-07-21T23%3A59%3A59

I'm using this:

https://api.ig.com/gateway/deal/prices/IX.D.FTSE.DAILY.IP/MINUTE_5/2015-07-21T00:00:00/2015-07-21T23:59:59

Thanks

Link to comment

4 answers to this question

Recommended Posts

  • 0
23 hours ago, jwmshaw said:

Hi,

I am using a Python script to retrieve historical prices of Brent Crude, logging into the API is fine (status code 200), however, when I use a GET request for retrieving the prices I keep getting a status code of 404 (invalid URL), can anyone point out what I'm doing wrong, I've been at it for a very long time now and give in!

The IG Labs references states that the endpoint is:

 /prices/{epic}/{resolution}/{startDate}/{endDate}

The API companion spits out this:

https://api.ig.com/gateway/deal/prices/IX.D.FTSE.DAILY.IP?resolution=MINUTE_5&from=2015-07-21T00%3A00%3A00&to=2015-07-21T23%3A59%3A59

I'm using this:

https://api.ig.com/gateway/deal/prices/IX.D.FTSE.DAILY.IP/MINUTE_5/2015-07-21T00:00:00/2015-07-21T23:59:59

Thanks

Hi @jwmshaw

Thanks for reaching out. Please email webapisupport@ig.com for more assistance. This team was created to help with all API queries. All the best. OfentseIG

Link to comment
  • 0

The date format in your URL looks incorrect. It should be:

https://api.ig.com/gateway/deal/prices/IX.D.FTSE.DAILY.IP/MINUTE_5/2015-07-21 00:00:00/2015-07-21 23:59:59

i.e. a space between the date and time, not a "T" character.

Also, this date range will never return any data as the furthest you can go back for 5 min data is 360 days, see https://labs.ig.com/faq for more details.

I hope this helps.

Andy

 

  • Thanks 1
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

    • The mischievous amphibian who became a meme legend? Well, meet Apu, his wide-eyed, optimistic cousin, taking the internet by storm – and now, perhaps, the world of finance. Apu, also known as Peepo or Helper, is a kinder, gentler Pepe variant. Tired of the often-scammy memecoin scene, Apu (or rather, Apu's devoted community) decided to create something different: $APU, a "fairly launched, fully transparent coin" built by and for "all frens." Here's where things get interesting. $APU's narrative is one of resilience and community power. Fueled by the cryptocurrency community's enthusiasm, $APU was initially launched with the best of intentions. However, the dream took a nasty turn when the original developer pulled the rug – a disheartening scenario for many crypto enthusiasts. Today, $APU stands as a testament to community empowerment. It's a beacon of hope for projects facing similar challenges, a reminder that collaboration and resilience can transform setbacks into stepping stones. It's also worth noting that another community-driven memecoin, $MASSA, recently found a home on the Bitget exchange. Could this be a sign of things to come for $APU? What are your thoughts? Does Apu's story inspire you? Can a memecoin truly become a legitimate force in the volatile world of cryptocurrency? Share your thoughts and predictions in the comments below!
    • The price shown on the graph is the price after the IG's fee taken. That is the reason for discrepancy.
    • I am a relatively newbie. I have seen similar and also have seen automated closed position has a loss though the close price I have set was above the price I have bought. After about 6 months with a lot of mysterious losses though my closing price was above the opening price, I discovered this was because of the amount charged for opening/closing a position. This is right below BUY and SELL boxes on the right in very small font. This amount vary from  0.9 to 33 or more depending on the level of trading at the time you open or close. It also happens (god knows why it is set to be so, except that the trader is not watching) when there is a lot of buying and selling going on, like an important news has suddenly been out and the result was not the market expected. As a result, I delete all my automated BUY/SELL values before I stop trading for the day. Remember, the the software is set up to favor the IG, not the retail seller. That is why 70% or more end up in loss.  
×
×
  • Create New...
us