Weather API
getWeather
The getWeather API provides current conditions and forecasts based on zip code as well as weather maps based on type or region.
View All APIsContact Us to Get Access
Inputs
weatherTypeoptional
The type of weather requested. Includes: Current Conditions ("CC") and Forecast ("F").
Type
enum (A type which includes a list of valid possible values.)
Example
CC
Default
CC
Valid Values
CC, F, MAP
zipCodeoptional
The zip code of the location as a 5-digit numeric value.
Type
string (A sequence of characters. (example: GOOG))
Example
60606
Default
60606
fieldsoptional
The fields requested.
Type
list (A comma or semi-colon delimited string.)
Example
windDirection,windSpeed,humidity,dewpoint,forcastedDay,forcastedPrecipitation
mapTypeoptional
The type of map required. Only valid when using the "MAP" weatherType.
Type
enum (A type which includes a list of valid possible values.)
Valid Values
localRadarAnimation, usRadarSatellite, usRadarSatelliteAnimation, todaysWeatherMap, currentWindConditions, todaysPrecipitationAccumulation, dailyPrecipitation, usSoilMoisture, usCurrentTemperatures
mapRegionoptional
The region of map required.
Type
enum (A type which includes a list of valid possible values.)
Valid Values
centralPlains, dakotas, californiaArizona, colorado, deepSouth, delta, farWest, florida, greatBasin, greatLakes, midAtlantic, montana, northEast, ohioValley, pacificNorthwest, rockyMountains, southAtlantic, southPlains, southTexas, southWest
mapWidthoptional
The width of the map.
Type
int (A numeric type defining a whole number. (example: 2))
Example
255
Default
560
mapHeightoptional
The height of the map.
Type
int (A numeric type defining a whole number. (example: 2))
Example
220
Default
440
Outputs
weatherType
always returned
always returned
The type of weather requested. Includes: Current Conditions ("CC") or Forecast ("F").
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
zipCode
always returned
always returned
The zip code of the location.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
location
always returned
always returned
The city or town related to the zip code.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
currentCondition
always returned
always returned
The descriptive of the current condition.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
currentConditionIcon
always returned
always returned
The condition icon's URL.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
currentTemperature
always returned
always returned
The current temperature.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
currentPressure
always returned
always returned
The current atmospheric pressure in Hg.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
feelsLike
always returned
always returned
The current feels like temperature.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
windDirection
as requested
as requested
The current wind direction.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
windSpeed
as requested
as requested
The current wind speed.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
humidity
as requested
as requested
The current level of humidity.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
dewpoint
as requested
as requested
The current dew point.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastedDay
as requested
as requested
The name of the day of the week forecasted.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forcastedPrecipitation
as requested
as requested
The amount of forecasted precipitation in inches.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
chancePrecipitationDay
as requested
as requested
The daytime chance of precipitation.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
chancePrecipitationNight
as requested
as requested
The nighttime chance of precipitation.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
windchill
as requested
as requested
The forecasted windchill temperature.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
dewFrostWeight
as requested
as requested
The dew/frost weight.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
hoursSun
as requested
as requested
The hours of sunlight for today.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
soilMoisture
as requested
as requested
The current soil moisture.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
evaporation
as requested
as requested
The current level of evaporation.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
dryingIndex
as requested
as requested
The current drying index.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
solarRadiation
as requested
as requested
The current level of solar radiation.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
livestockSafteyIndex
as requested
as requested
The current livestock safety index.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
cumulativeHDD
as requested
as requested
The cumulative heating degree days.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
cumulativeGDD
as requested
as requested
The cumulative growing degree days.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastDayCondition
as requested
as requested
A descriptive of the weather forecasted for the day.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastDayConditionIcon
as requested
as requested
The condition icon's URL.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastNightCondition
as requested
as requested
A descriptive of the weather forecasted for the night.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastNightConditionIcon
as requested
as requested
The condition icon's URL.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastHighTemperature
as requested
as requested
The forecasted high temperature for the day.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastLowTemperature
as requested
as requested
The forecasted low temperature for the day.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
mapRegion
always returned
always returned
The map region.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
mapType
always returned
always returned
The map type.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
mapUrl
always returned
always returned
The map image's URL.
string
A sequence of characters. (example: GOOG)
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/getWeather.json?apikey=YOUR_API_KEY&weatherType=CC&zipCode=60606&fields=windDirection%2CwindSpeed%2Chumidity%2Cdewpoint%2CforcastedDay%2CforcastedPrecipitation&mapWidth=255&mapHeight=220
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getWeather.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&weatherType=CC&zipCode=60606&fields=windDirection%2CwindSpeed%2Chumidity%2Cdewpoint%2CforcastedDay%2CforcastedPrecipitation&mapWidth=255&mapHeight=220
Response
{
"status": {
"code": 200,
"message": "Success."
},
"results": [
{
"weatherType": "CC",
"zipCode": "60606",
"location": "Chicago, IL",
"currentCondition": "Overcast",
"currentConditionIcon": "https:\/\/shared.websol.barchart.com\/images\/weather\/mcldyicon.jpg",
"currentTemperature": "19°F",
"currentPressure": "29.83 pa",
"feelsLike": "9°F",
"windDirection": "North West",
"windSpeed": "7.74 mph",
"humidity": "66.00 %",
"dewpoint": "8.87 fahrenheit",
"forcastedPrecipitation": null,
"mapRegion": null,
"mapType": "localRadarAnimation",
"mapUrl": "https:\/\/shared.websol.barchart.com\/weather\/ondemandmap.php\/interrad?zip=60606&width=255&height=220"
}
]
}
XML
GET
GET https://ondemand.websol.barchart.com/getWeather.xml?apikey=YOUR_API_KEY&weatherType=CC&zipCode=60606&fields=windDirection%2CwindSpeed%2Chumidity%2Cdewpoint%2CforcastedDay%2CforcastedPrecipitation&mapWidth=255&mapHeight=220
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getWeather.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&weatherType=CC&zipCode=60606&fields=windDirection%2CwindSpeed%2Chumidity%2Cdewpoint%2CforcastedDay%2CforcastedPrecipitation&mapWidth=255&mapHeight=220
Response
<?xml version="1.0" encoding="utf-8"?>
<getWeather>
<status>
<code>200</code>
<message>Success.</message>
</status>
<item>
<weatherType>CC</weatherType>
<zipCode>60606</zipCode>
<location>Chicago, IL</location>
<currentCondition>Overcast</currentCondition>
<currentConditionIcon>https://shared.websol.barchart.com/images/weather/mcldyicon.jpg</currentConditionIcon>
<currentTemperature>19&deg;F</currentTemperature>
<currentPressure>29.83 pa</currentPressure>
<feelsLike>9&deg;F</feelsLike>
<windDirection>North West</windDirection>
<windSpeed>7.74 mph</windSpeed>
<humidity>66.00 %</humidity>
<dewpoint>8.87 fahrenheit</dewpoint>
<forcastedPrecipitation/>
<mapRegion/>
<mapType>localRadarAnimation</mapType>
<mapUrl>https://shared.websol.barchart.com/weather/ondemandmap.php/interrad?zip=60606&width=255&height=220</mapUrl>
</item>
</getWeather>
CSV
GET
GET https://ondemand.websol.barchart.com/getWeather.csv?apikey=YOUR_API_KEY&weatherType=CC&zipCode=60606&fields=windDirection%2CwindSpeed%2Chumidity%2Cdewpoint%2CforcastedDay%2CforcastedPrecipitation&mapWidth=255&mapHeight=220
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getWeather.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&weatherType=CC&zipCode=60606&fields=windDirection%2CwindSpeed%2Chumidity%2Cdewpoint%2CforcastedDay%2CforcastedPrecipitation&mapWidth=255&mapHeight=220
Response
weatherType,zipCode,location,currentCondition,currentConditionIcon,currentTemperature,currentPressure,feelsLike,windDirection,windSpeed,humidity,dewpoint,forcastedPrecipitation,mapRegion,mapType,mapUrl
"CC","60606","Chicago, IL","Overcast","https://shared.websol.barchart.com/images/weather/mcldyicon.jpg","19°F","29.83 pa","9°F","North West","7.74 mph","66.00 %","8.87 fahrenheit","","","localRadarAnimation","https://shared.websol.barchart.com/weather/ondemandmap.php/interrad?zip=60606&width=255&height=220"
PHP
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'weatherType' => 'CC',
'zipCode' => '60606',
'fields' => 'windDirection,windSpeed,humidity,dewpoint,forcastedDay,forcastedPrecipitation',
'mapWidth' => '255',
'mapHeight' => '220',
];
$result = $ondemand->getWeather($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.getWeather("YOUR_API_KEY", "CC", "60606", "windDirection,windSpeed,humidity,dewpoint,forcastedDay,forcastedPrecipitation", "255", "220")
Perl
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getWeather('YOUR_API_KEY', 'CC', '60606', 'windDirection,windSpeed,humidity,dewpoint,forcastedDay,forcastedPrecipitation', '255', '220');
print $result;
Python
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getWeather('YOUR_API_KEY', 'CC', '60606', 'windDirection,windSpeed,humidity,dewpoint,forcastedDay,forcastedPrecipitation', '255', '220')
print(result)
Ruby
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getWeather,
message: {
apikey: 'YOUR_API_KEY',
weatherType: 'CC',
zipCode: '60606',
fields: 'windDirection,windSpeed,humidity,dewpoint,forcastedDay,forcastedPrecipitation',
mapWidth: '255',
mapHeight: '220',
}
)
response.body