> ## Documentation Index
> Fetch the complete documentation index at: https://tokenterminal.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To query the Token Terminal data catalog, read https://tokenterminal.com/docs/catalog/agents-manual.md first. It is the whole catalog as one page: table naming grammar, key columns, partition and cluster rules, units, additivity, and the tables that are documented but not served yet.
> Never query a catalog table on a time bound alone. Also filter its cluster key, which you read from INFORMATION_SCHEMA.COLUMNS; an empty result means the object is a view, whose pruning contract is on its page. Compute is billed to the caller's own Google Cloud project.

# Get metric breakdown aggregation for multiple projects, chains, or products

> Use this endpoint to retrieve metric breakdown aggregation for multiple projects including avg, change, sum, trend, and latest values over a given interval or date range. When looking at cumulative metrics such as fees, reference sums for the total aggregate, and when looking at static metrics such as total value locked, reference latest values for the latest running total. See the response reference below for more details.

This endpoint supports partial success - if some of the requested metric, project, chain, or product IDs are not found, the endpoint will return data for the valid entities and include an `errors` array with details about the invalid ones.




## OpenAPI

````yaml /api-reference/openapi.json post /v2/metric-breakdown
openapi: 3.0.0
info:
  title: Token Terminal API
  termsOfService: https://tokenterminal.com/terms
  version: 2.0.0
servers:
  - url: https://api.tokenterminal.com
security:
  - bearerAuth: []
tags: []
paths:
  /v2/metric-breakdown:
    post:
      tags:
        - Metrics
      summary: >-
        Get metric breakdown aggregation for multiple projects, chains, or
        products
      description: >
        Use this endpoint to retrieve metric breakdown aggregation for multiple
        projects including avg, change, sum, trend, and latest values over a
        given interval or date range. When looking at cumulative metrics such as
        fees, reference sums for the total aggregate, and when looking at static
        metrics such as total value locked, reference latest values for the
        latest running total. See the response reference below for more details.


        This endpoint supports partial success - if some of the requested
        metric, project, chain, or product IDs are not found, the endpoint will
        return data for the valid entities and include an `errors` array with
        details about the invalid ones.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - metric_ids
                - group_by
              properties:
                metric_ids:
                  type: array
                  description: Array of metric IDs to retrieve data for
                  items:
                    type: string
                project_ids:
                  type: array
                  description: Optional array of project IDs to filter by
                  items:
                    type: string
                product_ids:
                  type: array
                  description: Optional array of product IDs to filter by
                  items:
                    type: string
                chain_ids:
                  type: array
                  description: Optional array of chain IDs to filter by
                  items:
                    type: string
                market_sector_ids:
                  type: array
                  description: Optional list of market sector IDs to filter by
                  items:
                    type: string
                  example:
                    - blockchains-l1
                    - lending
                interval:
                  type: string
                  description: >
                    Length of the aggregation window. Defaults to `7d`. The
                    window ends at the latest available date, or the day before
                    `end` if given.


                    Ignored when both `start` and `end` are given; the window is
                    then the date range `[start, end)`.
                  default: 7d
                  enum:
                    - 24h
                    - 7d
                    - 30d
                    - 90d
                    - 180d
                    - 365d
                    - 1095d
                    - 1825d
                    - ytd
                    - max
                group_by:
                  type: string
                  description: How to group the results
                  enum:
                    - projects
                    - chains
                    - chain-project
                    - chain-product
                    - chain-market-sector
                    - market-sector
                    - product
                start:
                  type: string
                  format: date
                  description: >
                    First date of the aggregation window, inclusive
                    (`YYYY-MM-DD`).


                    With `end`, the window is the half-open range `[start, end)`
                    and `interval` is ignored. Without `end`, the window spans
                    `interval` days starting on `start`.
                end:
                  type: string
                  format: date
                  description: >
                    End of the aggregation window, exclusive (`YYYY-MM-DD`).
                    Data for this date is not included; must be after `start`,
                    otherwise the request is rejected with a 400.


                    For a full calendar month use the first day of the next
                    month, e.g. `start=2026-08-01`, `end=2026-09-01`. Without
                    `start`, the window spans `interval` days ending the day
                    before `end`. If omitted entirely, the window ends at the
                    latest date for which data is available. If the day before
                    `end` has no data yet, the window ends at the latest
                    available date before it.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        data_id:
                          type: string
                          description: >-
                            The ID of the project depending on grouping this may
                            not be in the return.
                          example: usual
                        chain_id:
                          type: string
                          description: >-
                            The ID of the chain depending on grouping this may
                            not be in the return.
                          example: usual
                        product_id:
                          type: string
                          description: >-
                            The ID of the product depending on grouping this may
                            not be in the return.
                          example: usual
                        metrics:
                          type: object
                          additionalProperties:
                            type: object
                            properties:
                              avg:
                                type: number
                                description: Average value over the selected interval
                              change:
                                type: number
                                description: >-
                                  Percentage change over the selected interval.
                                  Most useful with static metrics such as
                                  averages and running totals.
                              sum:
                                type: number
                                description: >-
                                  Sum of values over the selected interval. Most
                                  useful for non-static or cumulative metrics
                                  where each day's values are unique.
                              trend:
                                type: number
                                description: >-
                                  Trend indicator value. Most useful for
                                  non-static or cumulative metrics where each
                                  day's values are unique.
                              latest:
                                type: number
                                description: >-
                                  Latest value for the metric. Most useful for
                                  static metrics such as averages and running
                                  totals.
                  errors:
                    type: array
                    description: >
                      Optional array of errors that occurred during request
                      processing. Only present if some requested entities were
                      not found.


                      The endpoint returns data for valid entities even when
                      errors are present, allowing partial success.
                    items:
                      type: object
                      required:
                        - code
                        - field
                        - value
                      properties:
                        code:
                          type: string
                          enum:
                            - NOT_FOUND
                          description: Error code indicating the entity was not found
                        field:
                          type: string
                          enum:
                            - project_ids
                            - metric_ids
                            - chain_ids
                            - product_ids
                            - market_sector_ids
                          description: >-
                            The request parameter field that contained the
                            invalid value
                        value:
                          type: string
                          description: The invalid ID value that was not found
                      example:
                        code: NOT_FOUND
                        field: project_ids
                        value: invalid-project
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: string

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.