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

# Get Metric Group

> Retrieve a specific Metric Group by ID.



## OpenAPI

````yaml get /metric-groups/{metricGroupId}
openapi: 3.1.0
info:
  title: Scorecard API
  description: REST API for Scorecard
  version: 1.0.0
servers:
  - url: https://api2.scorecard.io/api/v2
security:
  - ApiKeyAuth: []
paths:
  /metric-groups/{metricGroupId}:
    get:
      summary: Get Metric Group
      description: Retrieve a specific Metric Group by ID.
      operationId: getMetricGroup
      parameters:
        - in: path
          name: metricGroupId
          description: The ID of the Metric Group to retrieve.
          schema:
            type: string
            example: '612'
          required: true
      responses:
        '200':
          description: Successfully retrieved the Metric Group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricGroup'
              examples:
                Metric Group:
                  value:
                    id: '612'
                    projectId: '314'
                    name: Accuracy Metrics
                    description: Metrics that evaluate factual accuracy
                    metricIds:
                      - '321'
                      - '322'
                    createdAt: '2025-01-15T09:30:00.000Z'
                    updatedAt: '2025-01-15T09:30:00.000Z'
                  summary: Metric Group
                  description: A metric group with its member metrics.
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '500':
          $ref: '#/components/responses/ServiceError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Scorecard from 'scorecard-ai';

            const client = new Scorecard({
              apiKey: process.env['SCORECARD_API_KEY'], // This is the default and can be omitted
            });

            const metricGroup = await client.metricGroups.get('612');

            console.log(metricGroup.id);
        - lang: Python
          source: |-
            import os
            from scorecard_ai import Scorecard

            client = Scorecard(
                api_key=os.environ.get("SCORECARD_API_KEY"),  # This is the default and can be omitted
            )
            metric_group = client.metric_groups.get(
                "612",
            )
            print(metric_group.id)
        - lang: cURL
          source: >-
            curl https://api2.scorecard.io/api/v2/metric-groups/$METRIC_GROUP_ID
            \
                -H "Authorization: Bearer $SCORECARD_API_KEY"
components:
  schemas:
    MetricGroup:
      type: object
      properties:
        id:
          type: string
          description: The ID of the Metric Group.
        projectId:
          type: string
          description: The ID of the Project the Metric Group belongs to.
        name:
          type: string
          description: The name of the Metric Group.
        description:
          type: string
          description: The description of the Metric Group.
        metricIds:
          type: array
          items:
            type: string
          description: The IDs of the Metrics in the group.
        createdAt:
          type: string
          description: The ISO 8601 timestamp when the Metric Group was created.
        updatedAt:
          type: string
          description: The ISO 8601 timestamp when the Metric Group was last updated.
      required:
        - id
        - projectId
        - name
        - description
        - metricIds
        - createdAt
        - updatedAt
      description: >-
        A Metric Group is a named collection of Metrics within a Project, used
        to score or compare records with a consistent set of Metrics.
    ApiError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
          x-stainless-any: true
      required:
        - code
        - message
        - details
      description: An API error.
  responses:
    UnauthenticatedError:
      description: Error indicating that the request is not authenticated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            Authentication failure:
              value:
                code: UNAUTHORIZED
                message: Invalid or missing authentication token
                details: {}
              summary: Authentication failure
              description: >-
                Error returned when authentication credentials are invalid or
                missing.
    ServiceError:
      description: >-
        An internal service error indicating an issue with the Scorecard
        service.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            Internal error:
              value:
                code: INTERNAL_ERROR
                message: An unexpected error occurred while processing your request.
                details: {}
              summary: Internal error
              description: Generic error when an unexpected internal issue occurs.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: starts with ak_

````