getCmdtyCalendar
The getCmdtyCalendar API provides user the latest updates of US economic activity and commodity trading events, including previous, revised, and actual values, updated 3 times a day. Users can request calendar events for desired period, and filter the output via various methods - category, importance, event country, and event symbol.
All APIsThe 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 beginning of this data series. Note that if the date range requested by the user is more extensive than the user's permissions allow for, the output range will be determined based on an offset from the startDate.
The end date 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 back to, and including, this value). If not set, the value will default to the last day of current year.
Filter returned result by category. Accept string concat category code by comma.
Filter returned result by country/countries. Accept string concat iso-3 country code by comma.
Filter returned result by importance level/levels. Accept string concat integer by comma.
1 = low, 2 = medium, 3 = high
Filter returned result by symbol. Accept valid symbol, which is a unique identifier of a time series, and multiple symbols separated by a comma.
An arrangement of fields within a particular record (ascending or descending). This parameter can be set to one of two values ("asc" and "desc") in order to specify the chronological order of the result set returned.
Return extra columns if requested, invalid input is a string concats optional output fields by comma.
GET
GET https://ondemand.websol.barchart.com/getCmdtyCalendar.json?apikey=YOUR_API_KEY&startDate=20181205&endDate=20191231&category=Ag%2CEnergy&country=USA%2CCHN&importance=2%2C1&symbol=USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM%2CUSCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM&order=asc&fields=reference_ending%2Cprior_reference_ending
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCmdtyCalendar.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&startDate=20181205&endDate=20191231&category=Ag%2CEnergy&country=USA%2CCHN&importance=2%2C1&symbol=USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM%2CUSCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM&order=asc&fields=reference_ending%2Cprior_reference_ending
Response
{
"status": {
"code": 204,
"message": "Success, but no content to return."
},
"results": null
}
GET
GET https://ondemand.websol.barchart.com/getCmdtyCalendar.xml?apikey=YOUR_API_KEY&startDate=20181205&endDate=20191231&category=Ag%2CEnergy&country=USA%2CCHN&importance=2%2C1&symbol=USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM%2CUSCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM&order=asc&fields=reference_ending%2Cprior_reference_ending
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCmdtyCalendar.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&startDate=20181205&endDate=20191231&category=Ag%2CEnergy&country=USA%2CCHN&importance=2%2C1&symbol=USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM%2CUSCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM&order=asc&fields=reference_ending%2Cprior_reference_ending
Response
<?xml version="1.0" encoding="utf-8"?>
<getCmdtyCalendar>
<status>
<code>204</code>
<message>Success, but no content to return.</message>
</status>
</getCmdtyCalendar>
GET
GET https://ondemand.websol.barchart.com/getCmdtyCalendar.csv?apikey=YOUR_API_KEY&startDate=20181205&endDate=20191231&category=Ag%2CEnergy&country=USA%2CCHN&importance=2%2C1&symbol=USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM%2CUSCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM&order=asc&fields=reference_ending%2Cprior_reference_ending
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCmdtyCalendar.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&startDate=20181205&endDate=20191231&category=Ag%2CEnergy&country=USA%2CCHN&importance=2%2C1&symbol=USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM%2CUSCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM&order=asc&fields=reference_ending%2Cprior_reference_ending
Response
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'startDate' => '20181205',
'endDate' => '20191231',
'category' => 'Ag,Energy',
'country' => 'USA,CHN',
'importance' => '2,1',
'symbol' => 'USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM,USCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM',
'order' => 'asc',
'fields' => 'reference_ending,prior_reference_ending',
];
$result = $ondemand->getCmdtyCalendar($params);
var_dump($result);
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.getCmdtyCalendar("YOUR_API_KEY", "20181205", "20191231", "Ag,Energy", "USA,CHN", "2,1", "USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM,USCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM", "asc", "reference_ending,prior_reference_ending")
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getCmdtyCalendar('YOUR_API_KEY', '20181205', '20191231', 'Ag,Energy', 'USA,CHN', '2,1', 'USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM,USCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM', 'asc', 'reference_ending,prior_reference_ending');
print $result;
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = client.service.getCmdtyCalendar('YOUR_API_KEY', '20181205', '20191231', 'Ag,Energy', 'USA,CHN', '2,1', 'USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM,USCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM', 'asc', 'reference_ending,prior_reference_ending')
print result
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getCmdtyCalendar,
message: {
apikey: 'YOUR_API_KEY',
startDate: '20181205',
endDate: '20191231',
category: 'Ag,Energy',
country: 'USA,CHN',
importance: '2,1',
symbol: 'USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM,USCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM',
order: 'asc',
fields: 'reference_ending,prior_reference_ending',
}
)
response.body