Climate at a Glance
Data Service API

Overview

A RESTful application programming interface (API) is available to access Climate at a Glance data. The API can format desired data as comma-separated values (CSV), JavaScript Object Notation (JSON), and Extensible Markup Language (XML). The Data Service is only available via HTTP Strict Transport Security (HSTS) following Federal government policy.

Request Endpoint Parameters

Parameters are passed using a GET request with a combination of path and optional query parameters. Accepted values are defined in the table below.

Path Parameters

/access/monitoring/climate-at-a-glance/{scope}/time-series/{location}/{parameter}/{surface}/{timescale}/{month}/{begYear}-{endYear}/data.{format}

The {begYear} and {endYear} parameters are optional. If they are not included, the entire period of record is returned.

/access/monitoring/climate-at-a-glance/{scope}/time-series/{location}/{parameter}/{surface}/{timescale}/{month}/data.{format}

Query Parameters

An optional query component may follow at the end of the URL path, preceded by a question-mark ?, in the form of key=value pairs, and separated by an ampersand &.

…?{basePeriod}=[true|false]&{basePeriodBegYear}=[year]&{basePeriodEndYear}=[year]

Request Parameter Type Description
scope String
Accepted Values
location String
Accepted Values
surface/coordinates* String
Accepted Values
parameter String
Accepted Values
*Please note, not all parameters are available for all locations and timescales. More info ↓
Degree Days are not available for:
Cities
Alaska
Hawaii
Great Plains
Souther Plains and Gulf Coast
Rockies and Westward
River Basins
Agricultural Belts
Palmer Indices are not available for:
Cities
Alaska
Hawaii
PDSI, PHDI, and PMDI are not offered for multiple-month time scales.
timescale Integer, String
Accepted Values
1-99
Number of Months
ytd
Year to Date
month Integer
Accepted Values
1-12
January-December
0
All Months
startYear Integer 4-digit year (must be less than or equal to endYear)
Accepted Values
endYear Integer 4-digit year (must be greater than or equal to startYear)
Accepted Values
format String
Accepted Values
csv
Comma-Separated Values
json
JavaScript Object Notation
xml
Extensible Markup Language
basePeriod Boolean
Accepted Values
true
Return anomalies based on the requested base period mean
false
Return no anomalies
basePeriodBegYear Integer 4-digit year (must be less than or equal to basePeriodEndYear)
Accepted Values
basePeriodEndYear Integer 4-digit year (must be greater than or equal to basePeriodBegYear)
Accepted Values