Cash Grain Bid API
getGrainBids
The getGrainBids API provides cashbid data for 30 closest locations in relation to the requested zip code. Learn more about Barchart's proprietary commodity data and grain cmdtyIndexes.
View All APIsrequestTypeoptional
The type of request that is being requested in order to determine the type of data to be returned.
locationoptional
A location id or a code identifies a or multiple grain buying location(s) that cash bid will be returned for. A valid code consist of multiple location ids separated by a comma, and the code can contain up to 100 locations. A list of valid location ids can be retrieved by using this API with input: requestType = location. location and several other inputs -geographic coordinates, zipCode, maxDistance, county, totalLocations- are mutually exclusive.
latitudeoptional
The latitude of a valid geographic coordinates to define the center of area that cashbid will be returned for. Geographic coordinates and Zipcode are mutually exclusive.
longitudeoptional
The longitude of a valid geographic coordinates to define the center of area that cashbid will be returned for. Geographic coordinates and Zipcode are mutually exclusive.
zipCodeoptional
A valid US or Canadian zip code to define the area that cash bids orginate from.
60606
maxDistanceoptional
The maximum distance from searched zipcode or the requested geo coordinates in miles. This input helps to define the area that cash bids will be returned from. Maximum value is 250.
countyoptional
A valid string code which represents the concatenation of county name and state code seperated by a hyphen.
BOONE COUNTY-IA
fipsCodeoptional
A concatenation of state FIPS code and county FIPS code without separator to define the county that cash bids will be returned for. Please click here to get a list of possible values.
17053
commodityNameoptional
A standard commodity name or a name list that separated by pipe (|) to filter cashbid. Note that the input need to be encoded in UTF-8. A list of valid commodity names can be retrieved by using this API with input: requestType = commodities.
Soybeans|Corn (#2 Yellow)
totalLocationsoptional
The maximum number of locations to be returned based of the zip code provided by the user. Default value is 30.
1
getAllBidsoptional
Return all cash bids for each location.
bidsPerComoptional
The maximum number of cash bids to be returned for each commodity per location. This parameter should be set to the maximum number of cash bids the user wishes to be returned.
2
numOfDecimalsoptional
The level of precision in decimal places of price and basis to be returned.
2
fieldsoptional
Additional as per-requested fields that the user can define. Requested fields should be separated by a comma.
deliveryStartoptional
The start date for the delivery period for qualified bids.
deliveryEndoptional
The end date for the delivery period for qualified bids.
always returned
A type which includes a list of valid possible values.
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
as requested
A numeric type defining a whole number. (example: 2)
always returned
A numeric type defining a whole number. (example: 2)
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 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)
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 sequence of characters. (example: GOOG)
as requested
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A sequence of characters. (example: GOOG)
always returned
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
as requested
A type which includes a list of valid possible values.
always returned
A numeric type defining a whole number. (example: 2)
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'latitude' => '',
'longitude' => '',
'zipCode' => '60606',
'county' => 'BOONE COUNTY-IA',
'fipsCode' => '17053',
'commodityName' => 'Soybeans|Corn (#2 Yellow)',
'bidsPerCom' => '2',
'numOfDecimals' => '2',
];
$result = $ondemand->getGrainBids($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.getGrainBids("YOUR_API_KEY", "", "", "60606", "BOONE COUNTY-IA", "17053", "Soybeans|Corn (#2 Yellow)", "2", "2")
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getGrainBids('YOUR_API_KEY', '', '', '60606', 'BOONE COUNTY-IA', '17053', 'Soybeans|Corn (#2 Yellow)', '2', '2');
print $result;
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getGrainBids('YOUR_API_KEY', '', '', '60606', 'BOONE COUNTY-IA', '17053', 'Soybeans|Corn (#2 Yellow)', '2', '2')
print(result)
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getGrainBids,
message: {
apikey: 'YOUR_API_KEY',
latitude: '',
longitude: '',
zipCode: '60606',
county: 'BOONE COUNTY-IA',
fipsCode: '17053',
commodityName: 'Soybeans|Corn (#2 Yellow)',
bidsPerCom: '2',
numOfDecimals: '2',
}
)
response.body