getUSDAGrainPrices API

The getUSDAGrainPrices API provides daily cash grain bids and prices for locations throughout the United States covering corn, wheat, oats and soybean markets.

All APIs

Contact Us to Get Access

Inputs

commodityTypes optional

The type of commodity. Includes: Corn ("C"), Corn Crude Oil ("CCO"), Crude Soybean Oil ("CSO"), DNS/NS Wheat 14% ("WDN"), HRW Wheat ("HRW"), HRW Wheat 11.5% ("HRW11"), Oats ("O"), Ord HRW Wheat ("HRWORD"), Soybean Meal 48% ("SM"), Soybeans ("S"), SRW Wheat ("SRW"), SWW Wheat ("SWW").

Type
list-enum (A comma or semi-colon delimited string that must match a list of valid possible values.) 
Example

Valid Values:
C, CCO, CSO, WDN, HRW, HRW11, O, HRWORD, SM, S, SRW, SWW

locations optional

The location of the handling facility. Includes: Atlantic ("A"), Central Illinois ("CIL"), Chicago ("CHGO"), Cincinnati Ohio River ("CIN"), Gulf ("GULF"), Kansas City ("KC"), Memphis Mississippi River ("MEM"), Minneapolis ("MIN"), Mt. Vernon Ohio River ("MTV"), N. Peoria Illinois River ("NPEO"), Omaha ("OMA"), Portland ("PORT"), S. Iowa Mississippi River ("SIOWA"), S. Peoria Illinois River ("SPEO"), St. Louis Mississippi River ("SLOU"), Toledo Non-River ("TLNON"), Toldeo On-River ("TLON").

Type
list-enum (A comma or semi-colon delimited string that must match a list of valid possible values.) 
Example
CHGO 

Valid Values:
A, CIL, CHGO, CIN, GULF, KC, MEM, MIN, MTV, NPEO, OMA, PORT, SIOWA, SPEO, SLOU, TLNON, TLON

bidTypes optional

The type of bid. Includes: Export ("E"), Processor ("P"), River ("R") and Terminal ("T").

Type
list-enum (A comma or semi-colon delimited string that must match a list of valid possible values.) 
Example

Valid Values:
E, P, R, T

Outputs

Name / Requirement
Description
Type
commodityType
always returned
The type of commodity. Includes: Corn ("C"), Corn Crude Oil ("CCO"), Crude Soybean Oil ("CSO"), DNS/NS Wheat 14% ("WDN"), HRW Wheat ("HRW"), HRW Wheat 11.5% ("HRW11"), Oats ("O"), Ord HRW Wheat ("HRWORD"), Soybean Meal 48% ("SM"), Soybeans ("S"), SRW Wheat ("SRW"), SWW Wheat ("SWW").
string
A sequence of characters. (example: GOOG)
location
always returned
The location of the handling facility. Includes: Atlantic ("A"), Central Illinois ("CIL"), Chicago ("CHGO"), Cincinnati Ohio River ("CIN"), Gulf ("GULF"), Kansas City ("KC"), Memphis Mississippi River ("MEM"), Minneapolis ("MIN"), Mt. Vernon Ohio River ("MTV"), N. Peoria Illinois River ("NPEO"), Omaha ("OMA"), Portland ("PORT"), S. Iowa Mississippi River ("SIOWA"), S. Peoria Illinois River ("SPEO"), St. Louis Mississippi River ("SLOU"), Toledo Non-River ("TLNON"), Toledo On-River ("TLON").
string
A sequence of characters. (example: GOOG)
bidType
always returned
The type of bid. Includes: Export ("E"), Processor ("P"), River ("R") and Terminal ("T").
string
A sequence of characters. (example: GOOG)
lowPrice
always returned
The low price for the day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
highPrice
always returned
The high price for the day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
priceChange
always returned
The price change in cents compared to the previous day.
string
A sequence of characters. (example: GOOG)
basis
always returned
The basis range in cents.
string
A sequence of characters. (example: GOOG)
bidChange
always returned
The change in bid price compared to the previous day.
string
A sequence of characters. (example: GOOG)

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/getUSDAGrainPrices.json?apikey=<YOUR API KEY>&commodityTypes=C&locations=CHGO&bidTypes=E
Host: ondemand.websol.barchart.com

POST

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

apikey=<YOUR API KEY>&commodityTypes=C&locations=CHGO&bidTypes=E

Response

{
    "status": {
        "code": 200,
        "message": "Success."
    },
    "results": [
        {
            "commodityType": "Corn",
            "location": "Chicago",
            "bidType": "Export",
            "lowPrice": 3.1025,
            "highPrice": 3.1525,
            "priceChange": "0.2500",
            "basis": "-35.0000 Z to -30.0000 Z",
            "bidChange": "0.0000"
        },
        {
            "commodityType": "Corn",
            "location": "Chicago",
            "bidType": "Export",
            "lowPrice": 3.2025,
            "highPrice": 3.2725,
            "priceChange": "0.2500",
            "basis": "-25.0000 Z to -18.0000 Z",
            "bidChange": "0.0000"
        }
    ]
}

XML

GET

GET https://ondemand.websol.barchart.com/getUSDAGrainPrices.xml?apikey=<YOUR API KEY>&commodityTypes=C&locations=CHGO&bidTypes=E
Host: ondemand.websol.barchart.com

POST

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

apikey=<YOUR API KEY>&commodityTypes=C&locations=CHGO&bidTypes=E

Response


<?xml version="1.0" encoding="utf-8"?>
 <getUSDAGrainPrices>
  <status>
   <code>200</code>
   <message>Success.</message>
  </status>
  <item>
   <commodityType>Corn</commodityType>
   <location>Chicago</location>
   <bidType>Export</bidType>
   <lowPrice>3.1025</lowPrice>
   <highPrice>3.1525</highPrice>
   <priceChange>0.2500</priceChange>
   <basis>-35.0000 Z to -30.0000 Z</basis>
   <bidChange>0.0000</bidChange>
  </item>
  <item>
   <commodityType>Corn</commodityType>
   <location>Chicago</location>
   <bidType>Export</bidType>
   <lowPrice>3.2025</lowPrice>
   <highPrice>3.2725</highPrice>
   <priceChange>0.2500</priceChange>
   <basis>-25.0000 Z to -18.0000 Z</basis>
   <bidChange>0.0000</bidChange>
  </item>
 </getUSDAGrainPrices>

CSV

GET

GET https://ondemand.websol.barchart.com/getUSDAGrainPrices.csv?apikey=<YOUR API KEY>&commodityTypes=C&locations=CHGO&bidTypes=E
Host: ondemand.websol.barchart.com

POST

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

apikey=<YOUR API KEY>&commodityTypes=C&locations=CHGO&bidTypes=E

Response

commodityType,location,bidType,lowPrice,highPrice,priceChange,basis,bidChange
"Corn","Chicago","Export","3.1025","3.1525","0.2500","-35.0000 Z to -30.0000 Z","0.0000"
"Corn","Chicago","Export","3.2025","3.2725","0.2500","-25.0000 Z to -18.0000 Z","0.0000"


PHP

<?php

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

$params = [
    'commodityTypes' => 'C',
    'locations' => 'CHGO',
    'bidTypes' => 'E',
];

$result = $ondemand->getUSDAGrainPrices($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.getUSDAGrainPrices("C", "CHGO", "E")

Perl

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

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

my $result = $ondemand->getUSDAGrainPrices('C', 'CHGO', 'E');

print $result;

Python

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

result = client.service.getUSDAGrainPrices('C', 'CHGO', 'E')

print result

Ruby

require 'savon'

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

response = ondemand.call(
    :getUSDAGrainPrices,
    message: {
        commodityTypes: 'C',
        locations: 'CHGO',
        bidTypes: 'E',
    }
)

response.body