Economic Calendar API
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.
View All APIsstartDaterequired
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 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.
20231221
endDaterequired
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.
20241231
categoryoptional
Filter returned result by category. Accept string concat category code by comma.
Ag,Energy
countryoptional
Filter returned result by country/countries. Accept string concat iso-3 country code by comma.
USA,CHN
importanceoptional
Filter returned result by importance level/levels. Accept string concat integer by comma.
1 = low, 2 = medium, 3 = high
2,1
symboloptional
Filter returned result by symbol. Accept valid symbol, which is a unique identifier of a time series, and multiple symbols separated by a comma.
USCB-WHSLETRADE-SALES-CHG-SA-USA-13652.CM,USCB-WHSLETRADE-INV-CHG-SA-USA-13610.CM
orderoptional
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.
asc
fieldsoptional
Return extra columns if requested, invalid input is a string concats optional output fields by comma.
reference_ending,prior_reference_ending
always returned
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
as requested
A date in the format of YYYY-MM-DD.
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A date in the format of YYYY-MM-DD.
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
always returned
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
always returned
A date in the format of YYYY-MM-DD.
always returned
A sequence of characters. (example: GOOG)
always returned
A numeric type defining a whole number. (example: 2)
GET
GET https://ondemand.websol.barchart.com/getCmdtyCalendar.json?apikey=YOUR_API_KEY&startDate=20231221&endDate=20241231&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=20231221&endDate=20241231&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": []
}
GET
GET https://ondemand.websol.barchart.com/getCmdtyCalendar.xml?apikey=YOUR_API_KEY&startDate=20231221&endDate=20241231&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=20231221&endDate=20241231&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=20231221&endDate=20241231&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=20231221&endDate=20241231&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' => '20231221',
'endDate' => '20241231',
'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", "20231221", "20241231", "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', '20231221', '20241231', '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 = ondemand.service.getCmdtyCalendar('YOUR_API_KEY', '20231221', '20241231', '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: '20231221',
endDate: '20241231',
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