About Cal-Adapt API

Cal-Adapt API is a Open or Public API and provides programmatic access to data hosted by Cal-Adapt through an Application Programming Interface. The API is being developed by UC Berkeley's  Geospatial Innovation Facility (GIF) with funding and advisory oversight by the  California Energy Commission. The data available throuh the Cal-Adapt API have been gathered from California's scientific community, and represent peer-reviewed, high quality science. Learn more about the variety of  scientists and organizations that have contributed data and resources to Cal-Adapt.

We are beta-testing the Cal-Adapt API and actively working on providing more detailed documentation and building a library of examples. In the meantime you can check out our Quickstart Guide. We welcome your feedback!

Quickstart Guide

The entry point for the Cal-Adapt API is:

        http://api.cal-adapt.org/api
      

The climate data rasters are registered at the raster series endpoint:

        http://api.cal-adapt.org/api/series/
      

Each raster series is identified by a unique slug, e.g.:

        http://api.cal-adapt.org/api/series/pr_year_ACCESS1-0_rcp45/
      

Each raster series contains a rasters array. This array contains the raster stores which represent individual time steps.

        {
"name": "yearly average precipitation ACCESS1-0 RCP 4.5",
"slug": "pr_year_ACCESS1-0_rcp45",
"url": "http://api.cal-adapt.org/api/series/pr_year_ACCESS1-0_rcp45/",
"begin": "2006-01-01T00:00:00Z",
"end": "2100-12-31T00:00:00Z",
"rasters": [
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2006/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2007/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2008/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2009/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2010/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2011/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2012/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2013/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2014/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2015/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2016/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2017/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2018/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2019/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2020/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2021/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2022/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2023/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2024/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2025/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2026/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2027/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2028/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2029/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2030/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2031/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2032/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2033/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2034/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2035/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2036/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2037/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2038/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2039/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2040/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2041/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2042/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2043/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2044/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2045/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2046/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2047/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2048/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2049/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2050/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2051/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2052/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2053/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2054/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2055/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2056/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2057/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2058/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2059/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2060/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2061/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2062/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2063/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2064/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2065/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2066/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2067/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2068/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2069/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2070/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2071/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2072/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2073/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2074/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2075/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2076/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2077/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2078/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2079/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2080/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2081/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2082/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2083/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2084/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2085/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2086/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2087/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2088/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2089/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2090/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2091/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2092/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2093/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2094/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2095/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2096/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2097/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2098/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2099/",
    "http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2100/"
],
"tags": [
    "climate",
    "precipitation"
]
}
      

The daily raster series contains a rasters array which is different from the yearly rasters. This array contains a single multiband raster store that includes all time steps.

        {
  "name": "daily precipitation ACCESS1-0 RCP 4.5",
  "slug": "pr_day_ACCESS1-0_rcp45",
  "url": "http://api.cal-adapt.org/api/series/pr_day_ACCESS1-0_rcp45/",
  "begin": "2006-01-01T00:00:00Z",
  "end": "2100-12-31T00:00:00Z",
  "rasters": [
      "http://api.cal-adapt.org/api/rstores/pr_day_ACCESS1-0_rcp45_2006-2100/"
  ],
  "tags": [
      "climate",
      "precipitation"
  ]
}
      

Raster values can be read for any provided location using the following query parameters:

  • g – point or polygon geometry as GeoJSON, GML, KML, or WKT
  • stat – aggregate values over given geometry using max, min, mean
  • pagesize – for a raster series this parameter indicates number of years, default is 10
  • period – resample temporal dimension to the given integer
  • format – response format json, tif.zip, img.zip. Instead of using the format query parameter, we reccomend using appropriate Accept headers in your HTTP requests.

Request Example

The following request gets the Annual Average Precipitation data from the ACCESS1-0 model, RCP4.5 scenario raster for a grid cell at the given point coordinates for all 95 years:

        http://api.cal-adapt.org/api/series/pr_year_ACCESS1-0_rcp45/rasters/?g={'type':'Point','coordinates':[-121.46,38.58]}&pagesize=100&format=json
      

Response Example

The following response is returned from the API for the above request (truncated here for legibility). Each object in the results array corresponds to data for an individual year. The image field corresponds to the projected precipitation value for the grid cell for that year.

        {
 "count":95,
 "next":null,
 "previous":null,
 "results":[
    {
       "id":7481,
       "tileurl":"http://api.cal-adapt.org/tiles/pr_year_ACCESS1-0_rcp45_2006/{z}/{x}/{y}.png?format=json",
       "url":"http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2006/?format=json",
       "image":1.3583282452600542e-05,
       "width":179,
       "height":195,
       "geom":{
          "type":"Polygon",
          "coordinates":[
             [
                [
                   -124.5625,
                   31.5625
                ],
                [
                   -113.375,
                   31.5625
                ],
                [
                   -113.375,
                   43.75
                ],
                [
                   -124.5625,
                   43.75
                ],
                [
                   -124.5625,
                   31.5625
                ]
             ]
          ]
       },
       "event":"2006-01-01",
       "srs":"GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]]",
       "minval":1.1480713055789238e-06,
       "maxval":0.00014239244046621025,
       "nodata":1.0000000150474662e+30,
       "xpixsize":0.0625,
       "ypixsize":-0.0625,
       "name":"yearly average precipitation ACCESS1-0 RCP 4.5",
       "slug":"pr_year_ACCESS1-0_rcp45_2006",
       "units":"kg/m2/s"
    },
    {
       "id":7482,
       "tileurl":"http://api.cal-adapt.org/tiles/pr_year_ACCESS1-0_rcp45_2007/{z}/{x}/{y}.png?format=json",
       "url":"http://api.cal-adapt.org/api/rstores/pr_year_ACCESS1-0_rcp45_2007/?format=json",
       "image":1.4450376511376817e-05,
       "width":179,
       "height":195,
       "geom":{
          "type":"Polygon",
          "coordinates":[
             [
                [
                   -124.5625,
                   31.5625
                ],
                [
                   -113.375,
                   31.5625
                ],
                [
                   -113.375,
                   43.75
                ],
                [
                   -124.5625,
                   43.75
                ],
                [
                   -124.5625,
                   31.5625
                ]
             ]
          ]
       },
       "event":"2007-01-01",
       "srs":"GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]]",
       "minval":6.108150500949705e-07,
       "maxval":0.0001323448377661407,
       "nodata":1.0000000150474662e+30,
       "xpixsize":0.0625,
       "ypixsize":-0.0625,
       "name":"yearly average precipitation ACCESS1-0 RCP 4.5",
       "slug":"pr_year_ACCESS1-0_rcp45_2007",
       "units":"kg/m2/s"
    }, ...
 ]
}
      

Raster Tiles

Tiled raster images can be retrieved using the URL template provided with the raster store response which follows this format:

        http://api.cal-adapt.org/api/tiles/{slug}/{z}/{x}/{y}/