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

# List Records and Scores

> Retrieve a paginated list of Records for a Run, including all scores for each record.



## OpenAPI

````yaml get /runs/{runId}/records
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:
  /runs/{runId}/records:
    get:
      summary: List Records
      description: >-
        Retrieve a paginated list of Records for a Run, including all scores for
        each record.
      operationId: listRecords
      parameters:
        - in: path
          name: runId
          description: The ID of the Run to list records for.
          schema:
            type: string
            example: '135'
          required: true
        - in: query
          name: limit
          description: >-
            Maximum number of items to return (1-100). Use with `cursor` for
            pagination through large sets.
          schema:
            type: integer
            exclusiveMinimum: 0
            default: 20
            example: 20
        - in: query
          name: cursor
          description: >-
            Cursor for pagination. Pass the `nextCursor` from the previous
            response to get the next page of results.
          schema:
            type: string
            example: '123'
      responses:
        '200':
          description: Successfully retrieved list of Records with scores.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/RecordWithScores'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  hasMore:
                    type: boolean
                  total:
                    type: integer
                    minimum: 0
                required:
                  - data
                  - nextCursor
                  - hasMore
              examples:
                Records with scores:
                  value:
                    data:
                      - id: '456'
                        runId: '135'
                        testcaseId: '248'
                        inputs:
                          question: What is the capital of France?
                        expected:
                          idealAnswer: Paris is the capital of France
                        outputs:
                          response: The capital of France is Paris.
                        scores:
                          - recordId: '456'
                            metricConfigId: a1b2c3d4-e5f6-7890-1234-567890abcdef
                            score:
                              binaryScore: true
                              reasoning: >-
                                The response correctly identifies Paris as the
                                capital.
                          - recordId: '456'
                            metricConfigId: b2c3d4e5-f6a7-8901-2345-67890abcdef0
                            score:
                              intScore: 4
                              reasoning: Good answer but could be more detailed.
                      - id: '457'
                        runId: '135'
                        testcaseId: '249'
                        inputs:
                          question: What is the largest planet in our solar system?
                        expected:
                          idealAnswer: Jupiter
                        outputs:
                          response: Jupiter is the largest planet in our solar system.
                        scores:
                          - recordId: '457'
                            metricConfigId: a1b2c3d4-e5f6-7890-1234-567890abcdef
                            score:
                              binaryScore: true
                              reasoning: Correctly identified Jupiter.
                          - recordId: '457'
                            metricConfigId: b2c3d4e5-f6a7-8901-2345-67890abcdef0
                            score:
                              intScore: 5
                              reasoning: Perfect answer with good detail.
                    nextCursor: '458'
                    hasMore: true
                  summary: Records with scores
                  description: >-
                    Example response showing a paginated list of Records with
                    their associated scores and reasoning.
        '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: 'My API Key',
            });

            // Automatically fetches more pages as needed.
            for await (const recordListResponse of client.records.list('135')) {
              console.log(recordListResponse);
            }
        - lang: Python
          source: |-
            from scorecard_ai import Scorecard

            client = Scorecard(
                api_key="My API Key",
            )
            page = client.records.list(
                run_id="135",
            )
            page = page.data[0]
            print(page)
        - lang: cURL
          source: |-
            curl https://api2.scorecard.io/api/v2/runs/$RUN_ID/records \
                -H "Authorization: Bearer $SCORECARD_API_KEY"
components:
  schemas:
    RecordWithScores:
      allOf:
        - $ref: '#/components/schemas/Record'
      properties:
        scores:
          type: array
          items:
            $ref: '#/components/schemas/Score'
          description: All scores associated with this record.
      required:
        - scores
      description: A record with all its associated scores.
    Record:
      type: object
      properties:
        id:
          type: string
          description: The ID of the Record.
        runId:
          type: string
          description: The ID of the Run containing this Record.
        testcaseId:
          type: string
          description: The ID of the Testcase.
        inputs:
          type: object
          additionalProperties: true
          description: >-
            The actual inputs sent to the system, which should match the
            system's input schema.
        expected:
          type: object
          additionalProperties: true
          description: The expected outputs for the Testcase.
        outputs:
          type: object
          additionalProperties: true
          description: The actual outputs from the system.
      required:
        - id
        - runId
        - inputs
        - expected
        - outputs
      description: A record of a system execution in the Scorecard system.
    Score:
      type: object
      properties:
        recordId:
          type: string
          description: The ID of the Record this Score is for.
        metricConfigId:
          type: string
          format: uuid
          description: The ID of the MetricConfig this Score is for.
        score:
          type: object
          additionalProperties: true
          description: >-
            The score of the Record, as arbitrary JSON. This data should ideally
            conform to the output schema defined by the associated MetricConfig.
            If it doesn't, validation errors will be captured in the
            `validationErrors` field.
        validationErrors:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: JSON Pointer to the field with the validation error.
                example: /data/question
              message:
                type: string
                description: Human-readable error description.
                example: Required field missing
            required:
              - path
              - message
          description: >-
            Validation errors found in the Score data. If present, the Score
            doesn't fully conform to its MetricConfig's schema.
      required:
        - recordId
        - metricConfigId
        - score
      description: >-
        A Score represents the evaluation of a Record against a specific
        MetricConfig. The actual `score` is stored as flexible JSON. While any
        JSON is accepted, it is expected to conform to the output schema defined
        by the MetricConfig. Any discrepancies will be noted in the
        `validationErrors` field, but the Score will still be stored.
    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_

````