> ## 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.

# 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
                - interval
                - 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: Time interval for aggregation
                  enum:
                    - 24h
                    - 7d
                    - 30d
                    - 90d
                    - 180d
                    - 365d
                    - 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: Start date for the query
                end:
                  type: string
                  format: date
                  description: End date for the query
      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

````