Weather API
getWeatherThe 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
CCDefault
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
60606Default
60606
fieldsoptional
The fields requested.
Type
list (A comma or semi-colon delimited string.)
Example
windDirection,windSpeed,humidity,dewpoint,forcastedDay,forcastedPrecipitationmapTypeoptional
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
255Default
560
mapHeightoptional
The height of the map.
Type
int (A numeric type defining a whole number. (example: 2))
Example
220Default
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
The current wind direction.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
windSpeed
The current wind speed.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
humidity
The current level of humidity.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
dewpoint
The current dew point.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastedDay
The name of the day of the week forecasted.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forcastedPrecipitation
The amount of forecasted precipitation in inches.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
chancePrecipitationDay
The daytime chance of precipitation.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
chancePrecipitationNight
The nighttime chance of precipitation.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
windchill
The forecasted windchill temperature.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
dewFrostWeight
The dew/frost weight.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
hoursSun
The hours of sunlight for today.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
soilMoisture
The current soil moisture.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
evaporation
The current level of evaporation.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
dryingIndex
The current drying index.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
solarRadiation
The current level of solar radiation.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
livestockSafteyIndex
The current livestock safety index.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
cumulativeHDD
The cumulative heating degree days.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
cumulativeGDD
The cumulative growing degree days.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastDayCondition
A descriptive of the weather forecasted for the day.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastDayConditionIcon
The condition icon's URL.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastNightCondition
A descriptive of the weather forecasted for the night.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastNightConditionIcon
The condition icon's URL.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastHighTemperature
The forecasted high temperature for the day.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
forecastLowTemperature
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": "Partly Sunny",
"currentConditionIcon": "https:\/\/shared.websol.barchart.com\/images\/weather\/pcldyicon.jpg",
"currentTemperature": "12°F",
"currentPressure": "29.91 pa",
"feelsLike": "2°F",
"windDirection": "North West",
"windSpeed": "7.00 mph",
"humidity": "62.00 %",
"dewpoint": "0.39 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>Partly Sunny</currentCondition>
<currentConditionIcon>https://shared.websol.barchart.com/images/weather/pcldyicon.jpg</currentConditionIcon>
<currentTemperature>12&deg;F</currentTemperature>
<currentPressure>29.91 pa</currentPressure>
<feelsLike>2&deg;F</feelsLike>
<windDirection>North West</windDirection>
<windSpeed>7.00 mph</windSpeed>
<humidity>62.00 %</humidity>
<dewpoint>0.39 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","Partly Sunny","https://shared.websol.barchart.com/images/weather/pcldyicon.jpg","12°F","29.91 pa","2°F","North West","7.00 mph","62.00 %","0.39 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