All Products
Search
Document Center

Energy Expert:GetElecTrend

Last Updated:Dec 05, 2025

Retrieves electricity trend analysis data.

Operation description

  1. The API returns a list. Each element in the list contains emission data for a specific type of electricity.

  2. Each emission list contains the following elements: the year and month of the emission, the electricity consumption and its unit, the corresponding carbon emissions, and the ratio of this consumption to the total electricity consumption for that month.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

energy:GetElecTrend

none

*All Resource

*

None None

Request syntax

POST /api/v1/carbon/emission/analysis/elec/trend HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

code

string

Yes

The enterprise code.

C-20240115-3

yearList

array

Yes

A list of years.

integer

Yes

Year.

2023

Response elements

Element

Type

Description

Example

object

The response struct.

requestId

string

The request ID.

83A5A7DD-8974-5769-952E-590A97BEA34E

data

object

The returned data.

water

array<object>

The monthly electricity consumption and carbon emission data for hydropower.

object

The data struct for monthly electricity consumption and carbon emissions of hydropower.

carbonEmissionData

number

The carbon emissions.

3.14

rawData

number

Electricity consumption.

3.14

ratio

number

The ratio of the electricity consumption to the total electricity consumption for the month. For example, a value of 0.5 indicates 50%.

0.5

dataUnit

string

The unit.

kWh

name

string

The name of the electricity type.

水电

nameKey

string

The code of the electricity type.

carbonInventory.check.water_electricity

month

integer

The month.

12

year

string

The year.

2024

light

array<object>

The monthly electricity consumption and carbon emission data for photovoltaic power.

object

The data struct for monthly electricity consumption and carbon emissions of photovoltaic power.

carbonEmissionData

number

The carbon emissions.

3.14

rawData

number

Electricity consumption.

3.14

ratio

number

The ratio of the electricity consumption to the total electricity consumption for the month. For example, a value of 0.5 indicates 50%.

0.5

dataUnit

string

The unit.

kWh

name

string

The name of the electricity type.

光电

nameKey

string

The code of the electricity type.

carbonInventory.check.light_electricity

month

integer

The month.

12

year

string

The year.

2024

urban

array<object>

The monthly electricity consumption and carbon emission data for grid power.

object

The data struct for monthly electricity consumption and carbon emissions of grid power.

carbonEmissionData

number

The carbon emissions.

3.14

rawData

number

Electricity consumption.

3.14

ratio

number

The ratio of the electricity consumption to the total electricity consumption for the month. For example, a value of 0.5 indicates 50%.

0.5

dataUnit

string

The unit.

kWh

name

string

The name of the electricity type.

市电

nameKey

string

The code of the electricity type.

carbonInventory.check.urban_electricity

month

integer

The month.

12

year

string

The year.

2024

wind

array<object>

The monthly electricity consumption and carbon emission data for wind power.

object

The data struct for monthly electricity consumption and carbon emissions of wind power.

carbonEmissionData

number

The carbon emissions.

3.14

rawData

number

Electricity consumption.

3.14

ratio

number

The ratio of the electricity consumption to the total electricity consumption for the month. For example, a value of 0.5 indicates 50%.

0.5

dataUnit

string

The unit.

kWh

name

string

The name of the electricity type.

风电

nameKey

string

The code of the electricity type.

carbonInventory.check.wind_electricity

month

integer

The month.

12

year

string

The year.

2024

nuclear

array<object>

The monthly electricity consumption and carbon emission data for nuclear power.

object

The data struct for monthly electricity consumption and carbon emissions of nuclear power.

carbonEmissionData

number

The carbon emissions.

3.14

rawData

number

Electricity consumption.

3.14

ratio

number

The ratio of the electricity consumption to the total electricity consumption for the month. For example, a value of 0.5 indicates 50%.

0.5

dataUnit

string

The unit.

kWh

name

string

The name of the electricity type.

核电

nameKey

string

The code of the electricity type.

carbonInventory.check.nuclear_electricity

month

integer

The month.

12

year

string

The year.

2024

renewing

array<object>

The monthly electricity consumption and carbon emission data for renewable electricity.

object

The data struct for monthly electricity consumption and carbon emissions of renewable electricity.

carbonEmissionData

number

The carbon emissions.

3.14

rawData

number

Electricity consumption.

3.14

ratio

number

The ratio of the electricity consumption to the total electricity consumption for the month. For example, a value of 0.5 indicates 50%.

0.5

dataUnit

string

The unit.

kWh

name

string

The name of the electricity type.

可再生电

nameKey

string

The code of the electricity type.

carbonInventory.carbonEmissionAnalysis.components.CarbonDetail.lingTanDianLi

month

integer

The month.

12

year

string

The year.

2024

zero

array<object>

The monthly electricity consumption and carbon emission data for zero-carbon electricity.

object

The data struct for monthly electricity consumption and carbon emissions of zero-carbon electricity.

carbonEmissionData

number

The carbon emissions.

3.14

rawData

number

Electricity consumption.

3.14

ratio

number

The ratio of the electricity consumption to the total electricity consumption for the month. For example, a value of 0.5 indicates 50%.

0.5

dataUnit

string

The unit.

kWh

name

string

The name of the electricity type.

零电

nameKey

string

The code of the electricity type.

carbonInventory.carbonEmissionAnalysis.components.CarbonDetail.lingTanDianLi

month

integer

The month.

12

year

string

The year.

2024

code

string

The response code. A value of `200` indicates that the request was successful. Other values indicate that the request failed. For more information, see the `msg` parameter.

200

Examples

Success response

JSON format

{
  "requestId": "83A5A7DD-8974-5769-952E-590A97BEA34E",
  "data": {
    "water": [
      {
        "carbonEmissionData": 3.14,
        "rawData": 3.14,
        "ratio": 0.5,
        "dataUnit": "kWh",
        "name": "水电",
        "nameKey": "carbonInventory.check.water_electricity",
        "month": 12,
        "year": "2024"
      }
    ],
    "light": [
      {
        "carbonEmissionData": 3.14,
        "rawData": 3.14,
        "ratio": 0.5,
        "dataUnit": "kWh",
        "name": "光电",
        "nameKey": "carbonInventory.check.light_electricity",
        "month": 12,
        "year": "2024"
      }
    ],
    "urban": [
      {
        "carbonEmissionData": 3.14,
        "rawData": 3.14,
        "ratio": 0.5,
        "dataUnit": "kWh",
        "name": "市电",
        "nameKey": "carbonInventory.check.urban_electricity",
        "month": 12,
        "year": "2024"
      }
    ],
    "wind": [
      {
        "carbonEmissionData": 3.14,
        "rawData": 3.14,
        "ratio": 0.5,
        "dataUnit": "kWh",
        "name": "风电",
        "nameKey": "carbonInventory.check.wind_electricity",
        "month": 12,
        "year": "2024"
      }
    ],
    "nuclear": [
      {
        "carbonEmissionData": 3.14,
        "rawData": 3.14,
        "ratio": 0.5,
        "dataUnit": "kWh",
        "name": "核电",
        "nameKey": "carbonInventory.check.nuclear_electricity",
        "month": 12,
        "year": "2024"
      }
    ],
    "renewing": [
      {
        "carbonEmissionData": 3.14,
        "rawData": 3.14,
        "ratio": 0.5,
        "dataUnit": "kWh",
        "name": "可再生电",
        "nameKey": "carbonInventory.carbonEmissionAnalysis.components.CarbonDetail.lingTanDianLi",
        "month": 12,
        "year": "2024"
      }
    ],
    "zero": [
      {
        "carbonEmissionData": 3.14,
        "rawData": 3.14,
        "ratio": 0.5,
        "dataUnit": "kWh",
        "name": "零电",
        "nameKey": "carbonInventory.carbonEmissionAnalysis.components.CarbonDetail.lingTanDianLi",
        "month": 12,
        "year": "2024"
      }
    ]
  },
  "code": "200"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.