NAV Navbar
Shell HTTP JavaScript Node.JS Ruby Python Java
  • Carbon Intensity API
  • intensity
  • statistics
  • Schemas
  • Carbon Intensity API v1.0.0

    Scroll down for code samples and responses.

    Introduction
    This is the Official Carbon Intensity API for Great Britain developed by National Grid. You can find out more about carbon intensity at carbonintensity.org.uk.

    Summary
    National Grid’s Carbon Intensity API provides an indicative trend of carbon intensity of the electricity system in Great Britain (GB) up to 48-hours ahead of real-time. It provides programmatic and timely access to both forecast and estimated actual carbon intensity data. The Carbon Intensity forecast includes CO2 emissions related to electricity generation only. The includes emissions from all large metered power stations, interconnector imports, transmission and distribution losses, and accounts for national electricity demand, embedded wind and solar generation.
    The Carbon Intensity forecast is particularly sensitive to short-term forecast errors in demand, wind and solar generation, as this impacts the amount of disptachable generation that is required to meet demand. The forecast also makes use of historic generation data to make predictions about future generation, which invariably changes according to system conditions. It is therefore important to note that these forecasts are likely to be less accurate than forecasts such as electricity demand, since it includes the confluence of uncertainties from demand, wind, solar, and CO2 emissions by fuel type. With these limitations in mind, the Carbon Intensity forecast should only be used as an indicative trend of carbon intensity over the next two days, and not a perfect forecast.

    Base URLs:

    Terms of Use Email: Support License: CC BY 4.0

    intensity

    Carbon Intensity data

    GET /intensity

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get Carbon Intensity data for current half hour

    Get Carbon Intensity data for current half hour settlement period. All times provided in UTC (+00:00).

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "forecast": 0,
        "actual": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Intensity
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    Response Headers

    Status Header Type Format Description
    200 Access-Control-Allow-Origin string

    GET /intensity/date

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get Carbon Intensity data for today

    Get Carbon Intensity data for today. All times provided in UTC (+00:00).

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "forecast": 0,
        "actual": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Intensity
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    Response Headers

    Status Header Type Format Description
    200 Access-Control-Allow-Origin string

    GET /intensity/date/{date}

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date} \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date} HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get Carbon Intensity data for specific date

    Get Carbon Intensity data for a specific date. All times provided in UTC (+00:00).

    Parameters

    Parameter In Type Required Description
    date path string true Date in YYYY-MM-DD format e.g. 2017-08-25

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "forecast": 0,
        "actual": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Intensity
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    GET /intensity/date/{date}/{period}

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}/{period} \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}/{period} HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}/{period}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}/{period}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}/{period}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}/{period}', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/date/{date}/{period}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get Carbon Intensity data for specific date and period

    Get Carbon Intensity data for a specific date and half hour settlement period. All times provided in UTC (+00:00).

    Parameters

    Parameter In Type Required Description
    date path string true Date in YYYY-MM-DD format e.g. 2017-08-25
    period path string true Half hour settlement period between 1-48 e.g. 42

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "forecast": 0,
        "actual": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Intensity
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    GET /intensity/{from}

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from} \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from} HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get Carbon Intensity data for specific half hour period

    Get Carbon Intensity data for specific half hour period. All times provided in UTC (+00:00).

    Parameters

    Parameter In Type Required Description
    from path string true Datetime in in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "forecast": 0,
        "actual": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Intensity
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    GET /intensity/{from}/fw24h

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw24h \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw24h HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw24h',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw24h',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw24h',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw24h', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw24h");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get Carbon Intensity data 24hrs forwards from specific datetime

    Get Carbon Intensity data between the {from} datetime specified and 24hrs before. All times provided in UTC (+00:00).

    Parameters

    Parameter In Type Required Description
    from path string true Start datetime in in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "forecast": 0,
        "actual": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Intensity
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    GET /intensity/{from}/fw48h

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw48h \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw48h HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw48h',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw48h',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw48h',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw48h', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/fw48h");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get Carbon Intensity data 48hrs forwards from specific datetime

    Get Carbon Intensity data between the {from} datetime specified and 48hrs after. All times provided in UTC (+00:00).

    Parameters

    Parameter In Type Required Description
    from path string true Start datetime in in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "forecast": 0,
        "actual": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Intensity
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    GET /intensity/{from}/pt24h

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/pt24h \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/pt24h HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/pt24h',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/pt24h',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/pt24h',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/pt24h', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/pt24h");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get Carbon Intensity data 24hrs in the past of a specific datetime

    Get Carbon Intensity data between the {from} datetime specified and 24hrs before. All times provided in UTC (+00:00).

    Parameters

    Parameter In Type Required Description
    from path string true Start datetime in in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "forecast": 0,
        "actual": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Intensity
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    GET /intensity/{from}/{to}

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/{to} \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/{to} HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/{to}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/{to}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/{to}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/{to}', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/{from}/{to}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get Carbon Intensity data between from and to datetime

    Get Carbon Intensity data between the {from} and {to} datetimes. The maximum date range is limited to 30 days. All times provided in UTC (+00:00).

    Parameters

    Parameter In Type Required Description
    from path string true Start datetime in in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z
    to path string true End datetime in in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "forecast": 0,
        "actual": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Intensity
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    statistics

    Carbon Intensity statistics

    GET /intensity/stats/{from}/{to}

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to} \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to} HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get Carbon Intensity statistics between from and to datetime

    Get Carbon Intensity statistics (average, max, mean) between from and to datetime. The maximum date range is limited to 30 days. All times provided in UTC (+00:00).

    Parameters

    Parameter In Type Required Description
    from path string true Start datetime in in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z
    to path string true End datetime in in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-26T17:00Z

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "max": 0,
        "average": 0,
        "min": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Statistics
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    GET /intensity/stats/{from}/{to}/{block}

    Code samples

    # You can also use wget
    curl -X GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}/{block} \
      -H 'Accept: application/json'
    
    
    GET https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}/{block} HTTP/1.1
    Host: k1nehbcl85.execute-api.eu-west-2.amazonaws.com
    
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json'
    
    };
    
    $.ajax({
      url: 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}/{block}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}/{block}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}/{block}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}/{block}', params={
    
    }, headers = headers)
    
    print r.json()
    
    URL obj = new URL("https://k1nehbcl85.execute-api.eu-west-2.amazonaws.com/v1/intensity/stats/{from}/{to}/{block}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    

    Get block average Carbon Intensity statistics between from and to datetime

    Get block average Carbon Intensity statistics (average, max, mean) between from and to datetime. The maximum date range is limited to 30 days. The block length must be between 1 and 24 hours and should be an integer. All times provided in UTC (+00:00).

    Parameters

    Parameter In Type Required Description
    from path string true Start datetime in in ISO8601 format YYYY-MM-DDThh:mmZ e.g. '2017-08-25T12:35Z'
    to path string true End datetime in in ISO8601 format YYYY-MM-DDThh:mmZ e.g. '2017-08-26T17:00Z'
    block path string true Block length in hours i.e. a block length of 2 hrs over a 24 hr period returns 12 items with the average, max, min for each 2 hr block e.g. 2017-08-26T17:00Z/2017-08-27T17:00Z/2

    Example responses

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "max": 0,
        "average": 0,
        "min": 0,
        "index": "string"
      }
    }
    
    {
      "code": "string",
      "message": "string"
    }
    
    {
      "code": "string",
      "message": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK 200 response Statistics
    400 Bad Request 400 response Error
    500 Internal Server Error 500 response Error

    Schemas

    Intensity

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "forecast": 0,
        "actual": 0,
        "index": "string"
      }
    } 
    

    Properties

    Name Type Required Description
    from string false Datetime in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z. All times provided in UTC (+00:00).
    to string false Datetime in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z. All times provided in UTC (+00:00).
    intensity object false Carbon Intensity data (forecast, actual, index).
    » forecast number false The forecast Carbon Intensity for the half hour settlement period in units gCO2/kWh.
    » actual number false The estimated actual Carbon Intensity for the half hour settlement period in units gCO2/kWh.
    » index string false The index is a measure of the Carbon Intensity represented on a scale between 'very low', 'low', 'moderate', 'high', 'very high'.

    Error

    {
      "code": "string",
      "message": "string"
    } 
    

    Properties

    Name Type Required Description
    code string false The HTTP error code produced.
    message string false The error message produced.

    Statistics

    {
      "from": "string",
      "to": "string",
      "intensity": {
        "max": 0,
        "average": 0,
        "min": 0,
        "index": "string"
      }
    } 
    

    Properties

    Name Type Required Description
    from string false Datetime in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z. All times provided in UTC (+00:00).
    to string false Datetime in ISO8601 format YYYY-MM-DDThh:mmZ e.g. 2017-08-25T12:35Z. All times provided in UTC (+00:00).
    intensity object false Carbon Intensity statistics (max, average, min, index).
    » max number false The maximum Carbon Intensity for the datetime range in units gCO2/kWh. Future periods use forecast data. Past data uses actual data.
    » average number false The average Carbon Intensity for the datetime range in units gCO2/kWh. Future periods use forecast data. Past data uses actual data.
    » min number false The maximum Carbon Intensity for the datetime range in units gCO2/kWh. Future periods use forecast data. Past data uses actual data.
    » index string false The index is a measure of the Carbon Intensity represented on a scale between 'very low', 'low', 'moderate', 'high', 'very high'.