Yahoo! Weather RSS Feed

The Weather RSS feed enables you to get up-to-date weather information for your location. You can save this feed in My Yahoo! or your favorite feed aggregator, or incorporate the RSS data into your own web site or client application. The Weather RSS feed is a dynamically-generated feed based on zip code or Location ID.

This page describes the format of the Weather request URL and the RSS response for developers. It contains these sections:

RSS Request

The Weather RSS feed request follows simple HTTP GET syntax: start with a base URL and then add parameters and values after a question mark (?). Multiple parameters are separated by an ampersand (&).

The base URL for the Weather RSS feed is

http://weather.yahooapis.com/forecastrss

In this section, Summary shows how to make an RSS request with different parameters; Request Parameters shows a table summarizing those parameters.

Summary

The Weather RSS feed request follows simple HTTP GET syntax: start with a base URL and then add parameters and values after a question mark (?). Multiple parameters are separated by an ampersand (&). For the Weather RSS feed there are two parameters:

  • p for location.
  • u for degrees units (Fahrenheit or Celsius).

The location parameter p is required. Use this parameter to indicate the location for the weather forecast as a zip code or Location ID.

http://weather.yahooapis.com/forecastrss?p=location

For example, to get weather for Yahoo! Headquarters in Sunnyvale, CA, use the zip code for Sunnyvale (94089):

http://weather.yahooapis.com/forecastrss?p=94089

Or use the Location ID for Sunnyvale (USCA1116):

http://weather.yahooapis.com/forecastrss?p=USCA1116

The location parameter can be a US Zip code or a location ID. To find your location ID, browse or search for your city from the Weather home page. The weather ID is in the URL for the forecast page for that city. You can also get the location ID by entering your zip code on the home page. For example, if you search for Los Angeles on the Weather home page, the forecast page for that city is http://weather.yahoo.com/forecast/USCA0638.html. The location ID is USCA0638.

The optional u (units) parameter indicates the degree units for the weather forecast. By default, Yahoo! Weather returns temperature information in degrees Fahrenheit. Use the u parameter to explicitly specify the degree units in Fahrenheit (f) or Celsius (c). The units parameter is case sensitive. For example, to get the weather forecast in Sunnyvale, CA in Celsius:

http://weather.yahooapis.com/forecastrss?p=94089&u=c

Note that choosing Celsius degree units changes all the weather units to metric, for example, wind speed will be reported as kilometers per hour and barometric pressure as millibars.

Yahoo! Weather returns an RSS 2.0 feed in response to this request. You can subscribe to the request URL with My Yahoo! or another RSS feed aggregator, or you can incorporate the information in the RSS response into your own application. See RSS Response Elements for information on the elements contained in the RSS feed.

Request Parameters

Parameter Description Example
p US zip code or Location ID p=95089
p=USCA1116
u Units for temperature (case sensitive)
f: Fahrenheit
c: Celsius
u=c

RSS Response

The Weather RSS feed is an XML document that conforms to the RSS 2.0 specification. RSS is an XML document containing a single channel element representing the feed, several elements containing metadata about the feed itself, and one or more item elements describing individual items within the feed.

The Weather RSS feed also includes additional elements from the geo vocabulary as well as a custom yweather vocabulary.

Top-Level Elements

Element Description
xml The Weather RSS feed conforms to XML 1.0. No child elements.
rss The Weather RSS feed conforms to RSS 2.0.
Child elements: channel

Channel Elements

The channel element contains metadata about the feed and its contents.

Element Description
title The title of the feed, which includes the location city. For example "Yahoo! Weather - Sunnyvale, CA"
link The URL for the Weather page of the forecast for this location. For example http://us.rd.yahoo.com/dailynews/rss/weather/ Sunnyvale__CA/ *http://weather.yahoo.com/ forecast/94089_f.html
language The language of the weather forecast, for example, en-us for US English.
description The overall description of the feed including the location, for example "Yahoo! Weather for Sunnyvale, CA"
lastBuildDate The last time the feed was updated. The format is in the date format defined by RFC822 Section 5, for example Mon, 256 Sep 17:25:18 -0700.
ttl Time to Live; how long in minutes this feed should be cached.
yweather:location The location of this forecast. Attributes:
  • city: city name (string)
  • region: state, territory, or region, if given (string)
  • country: two-character country code. (string)
yweather:units Units for various aspects of the forecast. Attributes:
  • temperature: degree units, f for Fahrenheit or c for Celsius (character)
  • distance: units for distance, mi for miles or km for kilometers (string)
  • pressure: units of barometric pressure, in for pounds per square inch or mb for millibars (string)
  • speed: units of speed, mph for miles per hour or kph for kilometers per hour (string)
Note that the default RSS feed uses Fahrenheit degree units and English units for all other attributes (miles, pounds per square inch, miles per hour). If Celsius has been specified as the degree units for the feed (using the u request parameter), all the units are in metric format (Celsius, kilometers, millibars, kilometers per hour).
yweather:wind Forecast information about wind. Attributes:
  • chill: wind chill in degrees (integer)
  • direction: wind direction, in degrees (integer)
  • speed: wind speed, in the units specified in the speed attribute of the yweather:units element (mph or kph). (integer)
yweather:atmosphere Forecast information about current atmospheric pressure, humidity, and visibility. Attributes:
  • humidity: humidity, in percent (integer)
  • visibility, in the units specified by the distance attribute of the yweather:units element (mi or km). Note that the visibility is specified as the actual value * 100. For example, a visibility of 16.5 miles will be specified as 1650. A visibility of 14 kilometers will appear as 1400. (integer)
  • pressure: barometric pressure, in the units specified by the pressure attribute of the yweather:units element (in or mb). (float).
  • rising: state of the barometric pressure: steady (0), rising (1), or falling (2). (integer: 0, 1, 2)
yweather:astronomy Forecast information about current astronomical conditions. Attributes:
  • sunrise: today's sunrise time. The time is a string in a local time format of "h:mm am/pm", for example "7:02 am" (string)
  • sunset today's sunset time. The time is a string in a local time format of "h:mm am/pm", for example "4:51 pm" (string)
image The image used to identify this feed. See Image Elements for element descriptions
Child elements: url, title, link, width, height
item The local weather conditions and forecast for a specific location. See Item Elements for element descriptions.
Child elements: title, link, description, guid, pubDate, geo:lat, geo:long, yweather:forecast

Image Elements

The image element describes an image or icon used to identify the feed.

Element Description
title The title of the image, for example "Yahoo! Weather"
link The URL of Yahoo! Weather
url The URL of the image
width The width of the image, in pixels
height The height of the image, in pixels

Item Elements

The item element contains current conditions and forecast for the given location. There are multiple yweather:forecast elements for today and tomorrow.

Element Description
title The forecast title and time, for example "Conditions for New York, NY at 1:51 pm EST"
link The Yahoo! Weather URL for this forecast.
description A simple summary of the current conditions and tomorrow's forecast, in HTML format, including a link to Yahoo! Weather for the full forecast.
guid Unique identifier for the forecast, made up of the location ID, the date, and the time. The attribute isPermaLink is false.
pubDate The date and time this forecast was posted, in the date format defined by RFC822 Section 5, for example Mon, 25 Sep 17:25:18 -0700.
geo:lat The latitude of the location.
geo:long The longitude of the location.
yweather:condition The current weather conditions. Attributes:
  • text: a textual description of conditions, for example, "Partly Cloudy" (string)
  • code: the condition code for this forecast. You could use this code to choose a text description or image for the forecast. The possible values for this element are described in Condition Codes (integer)
  • temp: the current temperature, in the units specified by the yweather:units element (integer)
  • date: the current date and time for which this forecast applies. The date is in RFC822 Section 5 format, for example "Wed, 30 Nov 2005 1:56 pm PST" (string)
yweather:forecast The weather forecast for a specific day. The item element contains multiple forecast elements for today and tomorrow. Attributes:
  • day: day of the week to which this forecast applies. Possible values are Mon Tue Wed Thu Fri Sat Sun (string)
  • date: the date to which this forecast applies. The date is in "dd Mmm yyyy" format, for example "30 Nov 2005" (string)
  • low: the forecasted low temperature for this day, in the units specified by the yweather:units element (integer)
  • high: the forecasted high temperature for this day, in the units specified by the yweather:units element (integer)
  • text: a textual description of conditions, for example, "Partly Cloudy" (string)
  • code: the condition code for this forecast. You could use this code to choose a text description or image for the forecast. The possible values for this element are described in Condition Codes (integer)

Condition Codes

Condition codes are used in the yweather:forecast element to describe the current conditions.

Code Description
0 tornado
1 tropical storm
2 hurricane
3 severe thunderstorms
4 thunderstorms
5 mixed rain and snow
6 mixed rain and sleet
7 mixed snow and sleet
8 freezing drizzle
9 drizzle
10 freezing rain
11 showers
12 showers
13 snow flurries
14 light snow showers
15 blowing snow
16 snow
17 hail
18 sleet
19 dust
20 foggy
21 haze
22 smoky
23 blustery
24 windy
25 cold
26 cloudy
27 mostly cloudy (night)
28 mostly cloudy (day)
29 partly cloudy (night)
30 partly cloudy (day)
31 clear (night)
32 sunny
33 fair (night)
34 fair (day)
35 mixed rain and hail
36 hot
37 isolated thunderstorms
38 scattered thunderstorms
39 scattered thunderstorms
40 scattered showers
41 heavy snow
42 scattered snow showers
43 heavy snow
44 partly cloudy
45 thundershowers
46 snow showers
47 isolated thundershowers
3200 not available

Examples

To get the forecast for Yahoo! Headquarters in Sunnyvale, CA, use the zip code:

http://weather.yahooapis.com/forecastrss?p=94089

Or use the Location ID for Sunnyvale (USCA1116):

http://weather.yahooapis.com/forecastrss?p=USCA1116

To get the forecast for New York City, use the Location ID USNY0996:

http://weather.yahooapis.com/forecastrss?p=USNY0996

To get the forecast for Paris, France, use the Location ID FRXX0076:

http://weather.yahooapis.com/forecastrss?p=FRXX0076

To get the forecast for Paris, France, with degrees Celsius and other metric units:

http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c

A sample RSS response is shown below:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://weather.yahooapis.com/ns/rss/1.0"
 xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
   <title>Yahoo! Weather - Sunnyvale, CA</title>
   <link>http://us.rd.yahoo.com/dailynews/rss/weather/Sunnyvale__CA/
   *http://weather.yahoo.com/forecast/94089_f.html</link>
   <description>Yahoo! Weather for Sunnyvale, CA</description>
   <language>en-us</language>
   <lastBuildDate>Tue, 29 Nov 2005 3:56 pm PST</lastBuildDate>
   <ttl>60</ttl>
   <yweather:location city="Sunnyvale" region="CA" country="US"></yweather:location>
   <yweather:units temperature="F" distance="mi" pressure="in" speed="mph"></yweather:units>
   <yweather:wind chill="57" direction="350" speed="7"></yweather:wind>
   <yweather:atmosphere humidity="93" visibility="1609" pressure="30.12" rising="0"></yweather:atmosphere>
   <yweather:astronomy sunrise="7:02 am" sunset="4:51 pm"></yweather:astronomy>
   <image>
      <title>Yahoo! Weather</title>
      <width>142</width>
      <height>18</height>
      <link>http://weather.yahoo.com/</link>
      <url>https://s.yimg.com/zz/combo?a/i/us/nws/th/main_142b.gif</url>
   </image>
   <item>
      <title>Conditions for Sunnyvale, CA at 3:56 pm PST</title>
      <geo:lat>37.39</geo:lat>
      <geo:long>-122.03</geo:long>
      <link>http://us.rd.yahoo.com/dailynews/rss/weather/
       Sunnyvale__CA/*
       http://weather.yahoo.com/ forecast/94089_f.html
      </link>
      <pubDate>Tue, 29 Nov 2005 3:56 pm PST</pubDate>
      <yweather:condition text="Mostly Cloudy" code="26" temp="57" date="Tue, 29 Nov 2005 3:56
          pm PST"></yweather:condition>
      <description><![CDATA[
 <img src="https://s.yimg.com/zz/combo?a/i/us/we/52/26.gif" /><br />
 <b>Current Conditions:</b><br />
 Mostly Cloudy, 57 F<p />
 <b>Forecast:</b><BR />
  Tue - Mostly Cloudy. High: 62 Low: 45<br />
  Wed - Mostly Cloudy. High: 60 Low: 52<br />
  Thu - Rain. High: 61 Low: 46<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Sunnyvale__CA/*http://weather.yahoo.com/forecast/94089_f.html">Full Forecast at Yahoo! Weather</a><BR/>
 (provided by The Weather Channel)<br/>]]>
      </description>
      <yweather:forecast day="Tue" date="29 Nov 2005" low="45" high="62" text="Mostly Cloudy"
          code="27"></yweather:forecast>
      <yweather:forecast day="Wed" date="30 Nov 2005" low="52" high="60" text="Mostly Cloudy"
          code="28"></yweather:forecast>
      <guid isPermaLink="false">94089_2005_11_29_15_56_PST</guid>
   </item>
</channel>
</rss>

Terms of Use

The feeds are provided free of charge for use by individuals and non-profit organizations for personal, non-commercial uses. We ask that you provide attribution to Yahoo! Weather in connection with your use of the feeds.

If you provide this attribution in text, please use: "Yahoo! Weather." If you provide this attribution with a graphic, please use the Yahoo! Weather logo that we have included in the feed itself.

We reserve all rights in and to the Yahoo! Weather logo, and your right to use the Yahoo! Weather logo is limited to providing attribution in connection with these RSS feeds.

Yahoo! also reserves the right to require you to cease distributing these feeds at any time for any reason.