getCRBIndexes API

The getCRBIndexes API provides historical price data for our CRB BLS Spot Commodity Indexes. The Spot Market Price Index measures price movements of 22 cash commodities whose markets are highly sensitive to changes in economic conditions.

All APIs

Contact Us to Get Access

Inputs

startDate optional

The start date of the historical data query. This parameter should be set to the desired start date/time for the query (the result set will include records back to, and including, this value). If not set, the value will default to the date 6 months back from present day. The value should conform to the format yyyymmdd[hhmm[ss]], where fields in brackets are optional (Do not include the brackets themselves). Any optional fields that are not explicitly set will default to 0 (i.e. 20090203 will default to 20090203000000 or February 3, 2009 at 00:00:00).

Type
dateTime (A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.) 
Example
20100101 
Default
20180215000000 

endDate optional

The end data of the historical data query. This parameter should be set to the desired end date/time for the query (the result set will include records up to, but not including, this value). If not set, the value will default to the end of the current day. The value should conform to the format yyyymmdd[hhmm[ss]], where fields in brackets are optional (Do not include the brackets themselves). Any optional fields that are not explicitly set will default to 0 (i.e. 20090203 will default to 20090203000000 or February 3, 2009 at 00:00:00).

Type
dateTime (A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.) 
Example
20130101 

maxRecords optional

The maximum amount of records returned. This parameter should be set to the maximum number of records desired. If not specified, there number of records returned will be determined by the date/time parameters specified as well as any defaults that apply to the query.

Type
int (A numeric type defining a whole number. (example: 2)) 
Example
10 

Outputs

Name / Requirement
Description
Type
symbol
always returned
A symbol or code that identifies a financial instrument.
string
A sequence of characters. (example: GOOG)
name
always returned
The name/description for the instrument.
string
A sequence of characters. (example: GOOG)
history
always returned
An object with the date and close price for the provided date range.
enum
A type which includes a list of valid possible values.

Status Code Responses

200
OK
Success
400
Bad Request
The request was invalid, please see the message for more information.
500
Internal Server Error
Something is not working correctly, please contact support.


JSON

GET

GET https://ondemand.websol.barchart.com/getCRBIndexes.json?apikey=YOUR_API_KEY&startDate=20100101&endDate=20130101&maxRecords=10
Host: ondemand.websol.barchart.com

POST

POST https://ondemand.websol.barchart.com/getCRBIndexes.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

apikey=YOUR_API_KEY&startDate=20100101&endDate=20130101&maxRecords=10

Response

{
    "status": {
        "code": 200,
        "message": "Success."
    },
    "results": [
        {
            "symbol": "BZY00",
            "name": "CRB BLS Spot Cash Index",
            "history": [
                {
                    "tradingDay": "2012-12-30",
                    "close": 482.1
                },
                {
                    "tradingDay": "2012-12-28",
                    "close": 481.25
                },
                {
                    "tradingDay": "2012-12-27",
                    "close": 482.02
                },
                {
                    "tradingDay": "2012-12-26",
                    "close": 482.44
                },
                {
                    "tradingDay": "2012-12-24",
                    "close": 482.43
                },
                {
                    "tradingDay": "2012-12-21",
                    "close": 483.6
                },
                {
                    "tradingDay": "2012-12-20",
                    "close": 483.56
                },
                {
                    "tradingDay": "2012-12-19",
                    "close": 485.53
                },
                {
                    "tradingDay": "2012-12-18",
                    "close": 485.72
                },
                {
                    "tradingDay": "2012-12-17",
                    "close": 484.91
                }
            ]
        },
        {
            "symbol": "B7Y00",
            "name": "CRB BLS Metals Index",
            "history": [
                {
                    "tradingDay": "2012-12-30",
                    "close": 918.72
                },
                {
                    "tradingDay": "2012-12-28",
                    "close": 915.15
                },
                {
                    "tradingDay": "2012-12-27",
                    "close": 918.35
                },
                {
                    "tradingDay": "2012-12-26",
                    "close": 913.68
                },
                {
                    "tradingDay": "2012-12-24",
                    "close": 911.17
                },
                {
                    "tradingDay": "2012-12-21",
                    "close": 913.42
                },
                {
                    "tradingDay": "2012-12-20",
                    "close": 911.68
                },
                {
                    "tradingDay": "2012-12-19",
                    "close": 919.23
                },
                {
                    "tradingDay": "2012-12-18",
                    "close": 920.68
                },
                {
                    "tradingDay": "2012-12-17",
                    "close": 914.83
                }
            ]
        },
        {
            "symbol": "BUY00",
            "name": "CRB BLS Textiles Index",
            "history": [
                {
                    "tradingDay": "2012-12-30",
                    "close": 276.79
                },
                {
                    "tradingDay": "2012-12-28",
                    "close": 276.52
                },
                {
                    "tradingDay": "2012-12-27",
                    "close": 277.6
                },
                {
                    "tradingDay": "2012-12-26",
                    "close": 278.35
                },
                {
                    "tradingDay": "2012-12-24",
                    "close": 277.54
                },
                {
                    "tradingDay": "2012-12-21",
                    "close": 277.54
                },
                {
                    "tradingDay": "2012-12-20",
                    "close": 277.23
                },
                {
                    "tradingDay": "2012-12-19",
                    "close": 277.27
                },
                {
                    "tradingDay": "2012-12-18",
                    "close": 277.35
                },
                {
                    "tradingDay": "2012-12-17",
                    "close": 276.9
                }
            ]
        },
        {
            "symbol": "BVY00",
            "name": "CRB BLS Raw Industrials Index",
            "history": [
                {
                    "tradingDay": "2012-12-30",
                    "close": 526.75
                },
                {
                    "tradingDay": "2012-12-28",
                    "close": 525.81
                },
                {
                    "tradingDay": "2012-12-27",
                    "close": 527.15
                },
                {
                    "tradingDay": "2012-12-26",
                    "close": 526.55
                },
                {
                    "tradingDay": "2012-12-24",
                    "close": 525.53
                },
                {
                    "tradingDay": "2012-12-21",
                    "close": 526.02
                },
                {
                    "tradingDay": "2012-12-20",
                    "close": 525.46
                },
                {
                    "tradingDay": "2012-12-19",
                    "close": 527.15
                },
                {
                    "tradingDay": "2012-12-18",
                    "close": 526.4
                },
                {
                    "tradingDay": "2012-12-17",
                    "close": 524.85
                }
            ]
        },
        {
            "symbol": "BWY00",
            "name": "CRB BLS Foodstuffs Index",
            "history": [
                {
                    "tradingDay": "2012-12-30",
                    "close": 423.87
                },
                {
                    "tradingDay": "2012-12-28",
                    "close": 423.14
                },
                {
                    "tradingDay": "2012-12-27",
                    "close": 423.25
                },
                {
                    "tradingDay": "2012-12-26",
                    "close": 424.84
                },
                {
                    "tradingDay": "2012-12-24",
                    "close": 426
                },
                {
                    "tradingDay": "2012-12-21",
                    "close": 427.96
                },
                {
                    "tradingDay": "2012-12-20",
                    "close": 428.53
                },
                {
                    "tradingDay": "2012-12-19",
                    "close": 430.81
                },
                {
                    "tradingDay": "2012-12-18",
                    "close": 432.1
                },
                {
                    "tradingDay": "2012-12-17",
                    "close": 432.19
                }
            ]
        },
        {
            "symbol": "BXY00",
            "name": "CRB BLS Fats and Oils Index",
            "history": [
                {
                    "tradingDay": "2012-12-30",
                    "close": 471.49
                },
                {
                    "tradingDay": "2012-12-28",
                    "close": 471.06
                },
                {
                    "tradingDay": "2012-12-27",
                    "close": 469.41
                },
                {
                    "tradingDay": "2012-12-26",
                    "close": 469.41
                },
                {
                    "tradingDay": "2012-12-24",
                    "close": 470.48
                },
                {
                    "tradingDay": "2012-12-21",
                    "close": 476.07
                },
                {
                    "tradingDay": "2012-12-20",
                    "close": 474.01
                },
                {
                    "tradingDay": "2012-12-19",
                    "close": 475.3
                },
                {
                    "tradingDay": "2012-12-18",
                    "close": 473.99
                },
                {
                    "tradingDay": "2012-12-17",
                    "close": 475.55
                }
            ]
        },
        {
            "symbol": "BYY00",
            "name": "CRB BLS Livestock Index",
            "history": [
                {
                    "tradingDay": "2012-12-30",
                    "close": 599.67
                },
                {
                    "tradingDay": "2012-12-28",
                    "close": 598.53
                },
                {
                    "tradingDay": "2012-12-27",
                    "close": 598.3
                },
                {
                    "tradingDay": "2012-12-26",
                    "close": 596.74
                },
                {
                    "tradingDay": "2012-12-24",
                    "close": 594.6
                },
                {
                    "tradingDay": "2012-12-21",
                    "close": 594.6
                },
                {
                    "tradingDay": "2012-12-20",
                    "close": 599.46
                },
                {
                    "tradingDay": "2012-12-19",
                    "close": 600.05
                },
                {
                    "tradingDay": "2012-12-18",
                    "close": 594.15
                },
                {
                    "tradingDay": "2012-12-17",
                    "close": 591.34
                }
            ]
        }
    ]
}

XML

GET

GET https://ondemand.websol.barchart.com/getCRBIndexes.xml?apikey=YOUR_API_KEY&startDate=20100101&endDate=20130101&maxRecords=10
Host: ondemand.websol.barchart.com

POST

POST https://ondemand.websol.barchart.com/getCRBIndexes.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

apikey=YOUR_API_KEY&startDate=20100101&endDate=20130101&maxRecords=10

Response


<?xml version="1.0" encoding="utf-8"?>
 <getCRBIndexes>
  <status>
   <code>200</code>
   <message>Success.</message>
  </status>
  <item>
   <symbol>BZY00</symbol>
   <name>CRB BLS Spot Cash Index</name>
   <history>
    <priceData>
     <tradingDay>2012-12-30</tradingDay>
     <close>482.1</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-28</tradingDay>
     <close>481.25</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-27</tradingDay>
     <close>482.02</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-26</tradingDay>
     <close>482.44</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-24</tradingDay>
     <close>482.43</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-21</tradingDay>
     <close>483.6</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-20</tradingDay>
     <close>483.56</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-19</tradingDay>
     <close>485.53</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-18</tradingDay>
     <close>485.72</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-17</tradingDay>
     <close>484.91</close>
    </priceData>
   </history>
  </item>
  <item>
   <symbol>B7Y00</symbol>
   <name>CRB BLS Metals Index</name>
   <history>
    <priceData>
     <tradingDay>2012-12-30</tradingDay>
     <close>918.72</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-28</tradingDay>
     <close>915.15</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-27</tradingDay>
     <close>918.35</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-26</tradingDay>
     <close>913.68</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-24</tradingDay>
     <close>911.17</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-21</tradingDay>
     <close>913.42</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-20</tradingDay>
     <close>911.68</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-19</tradingDay>
     <close>919.23</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-18</tradingDay>
     <close>920.68</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-17</tradingDay>
     <close>914.83</close>
    </priceData>
   </history>
  </item>
  <item>
   <symbol>BUY00</symbol>
   <name>CRB BLS Textiles Index</name>
   <history>
    <priceData>
     <tradingDay>2012-12-30</tradingDay>
     <close>276.79</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-28</tradingDay>
     <close>276.52</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-27</tradingDay>
     <close>277.6</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-26</tradingDay>
     <close>278.35</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-24</tradingDay>
     <close>277.54</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-21</tradingDay>
     <close>277.54</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-20</tradingDay>
     <close>277.23</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-19</tradingDay>
     <close>277.27</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-18</tradingDay>
     <close>277.35</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-17</tradingDay>
     <close>276.9</close>
    </priceData>
   </history>
  </item>
  <item>
   <symbol>BVY00</symbol>
   <name>CRB BLS Raw Industrials Index</name>
   <history>
    <priceData>
     <tradingDay>2012-12-30</tradingDay>
     <close>526.75</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-28</tradingDay>
     <close>525.81</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-27</tradingDay>
     <close>527.15</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-26</tradingDay>
     <close>526.55</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-24</tradingDay>
     <close>525.53</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-21</tradingDay>
     <close>526.02</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-20</tradingDay>
     <close>525.46</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-19</tradingDay>
     <close>527.15</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-18</tradingDay>
     <close>526.4</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-17</tradingDay>
     <close>524.85</close>
    </priceData>
   </history>
  </item>
  <item>
   <symbol>BWY00</symbol>
   <name>CRB BLS Foodstuffs Index</name>
   <history>
    <priceData>
     <tradingDay>2012-12-30</tradingDay>
     <close>423.87</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-28</tradingDay>
     <close>423.14</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-27</tradingDay>
     <close>423.25</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-26</tradingDay>
     <close>424.84</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-24</tradingDay>
     <close>426</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-21</tradingDay>
     <close>427.96</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-20</tradingDay>
     <close>428.53</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-19</tradingDay>
     <close>430.81</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-18</tradingDay>
     <close>432.1</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-17</tradingDay>
     <close>432.19</close>
    </priceData>
   </history>
  </item>
  <item>
   <symbol>BXY00</symbol>
   <name>CRB BLS Fats and Oils Index</name>
   <history>
    <priceData>
     <tradingDay>2012-12-30</tradingDay>
     <close>471.49</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-28</tradingDay>
     <close>471.06</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-27</tradingDay>
     <close>469.41</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-26</tradingDay>
     <close>469.41</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-24</tradingDay>
     <close>470.48</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-21</tradingDay>
     <close>476.07</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-20</tradingDay>
     <close>474.01</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-19</tradingDay>
     <close>475.3</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-18</tradingDay>
     <close>473.99</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-17</tradingDay>
     <close>475.55</close>
    </priceData>
   </history>
  </item>
  <item>
   <symbol>BYY00</symbol>
   <name>CRB BLS Livestock Index</name>
   <history>
    <priceData>
     <tradingDay>2012-12-30</tradingDay>
     <close>599.67</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-28</tradingDay>
     <close>598.53</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-27</tradingDay>
     <close>598.3</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-26</tradingDay>
     <close>596.74</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-24</tradingDay>
     <close>594.6</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-21</tradingDay>
     <close>594.6</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-20</tradingDay>
     <close>599.46</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-19</tradingDay>
     <close>600.05</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-18</tradingDay>
     <close>594.15</close>
    </priceData>
    <priceData>
     <tradingDay>2012-12-17</tradingDay>
     <close>591.34</close>
    </priceData>
   </history>
  </item>
 </getCRBIndexes>

CSV

GET

GET https://ondemand.websol.barchart.com/getCRBIndexes.csv?apikey=YOUR_API_KEY&startDate=20100101&endDate=20130101&maxRecords=10
Host: ondemand.websol.barchart.com

POST

POST https://ondemand.websol.barchart.com/getCRBIndexes.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

apikey=YOUR_API_KEY&startDate=20100101&endDate=20130101&maxRecords=10

Response

symbol,name,parent
"BYY00","CRB BLS Livestock Index"
"2012-12-17","591.34",""
"2012-12-18","594.15",""
"2012-12-19","600.05",""
"2012-12-20","599.46",""
"2012-12-21","594.6",""
"2012-12-24","594.6",""
"2012-12-26","596.74",""
"2012-12-27","598.3",""
"2012-12-28","598.53",""
"2012-12-30","599.67",""
"BXY00","CRB BLS Fats and Oils Index"
"2012-12-17","475.55",""
"2012-12-18","473.99",""
"2012-12-19","475.3",""
"2012-12-20","474.01",""
"2012-12-21","476.07",""
"2012-12-24","470.48",""
"2012-12-26","469.41",""
"2012-12-27","469.41",""
"2012-12-28","471.06",""
"2012-12-30","471.49",""
"BWY00","CRB BLS Foodstuffs Index"
"2012-12-17","432.19",""
"2012-12-18","432.1",""
"2012-12-19","430.81",""
"2012-12-20","428.53",""
"2012-12-21","427.96",""
"2012-12-24","426",""
"2012-12-26","424.84",""
"2012-12-27","423.25",""
"2012-12-28","423.14",""
"2012-12-30","423.87",""
"BVY00","CRB BLS Raw Industrials Index"
"2012-12-17","524.85",""
"2012-12-18","526.4",""
"2012-12-19","527.15",""
"2012-12-20","525.46",""
"2012-12-21","526.02",""
"2012-12-24","525.53",""
"2012-12-26","526.55",""
"2012-12-27","527.15",""
"2012-12-28","525.81",""
"2012-12-30","526.75",""
"BUY00","CRB BLS Textiles Index"
"2012-12-17","276.9",""
"2012-12-18","277.35",""
"2012-12-19","277.27",""
"2012-12-20","277.23",""
"2012-12-21","277.54",""
"2012-12-24","277.54",""
"2012-12-26","278.35",""
"2012-12-27","277.6",""
"2012-12-28","276.52",""
"2012-12-30","276.79",""
"B7Y00","CRB BLS Metals Index"
"2012-12-17","914.83",""
"2012-12-18","920.68",""
"2012-12-19","919.23",""
"2012-12-20","911.68",""
"2012-12-21","913.42",""
"2012-12-24","911.17",""
"2012-12-26","913.68",""
"2012-12-27","918.35",""
"2012-12-28","915.15",""
"2012-12-30","918.72",""
"BZY00","CRB BLS Spot Cash Index"
"2012-12-17","484.91",""
"2012-12-18","485.72",""
"2012-12-19","485.53",""
"2012-12-20","483.56",""
"2012-12-21","483.6",""
"2012-12-24","482.43",""
"2012-12-26","482.44",""
"2012-12-27","482.02",""
"2012-12-28","481.25",""
"2012-12-30","482.1",""


PHP

<?php

$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');

$params = [
    'apikey' => 'YOUR_API_KEY',
    'startDate' => '20100101',
    'endDate' => '20130101',
    'maxRecords' => '10',
];

$result = $ondemand->getCRBIndexes($params);
var_dump($result);

Classic ASP

Dim ondemand
Dim result

Set ondemand = Server.CreateObject("MSSOAP.SoapClient30")
ondemand.ClientProperty("ServerHTTPRequest") = True
ondemand.MSSoapInit("https://ondemand.websol.barchart.com/service?wsdl")

Set result = ondemand.getCRBIndexes("YOUR_API_KEY", "20100101", "20130101", "10")

Perl

use SOAP::Lite;
use SOAP::WSDL;

my $ondemand = SOAP::Lite
    -> service('https://ondemand.websol.barchart.com/service?wsdl');

my $result = $ondemand->getCRBIndexes('YOUR_API_KEY', '20100101', '20130101', '10');

print $result;

Python

from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')

result = client.service.getCRBIndexes('YOUR_API_KEY', '20100101', '20130101', '10')

print result

Ruby

require 'savon'

ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')

response = ondemand.call(
    :getCRBIndexes,
    message: {
        apikey: 'YOUR_API_KEY',
        startDate: '20100101',
        endDate: '20130101',
        maxRecords: '10',
    }
)

response.body