How to use CLIK API

The CLimate Information toolKit (CLIK) Open Application Program Interface(API) is a service providing programmatic access to data.
In this page you will find explanations and examples showing how to use the CLIK API.

Please process as follows:

  1. Set the API key
  2. Install the API client
  3. Use the API client
Set the API key
  1. If you don't have an account, please self register at the Registration.
  2. If you are not logged, please login and get your key at Member Info.
  3. Copy the code displayed below, in the file $HOME/apccapi.properties.
key=810050f2-727e-5ed3-a871-b7a881a04d34
request_url=https://apcc21.org/clikapi/request/apccdata
status_url=https://apcc21.org/clikapi/request/status
Install the API client

Please download the Python API via this link.
You can install API client by running below at your working directory.

$ tar xvf apccapi.tar.gz
Use the API client

Once the API client is installed, it can be used to request data from the datasets.
You can download using the below sample python code.

Dataset:

import apccapi

c = apccapi.Client()

request = {
    'lead_month': '3-MON',      # 3-MON, 6-MON
    'variable': 'prec',         # prec, slp, sst, t2m, t850, z500
    'method': 'SCM',            # SCM, GAUS
    'period': 'Monthly mean',   # Monthly mean, #Seasonal mean
    'iyear': '2021',            # Issued Year
    'imonth': '2',              # Issued Month
}

c.retrieve(request)
import apccapi

c = apccapi.Client()

request = {
    'lead_month': '6-MON',      # 3-MON, 6-MON
    'variable': 'prec',         # prec, slp, sst, t2m, t850, z500
    'method': 'SCM',            # SCM, GAUS
    'period': 'Monthly mean',   # Monthly mean, #Seasonal mean
    'iyear': '2021',            # Issued Year
    'imonth': '2',              # Issued Month
}

c.retrieve(request)
import apccapi

c = apccapi.Client()

request = {
    'lead_month': '3-MON',      # 3-MON, 6-MON
    'variable': 'prec',         # prec, slp, sst, t2m, t850, z500
    'institute': 'APCC',        # APCC, ...
    'model': 'CCSM4',           # CCSM4, ...
    'period': 'Monthly mean',   # Monthly mean, #Seasonal mean
    'iyear': '2021',            # Issued Year
    'imonth': '2',              # Issued Month
}

c.retrieve(request)
import apccapi

c = apccapi.Client()

request = {
    'institute': 'NASA-GISS',   # NASA-GISS, ...
    'model': 'GISS-E2-R',       # GISS-E2-R, ...
    'variable': 'pr',           # pr, tas, ...
    'frequency': 'mon',         # mon, day, ...
    'iyear': '2006',            # Start Year
    'eyear': '2100',            # End Year
    'experiment': 'rcp45',      # rcp45, rcp85, ...
    'ensemble': 'r1i1p1',       # r1i1p1, ...
}

c.retrieve(request)

The CLimate Information toolKit (CLIK) Open Application Program Interface(API) is a service providing programmatic access to data.
In this page you will find explanations and examples showing how to use the CLIK API.

Please process as follows:

  1. Set the API key
  2. Install the API client
  3. Use the API client
Set the API key
  1. If you don't have an account, please self register at the Registration.
  2. If you are not logged, please login and get your key at Member Info.
  3. Copy the code displayed below, in the file apcc.conf located at the same directory as your Java program.
key=810050f2-727e-5ed3-a871-b7a881a04d34
request_url=https://apcc21.org/clikapi/request/apccdata
status_url=https://apcc21.org/clikapi/request/statuss
Install the API client

Please download the Java API via this link.
You can install API client by running below at your working directory.

$ tar xvf apccapi-java.tar.gz
Use the API client

Once the API client is installed, it can be used to request data from the datasets.
You can download using the below sample Java code.

Dataset:

import org.apcc.api.ApccApi;
import org.apcc.api.ApccRequest;

public class TestMme3 {
    public static void main(String[] args) {
        ApccApi api = new ApccApi();

        ApccRequest request = new ApccRequest();
        request.setLeadMonth("3-MON");        // 3-MON, 6-MON
        request.setVariable("prec");          // prec, slp, sst, t2m, t850, z500
        request.setMethod("SCM");             // SCM, GAUS
        request.setPeriod("Monthly mean");    // Monthly mean, Seasonal mean
        request.setIyear("2021");             // Issued Year
        request.setImonth("2");               // Issued Month

        api.retrieve(request);
    }
}
import org.apcc.api.ApccApi;
import org.apcc.api.ApccRequest;

public class TestMme6 {
    public static void main(String[] args) {
        ApccApi api = new ApccApi();

        ApccRequest request = new ApccRequest();
        request.setLeadMonth("6-MON");        // 3-MON, 6-MON
        request.setVariable("prec");          // prec, slp, sst, t2m, t850, z500
        request.setMethod("SCM");             // SCM, GAUS
        request.setPeriod("Monthly mean");    // Monthly mean, Seasonal mean
        request.setIyear("2021");             // Issued Year
        request.setImonth("2");               // Issued Month

        api.retrieve(request);
    }
}
import org.apcc.api.ApccApi;
import org.apcc.api.ApccRequest;

public class TestModel {
    public static void main(String[] args) {
        ApccApi api = new ApccApi();

        ApccRequest request = new ApccRequest();
        request.setLeadMonth("3-MON");        // 3-MON, 6-MON
        request.setVariable("prec");          // prec, slp, sst, t2m, t850, z500
        request.setInstitute("APCC");         // APCC, ...
        request.setModel("CCSM4");            // CCSM4, ...
        request.setPeriod("Monthly mean");    // Monthly mean, Seasonal mean
        request.setIyear("2021");             // Issued Year
        request.setImonth("2");               // Issued Month

        api.retrieve(request);
    }
}
import org.apcc.api.ApccApi;
import org.apcc.api.ApccRequest;

public class TestCmip5 {
    public static void main(String[] args) {
        ApccApi api = new ApccApi();

        ApccRequest request = new ApccRequest();
        request.setInstitute("NASA-GISS");    // NASA-GISS, ...
        request.setModel("GISS-E2-R");        // GISS-E2-R, ...
        request.setVariable("pr");            // pr, tas, ...
        request.setFrequency("mon");          // mon, day, ...
        request.setIyear("2006");             // Start Year
        request.setEyear("2100");             // End Year
        request.setExperiment("rcp45");       // rcp45, rcp85, ...
        request.setEnsemble("r1i1p1");        // r1i1p1, ...

        api.retrieve(request);
    }
}

The CLimate Information toolKit (CLIK) Clipping Open Application Program Interface(API) is a service which returns clipped data.
In this page you will find explanations and examples showing how to use the CLIK Clipping API.

Please process as follows:

  1. Install the API client
  2. Use the API client
Install the clipping API client

Please download the Python Clipping API via this link.
You can install API client by running below at your working directory.

$ tar xvf clippingapi.tar.gz
Use the API client

Once the API client is imported, it can be used to request data from the datasets.
You can download using the below sample Python code.

Clipping Open API currently provides only MME Models.

Dataset:

import clippingapi
import json
import requests

c = clippingapi.Client()

request = {
    'lead_month': '3-MON',      # 3-MON, 6-MON
    'variable': 'prec',         # prec, slp, sst, t2m, t850, z500
    'method': 'SCM',            # SCM, GAUS
    'period': 'Monthly mean',   # Monthly mean, Seasonal mean
    'iyear': '2021',            # Issued Year
    'imonth': '2',              # Issued Month
    'cowest': '188',            # coordinate of west
    'coeast': '191',
    'conorth': '-11',
    'cosouth': '-15',
    'return_type': 'png'        # Clipping API only provides either .nc or .png files.
}

c.clip(request)
import clippingapi
import json
import requests

c = clippingapi.Client()

request = {
    'lead_month': '6-MON',      # 3-MON, 6-MON
    'variable': 'prec',         # prec, slp, sst, t2m, t850, z500
    'method': 'SCM',            # SCM, GAUS
    'period': 'Monthly mean',   # Monthly mean, Seasonal mean
    'iyear': '2021',            # Issued Year
    'imonth': '2',              # Issued Month
    'cowest': '188',
    'coeast': '191',
    'conorth': '-11',
    'cosouth': '-15',
    'return_type': 'nc'         # Clipping API only provides either .nc or .png files.
}

c.clip(request)