Skip to main content
GET
/
runs
/
{runId}
/
records
JavaScript
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);
}
{
  "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
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

runId
string
required

The ID of the Run to list records for.

Example:

"135"

Query Parameters

limit
integer
default:20

Maximum number of items to return (1-100). Use with cursor for pagination through large sets.

Required range: x > 0
Example:

20

cursor
string

Cursor for pagination. Pass the nextCursor from the previous response to get the next page of results.

Example:

"123"

Response

Successfully retrieved list of Records with scores.

data
object[]
required
nextCursor
string | null
required
hasMore
boolean
required
total
integer
Required range: x >= 0
I