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

2 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

 

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
      21,195
    • Total Posts
      90,731
    • Total Members
      41,304
    • Most Online
      7,522
      10/06/21 10:53

    Newest Member
    sbehdadkia
    Joined 30/01/23 19:24
  • Posts

    • Trying to buy First Trust Nasdaq Cybersecurity ETF (CIBR) but the order keeps getting rejected, even with Order type = limit and expiry = Day (all  sessions).  Please advise.
    • @MongiIG How long does it take to reply to a simple question?
    • Look Ahead to 31/1/23: Big data from the US, China, Japan; PFE, XOM, AMD earnings Ahead of the Fed meeting and the key US jobs report, investors get set to digest retail sales numbers from Germany and Japan. Plus, look out for consumer-related data from China, France, and the US. Earnings see Pfizer (PFE), Exxon Mobil (XOM) and Advanced Micro Devices (AMD) hand in their Q4 report cards.   Angeline Ong | Presenter, Analyst and Content Editor, London | Publication date: Monday 30 January 2023        
×
×
  • Create New...