Skip to main content
GET
/
api
/
ledger
/
v2
/
{ledger}
/
volumes
Get list of volumes with balances for (account/asset)
curl --request GET \
  --url http://localhost/api/ledger/v2/{ledger}/volumes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "data": [
      {
        "account": "<string>",
        "asset": "<string>",
        "input": 123,
        "output": 123,
        "balance": 123
      }
    ],
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": ""
  }
}
Retrieve volume data (inputs, outputs, balance) for accounts. Volumes track the total flow of assets through each account.

Parameters

pageSize: Number of results to return per page. Defaults to 15, maximum 1000. (e.g., 100) cursor: Pagination cursor from a previous response. Use the next or previous value to navigate pages. (e.g., aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==) ledger: The name of the ledger to query volumes from. (e.g., ledger001) endTime: Only include transactions up to this timestamp. (e.g., 2024-01-31T23:59:59Z) startTime: Only include transactions from this timestamp onwards. (e.g., 2024-01-01T00:00:00Z) insertionDate: When true, uses insertion timestamps instead of effective dates. groupBy: Group volumes by address segment level. For example, groupBy=2 on users:john:wallet groups by users:john. (e.g., 2)

Request Body

Filter criteria. Use $match to filter by account address pattern before computing volumes. See Filtering Queries for full syntax. Example:
{
  "$match": {
    "account": "users::wallet"
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

ledger
string
required

Name of the ledger.

Example:

"ledger001"

Query Parameters

pageSize
integer<int64>

The maximum number of results to return per page.

Required range: 1 <= x <= 1000
cursor
string

Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.

Example:

"aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="

endTime
string<date-time>
startTime
string<date-time>
insertionDate
boolean

Use insertion date instead of effective date

groupBy
integer<int64>

Group volumes and balance by the level of the segment of the address

Required range: 0 <= x <= 1000
sort
string

Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

Example:

"id:desc"

Body

application/json

The body is of type object.

Response

OK

cursor
object
required