CarbonAwareApi - axios parameter creator

  • Parameters

    Returns {
        batchForecastDataAsync: (
            emissionsForecastBatchParametersDTO?: EmissionsForecastBatchParametersDTO[],
            options?: RawAxiosRequestConfig,
        ) => Promise<RequestArgs>;
        getAverageCarbonIntensity: (
            location: string,
            startTime: string,
            endTime: string,
            options?: RawAxiosRequestConfig,
        ) => Promise<RequestArgs>;
        getAverageCarbonIntensityBatch: (
            carbonIntensityBatchParametersDTO?: CarbonIntensityBatchParametersDTO[],
            options?: RawAxiosRequestConfig,
        ) => Promise<RequestArgs>;
        getBestEmissionsDataForLocationsByTime: (
            location: string[],
            time?: string,
            toTime?: string,
            options?: RawAxiosRequestConfig,
        ) => Promise<RequestArgs>;
        getCurrentForecastData: (
            location: string[],
            dataStartAt?: string,
            dataEndAt?: string,
            windowSize?: number,
            options?: RawAxiosRequestConfig,
        ) => Promise<RequestArgs>;
        getEmissionsDataForLocationByTime: (
            location: string,
            time?: string,
            toTime?: string,
            options?: RawAxiosRequestConfig,
        ) => Promise<RequestArgs>;
        getEmissionsDataForLocationsByTime: (
            location: string[],
            time?: string,
            toTime?: string,
            options?: RawAxiosRequestConfig,
        ) => Promise<RequestArgs>;
    }

    • batchForecastDataAsync: (
          emissionsForecastBatchParametersDTO?: EmissionsForecastBatchParametersDTO[],
          options?: RawAxiosRequestConfig,
      ) => Promise<RequestArgs>

      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.

    • getAverageCarbonIntensity: (
          location: string,
          startTime: string,
          endTime: string,
          options?: RawAxiosRequestConfig,
      ) => Promise<RequestArgs>

      This endpoint is useful for reporting the measured carbon intensity for a specific time period in a specific location.

    • getAverageCarbonIntensityBatch: (
          carbonIntensityBatchParametersDTO?: CarbonIntensityBatchParametersDTO[],
          options?: RawAxiosRequestConfig,
      ) => Promise<RequestArgs>

      The application only supports batching across a single location with different time boundaries. If multiple locations are provided, an error is returned. For each item in the request array, the application returns a corresponding object containing the location, time boundaries, and average marginal carbon intensity.

    • getBestEmissionsDataForLocationsByTime: (
          location: string[],
          time?: string,
          toTime?: string,
          options?: RawAxiosRequestConfig,
      ) => Promise<RequestArgs>
    • getCurrentForecastData: (
          location: string[],
          dataStartAt?: string,
          dataEndAt?: string,
          windowSize?: number,
          options?: RawAxiosRequestConfig,
      ) => Promise<RequestArgs>

      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 intensity 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 electricity predicted in the future.

    • getEmissionsDataForLocationByTime: (
          location: string,
          time?: string,
          toTime?: string,
          options?: RawAxiosRequestConfig,
      ) => Promise<RequestArgs>
    • getEmissionsDataForLocationsByTime: (
          location: string[],
          time?: string,
          toTime?: string,
          options?: RawAxiosRequestConfig,
      ) => Promise<RequestArgs>