Crop Factors API
getCropFactors
The getCropFactors API provides weather data/factors specific to Ag Industry. With this API, you can retrieve satellite imagery derived weather factors, like Normalized Difference Vegetation Index (NDVI), Normalized Difference Water Index (NDWI), and Land Surface Temperature(LSTD & LSTN), and station collected weather data, like air temperature(TMAX & TMIN), and accumulated precipitation(PRCP). Data can be requested for a combination of counties and observation windows.
View All APIscountyCoderequired
A county FIPS code or a code that identifies multiple counties. A valid code consists of multiple county FIPS codes separated by a comma, and the code can contain up to 100 counties. Mutually exclusive with stateCode.
Please click here to get a list of possible values.
19041,17019
stateCodeoptional
A state FIPS code or a code that identifies multiple states. A valid code consists of multiple state FIPS codes separated by a comma, and the code can contain up to 20 states.
Please click here to get a list of possible values.
19,17
startDaterequired
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 20240101
20241101
endDateoptional
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, and including, this value). If not set, the value will default to the day specified in the start parameter.
20241231
fieldsoptional
Additional as per-requested fields that the user can define. Requested fields should be separated by a comma.
ndviCount,ndwiCount
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 date in the format of YYYY-MM-DD.
always returned
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 numeric type defining a whole number. (example: 2)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a whole number. (example: 2)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a whole number. (example: 2)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a whole number. (example: 2)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a whole number. (example: 2)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a whole number. (example: 2)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a whole number. (example: 2)
always returned
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
GET
GET https://ondemand.websol.barchart.com/getCropFactors.json?apikey=YOUR_API_KEY&countyCode=19041%2C17019&stateCode=19%2C17&startDate=20241101&endDate=20241231&fields=ndviCount%2CndwiCount
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCropFactors.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&countyCode=19041%2C17019&stateCode=19%2C17&startDate=20241101&endDate=20241231&fields=ndviCount%2CndwiCount
Response
{
"status": {
"code": 204,
"message": "Success, but no content to return."
},
"results": []
}
GET
GET https://ondemand.websol.barchart.com/getCropFactors.xml?apikey=YOUR_API_KEY&countyCode=19041%2C17019&stateCode=19%2C17&startDate=20241101&endDate=20241231&fields=ndviCount%2CndwiCount
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCropFactors.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&countyCode=19041%2C17019&stateCode=19%2C17&startDate=20241101&endDate=20241231&fields=ndviCount%2CndwiCount
Response
<?xml version="1.0" encoding="utf-8"?>
<getCropFactors>
<status>
<code>204</code>
<message>Success, but no content to return.</message>
</status>
</getCropFactors>
GET
GET https://ondemand.websol.barchart.com/getCropFactors.csv?apikey=YOUR_API_KEY&countyCode=19041%2C17019&stateCode=19%2C17&startDate=20241101&endDate=20241231&fields=ndviCount%2CndwiCount
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCropFactors.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&countyCode=19041%2C17019&stateCode=19%2C17&startDate=20241101&endDate=20241231&fields=ndviCount%2CndwiCount
Response
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'countyCode' => '19041,17019',
'stateCode' => '19,17',
'startDate' => '20241101',
'endDate' => '20241231',
'fields' => 'ndviCount,ndwiCount',
];
$result = $ondemand->getCropFactors($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.getCropFactors("YOUR_API_KEY", "19041,17019", "19,17", "20241101", "20241231", "ndviCount,ndwiCount")
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getCropFactors('YOUR_API_KEY', '19041,17019', '19,17', '20241101', '20241231', 'ndviCount,ndwiCount');
print $result;
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getCropFactors('YOUR_API_KEY', '19041,17019', '19,17', '20241101', '20241231', 'ndviCount,ndwiCount')
print(result)
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getCropFactors,
message: {
apikey: 'YOUR_API_KEY',
countyCode: '19041,17019',
stateCode: '19,17',
startDate: '20241101',
endDate: '20241231',
fields: 'ndviCount,ndwiCount',
}
)
response.body