API Documentation

What does the API do?

The ClimbingWeather.com API provides a REST/JSON interface to ClimbingWeather.com's area and forecast data.

Audience

The ClimbingWeather.com API is intended for website and mobile developers who want to integrate ClimbingWeather.com data into their applications.

Usage Limits

Use of the ClimbingWeather.com API is currently limited to 1,000 requests per day. This limit may increase in the future. If you need more requests, please contact us.

Base URL and Common Parameters

Base URL

    http://api.climbingweather.com/api
    

Common Parameters

The following parameters rae common to all API requests:

  • apiKey (required)
    API key provided through ClimbingWeather.com . To obtain a key, login to ClimbingWeather.com and click 'Profile'.
  • version (optional, defaults to most current)
    The version number of the API. The most current version is always assumed if not specified.

List Areas

List climbing areas, may include daily forecast.

Request

    /area/list[/search] (search: state code, lat/lon, search term)
    

The optional 'search' parameter (indicated as '/search' above) may the the following:

  • Two-character United States state code
  • Latitude/Longitude in the format 'latitude,longitude'. This displays the closest areas to this location. Latitude and longitude should be in decimal format (not degrees).
  • Search string

Additional Parameters

  • days (optional, default '0')
    # of forecast days to display for each area
  • startDate (optional, default today)
    Starting date for displaying forecast. Format is yyyy-mm-dd.
  • tempUnit (optional, default 'f')
    Temperature units, 'c' for Celsius, 'f' for Fahrenheit.
  • maxResults (optional, default '100')
    Maximium number of results to return.
  • startIndex (optional, default '0')
    Starting index for the results, 0-based.

Example

Request

    http://api.climbingweather.com/api/area/list/CA?apiKey=[api key]&days=2
    

Response

    {
      "status": "OK",
      "results": 
        [
          {
            "id": "729",
            "name": "Alabama Hills",
            "f":
              [
                {
                    "d": "2011-02-27", "hi": "49", "l": "28", 
                    "pd": "8", "pn": "10", "sy": "cloudy3"
                },
                {
                    "d": "2011-02-28", "hi": "45", "l": "31", 
                    "pd": "30", "pn": "61", "sy": "shower3"
                }
              ]
          },
          {
            "id": 675,
            "name": "Bishop Peak",
            "f":
              [
                {"hi": 13, "l": 4, "pd": "9", "pn": "31", "sy": "cloudy2"},
                {"hi": 12, "l":4, "pd": "83", "pn": "85", "sy": "shower3"}
              ]
          },
          {
            // Additional areas not shown
          },
        ]
    }
    

Area Daily Forecast

Get the 7-day forecast for a specific area.

Request

    /api/area/daily/[areaId]
    

Additional Parameters

  • days (optional, default '7')
    # of forecast days to display for each area
  • startDate (optional, default today)
    Starting date for displaying forecast. Format is yyyy-mm-dd.
  • tempUnit (optional, default 'f')
    Temperature units, 'c' for Celsius, 'f' for Fahrenheit

Example

Request

    http://api.climbingweather.com/area/daily/3?apiKey=[your api key]&days=3
    

Response

    {
        "status": "OK",
        "results": 
        {
            "n": "New River Gorge",
            "f": 
            [
                {
                "d": "2011-02-27", "dy": "Today", "dd": "Feb 27", "hi": "67", 
                "l":"37", "pd":"60", "pn": "65", "h": "59", "r":"0.22", 
                "s": "0.00", "ws": "9", "wg": "17",
                "w": "chance light rain showers", "sy":"cloudy3",
                "c":"Chance light rain showers. 0.22 inches rain possible."
                },
                {
                "d": "2011-02-28", "dy": "Mon", "dd": "Feb 28", "hi": "66", 
                "l": "46", "pd": "96", "pn": "59", "h": "75", "r": "1.12", 
                "s": "0.00", "ws": "14", "wg": "35", 
                "w": "rain showers likely", "sy": "tstorm3",
                "c": "Rain showers likely. 1.12 inches rain possible."
                },
                {
                "d": "2011-03-01", "dy": "Tue", "dd": "Mar 1", "hi": "53", 
                "l": "32", "pd": "11", "pn": "7", "h": "61", "r": "0.02", 
                "s":null, "ws": "4", "wg": "14", "w":null, "sy": "cloudy1", 
                "c": "0.02 inches rain possible. "
                }
            ]
        }
    }
    

Forecast Key

Responses that return forecast data use the following key:
Param Unit Explanation
d -- Date of forecast, yyyy-mm-dd format
dy -- Day of week
dd -- Date of forecast, '[month] [day]', e.g., Feb 27
hi ° fahrenheit or celsius High/maximum temperature
l ° fahrenheit or celsius Low/minimum temperature
pd % Daytime chance of precipitation
pn % Nighttime chance of precipitation
h % Relative humidity
r inches Rain amount
s inches Snow amount
ws mph Wind speed, sustained
wg mpg Wind speed, gust
w -- Weather conditions, e.g., 'moderate rain showers likely'
sy -- Weather symbol, see below for complete URL
c -- Formatted weather conditions, includes weather conditions and rain/snow amount.

Weather symbols: The symbol returned in the 'sy' parameter is a prefix for a weather image file. Symbols are available in 32 or 64 pixel sizes. Images can be requested from the ClimbingWeather.com content delivery network domain, cw-cdn.com. The content delivery network provides faster download speeds from a cookie-less domain. Images are only available in png format.

For example, to request the 32 pixel image for the 'cloudy3' symbol, use the URL:

    http://www.cw-cdn.com/img/icons/wx/cloudy3-32px.png
    

Status Codes

There are two status codes: 'OK' indicates that the request was successfull, 'ERROR' indicates that an error occurred. If the status code is 'ERROR', an error message will be included:

    {"status" :"ERROR", "error": "Invalid API key"}
    

Always check to make sure the status is 'OK' before processing results.

Getting an API Key
The API key is required for all API requests. To get one, you must have a ClimbingWeather.com account. After registering for an account and logging in, follow instructions on your 'profile' page to generate an API key.