latestOpenAPI 3.0.12026-07-178827.6 KB

5b8513db900a

CarbonAware

Given an array of historical forecasts, retrieves the data that contains forecasts metadata, the optimal forecast and a range of forecasts filtered by the attributes [start...end] if provided.

This endpoint takes a batch of requests for historical forecast data, fetches them, and calculates the optimal marginal carbon intensity windows for each using the same parameters available to the '/emissions/forecasts/current' endpoint.

This endpoint is useful for back-testing what one might have done in the past, if they had access to the current forecast at the time.

post/emissions/forecasts/batch

Request body

requestedAtstring date-time nullable

For historical forecast requests, this value is the timestamp used to access the most recently generated forecast as of that time.

locationstring nullable

The location of the forecast

dataStartAtstring date-time nullable

Start time boundary of forecasted data points.Ignores current forecast data points before this time. Defaults to the earliest time in the forecast data.

dataEndAtstring date-time nullable

End time boundary of forecasted data points. Ignores current forecast data points after this time. Defaults to the latest time in the forecast data.

windowSizeinteger nullable

The estimated duration (in minutes) of the workload. Defaults to the duration of a single forecast data point.

Example request

[
  {
    "requestedAt": "2022-06-01T00:03:30Z",
    "location": "eastus",
    "dataStartAt": "2022-03-01T15:30:00Z",
    "dataEndAt": "2022-03-01T18:30:00Z",
    "windowSize": 30
  }
]

Response

Returns the requested forecast objects

generatedAtstring date-time

Timestamp when the forecast was generated.

requestedAtstring date-time

For current requests, this value is the timestamp the request for forecast data was made. For historical forecast requests, this value is the timestamp used to access the most recently generated forecast as of that time.

locationstring nullable

The location of the forecast

dataStartAtstring date-time

Start time boundary of forecasted data points. Ignores forecast data points before this time. Defaults to the earliest time in the forecast data.

dataEndAtstring date-time

End time boundary of forecasted data points. Ignores forecast data points after this time. Defaults to the latest time in the forecast data.

windowSizeinteger

The estimated duration (in minutes) of the workload. Defaults to the duration of a single forecast data point.

Example response

[
  {
    "dataEndAt": "2022-06-01T18:00:00Z",
    "windowSize": 30,
    "forecastData": [
      {
        "location": "eastus",
        "timestamp": "2022-06-01T14:40:00Z",
        "duration": 30,
        "value": 380.99
      },
      {
        "location": "eastus",
        "timestamp": "2022-06-01T14:45:00Z",
        "duration": 30,
        "value": 359.23
      },
      {
        "location": "eastus",
        "timestamp": "2022-06-01T14:50:00Z",
        "duration": 30,
        "value": 375.12
      }
    ],
    "requestedAt": "2022-06-01T00:03:30Z",
    "generatedAt": "2022-06-01T00:00:00Z",
    "optimalDataPoints": {
      "location": "eastus",
      "timestamp": "2022-06-01T14:45:00Z",
      "duration": 30,
      "value": 359.23
    },
    "location": "eastus",
    "dataStartAt": "2022-06-01T12:00:00Z"
  }
]