All Products
Search
Document Center

MaxCompute:SumBillsByDate

Last Updated:Apr 16, 2026

Retrieves a daily summary of costs, grouped by instance or billable item.

Operation description

Retrieves a daily summary of costs, grouped by instance or billable item.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /api/v1/bills/sumByDate HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body. Example: {"startDate":1775714495313,"endDate":1776232895313,"projectNames":["vw2","mcqa2_tpcds_test","bird"],"statsType":"FEE_ITEM","topN":8}

projectNames

array

No

A list of instance names. In this context, an instance is a MaxCompute project.

string

No

The name of the instance.

projectName

startDate

integer

No

The start time of the cost statistics period.

1715393576201

endDate

integer

No

The end time of the cost statistics period.

1718590596556

statsType

string

No

The statistics type. Valid values: PROJECT (by instance) and FEE_ITEM (by billable item).

PROJECT

topN

integer

No

The number of top results to return, sorted by cost.

8

Response elements

Element

Type

Description

Example

object

PopResult<List>

requestId

string

The request ID.

BB66A390-4EF7-557E-9489-7F98D6F44002

httpCode

integer

The HTTP status code.

200

data

array<object>

The list of results.

array<object>

An object that contains the daily cost breakdown.

dateTime

string

The date of the statistics, in yyyyMMdd format.

20250719

cost

string

The total cost for the specified dateTime.

2000

currency

string

The currency. This is a fixed value.

RMB

itemBills

array<object>

A list of billable items.

object

A billable item.

itemName

string

The name of the item. The value of this parameter depends on the statsType parameter in the request. If statsType is PROJECT, this parameter indicates the instance name. If statsType is FEE_ITEM, this parameter can be a value such as DRStorage, ComputationSql, or Storage.

projectName

cost

string

The cost.

1000

currency

string

The currency. This is a fixed value.

RMB

percentage

number

The item's cost as a percentage of the total daily cost. This value does not include a percent sign (%).

50

Examples

Success response

JSON format

{
  "requestId": "BB66A390-4EF7-557E-9489-7F98D6F44002",
  "httpCode": 200,
  "data": [
    {
      "dateTime": "20250719",
      "cost": "2000",
      "currency": "RMB",
      "itemBills": [
        {
          "itemName": "projectName",
          "cost": "1000",
          "currency": "RMB",
          "percentage": 50
        }
      ]
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.