Looking for WTI or Brent crude oil real-time price API

Discussion in 'Data Sets and Feeds' started by biophil, Jan 1, 2015.

  1. biophil

    biophil

    Hi, I've done a little research on this topic and I'm hitting dead ends.

    I'm trying to create a Python script that tracks the price of oil. I don't care which oil price; WTI or Brent short-term futures would certainly be the best, but for starters I'd take anything. The trouble is I'm having a hard time finding a semi-real-time price feed API that I don't have to pay for. Quandl gives daily prices, but that's probably too slow for what I want.

    Even an hour delay probably wouldn't kill me. I want my script to be able to check the price of oil every couple hours.

    The question: does anybody know of a free (or inexpensive) commodities price API that updates its data more often than daily?
     
    jmayer likes this.
  2. just21

    just21

  3. jharmon

    jharmon

    You are way too undercapitalized to trade if you can't afford a delayed feed.

    If you don't value your time developing some sort of crappy scraping solution off a web site you are fooling yourself.

    When you decide to pay:
    IQFeed
    eSignal
    IB as part of your brokerage account
    Metastock Xenith

    There's far better options out there when you graduate to the major league and want real data quality and reliability.
     
  4. biophil

    biophil

    Thanks for the respectful reply! I'm glad you so thoroughly understand my intentions for this data that you felt it worth your time to tell me that it's not going to be possible to do what I want to do. Apparently if my goals aren't the same as yours, they're worth public derision.
     
    jmayer likes this.
  5. jharmon

    jharmon

    Judging by your reply you need some tough advice.
     
  6. CJV123

    CJV123

    Investing.com has only 15-second delayed data.
     
  7. jmayer

    jmayer

    No need to scrape from CME - though they don't seem to publicize it anywhere, if you inspect the network requests made from any of the CME delayed-feed price pages, you will see they do actually have a very nice API that can give you everything you want instantly through a simple GET request. For instance, http://www.cmegroup.com/CmeWS/mvc/Quotes/FutureContracts/XNYM/G?quoteCodes=CLM5 should give you the latest available price for 1-month WTI, while http://www.cmegroup.com/CmeWS/mvc/Quotes/FutureContracts/XNYM/G?quoteCodes=CLM5,CLN5,CLQ5,CLU5,CLV5,CLX5,CLZ5,CLF6,CLG6,CLH6,CLJ6,CLK6,CLM6,CLN6,CLQ6,CLU6,CLV6,CLX6,CLZ6,CLF7,CLG7,CLH7,CLJ7,CLK7,CLM7,CLN7,CLQ7,CLU7,CLV7,CLX7,CLZ7,CLF8,CLG8,CLH8,CLJ8,CLK8,CLM8,CLN8,CLQ8,CLU8,CLV8,CLX8,CLZ8,CLF9,CLG9,CLH9,CLJ9,CLK9,CLM9,CLN9,CLQ9,CLU9,CLV9,CLX9,CLZ9,CLF0,CLG0,CLH0,CLJ0,CLK0,CLM0,CLN0,CLQ0,CLU0,CLV0,CLX0,CLZ0,CLM1,CLZ1,CLM2,CLZ2,CLM3,CLZ3&_=1430873961110 will give you all of the available contract maturities, at the particular time stamp specified at the end of the URL. Of course I have no idea whether or not accessing their API is consistent with their terms of use - since they don't publicize it anywhere, they may not intend for others to use it, but it isn't at all difficult to do...
     
  8. The _ parameter looks like a Unix timestamp with 3 extra digits... You have info on this?