---
title: "Retrieves the most recent forecasted data and calculates the optimal marginal carbon intensity window."
method: GET
path: "/emissions/forecasts/current"
tags: ["CarbonAware"]
---

# Retrieves the most recent forecasted data and calculates the optimal marginal carbon intensity window.

`GET /emissions/forecasts/current`

This endpoint fetches only the most recently generated forecast for all provided locations.  It uses the "dataStartAt" and 
"dataEndAt" parameters to scope the forecasted data points (if available for those times). If no start or end time 
boundaries are provided, the entire forecast dataset is used. The scoped data points are used to calculate average marginal 
carbon intensities of the specified "windowSize" and the optimal marginal carbon intensity window is identified.
            
The forecast data represents what the data source predicts future marginal carbon intesity values to be, 
not actual measured emissions data (as future values cannot be known).
            
This endpoint is useful for determining if there is a more carbon-optimal time to use electicity predicted in the future.

## Query parameters

- `location` string[], required
- `dataStartAt` string, date-time
- `dataEndAt` string, date-time
- `windowSize` integer

## Response `200`

Returns the requested forecast objects

- EmissionsForecastDTO[]
  - `generatedAt` string, date-time — Timestamp when the forecast was generated.
  - `requestedAt` string, 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.
  - `location` string, nullable — The location of the forecast
  - `dataStartAt` string, 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.
  - `dataEndAt` string, 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.
  - `windowSize` integer — The estimated duration (in minutes) of the workload. Defaults to the duration of a single forecast data point.
  - `optimalDataPoints` EmissionsDataDTO[], nullable — The optimal forecasted data point within the 'forecastData' array. Null if 'forecastData' array is empty.
    - `location` string, nullable
    - `timestamp` string, date-time
    - `duration` integer
    - `value` number, double
  - `forecastData` EmissionsDataDTO[], nullable — The forecasted data points transformed and filtered to reflect the specified time and window parameters. Points are ordered chronologically; Empty array if all data points were filtered out. E.G. dataStartAt and dataEndAt times outside the forecast period; windowSize greater than total duration of forecast data;
    - `location` string, nullable
    - `timestamp` string, date-time
    - `duration` integer
    - `value` number, double

## Other responses

- `400` — Returned if any of the input parameters are invalid
- `500` — Internal server error
- `501` — Returned if the underlying data source does not support forecasting

---

[API](https://skmtc.net/azure/apis/carbonaware-webapi-version-1-0-0-0-culture-neutral-publickey.md) · [All operations](https://skmtc.net/azure/apis/carbonaware-webapi-version-1-0-0-0-culture-neutral-publickey/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/carbonaware-webapi-version-1-0-0-0-culture-neutral-publickey/revisions/5b8513db900a/schema)
