Records
List Records and Scores
Retrieve a paginated list of Records for a Run, including all scores for each record.
GET
/
runs
/
{runId}
/
records
JavaScript
import Scorecard from 'scorecard-ai';
const client = new Scorecard({
apiKey: process.env['SCORECARD_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const recordListResponse of client.records.list('135')) {
console.log(recordListResponse);
}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
)
page = client.records.list(
run_id="135",
)
page = page.data[0]
print(page)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api2.scorecard.io/api/v2/runs/{runId}/records"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl https://api2.scorecard.io/api/v2/runs/$RUN_ID/records \
-H "Authorization: Bearer $SCORECARD_API_KEY"{
"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
}{
"code": "UNAUTHORIZED",
"message": "Invalid or missing authentication token",
"details": {}
}{
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred while processing your request.",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the Run to list records for.
Example:
"135"
Query Parameters
Maximum number of items to return (1-100). Use with cursor for pagination through large sets.
Example:
20
Cursor for pagination. Pass the nextCursor from the previous response to get the next page of results.
Example:
"123"
Filter to records carrying every listed tag (repeatable, AND semantics). E.g. ?tags=urgent&tags=regression.
Maximum array length:
50Minimum string length:
1Was this page helpful?
⌘I
JavaScript
import Scorecard from 'scorecard-ai';
const client = new Scorecard({
apiKey: process.env['SCORECARD_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const recordListResponse of client.records.list('135')) {
console.log(recordListResponse);
}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
)
page = client.records.list(
run_id="135",
)
page = page.data[0]
print(page)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api2.scorecard.io/api/v2/runs/{runId}/records"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl https://api2.scorecard.io/api/v2/runs/$RUN_ID/records \
-H "Authorization: Bearer $SCORECARD_API_KEY"{
"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
}{
"code": "UNAUTHORIZED",
"message": "Invalid or missing authentication token",
"details": {}
}{
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred while processing your request.",
"details": {}
}