GET
/
v1
/
tests
/
batch
/
{batch_id}
JavaScript
import Semilattice from 'semilattice';

const client = new Semilattice({
  apiKey: 'My API Key',
});

const testBatch = await client.tests.getBatch('batch_id');

console.log(testBatch.data);
{
  "data": {
    "batch": {
      "id": "<string>",
      "batch_type": "prediction",
      "population": "<string>",
      "created_at": "2025-06-23T15:38:01Z",
      "data_source": "User onboarding flow",
      "description": "A copy testing benchmarking batch",
      "effective_date": "2024-01-09",
      "name": "Q4 user trends questions",
      "public": true,
      "simulation_engine": "answers-1",
      "status": "Tested",
      "test_finished_at": "2023-11-07T05:31:56Z",
      "test_started_at": "2023-11-07T05:31:56Z",
      "average_accuracy": 0.8528,
      "average_squared_error": 0.1607,
      "average_normalised_information_loss": 0.0063
    },
    "tests": [
      {
        "id": "b8b3e8cb-4c67-40d7-8350-3eac3c2b127d",
        "batch": "1e6bfe22-40d9-46c4-b241-9e1d7d5c5560",
        "created_at": "2025-06-23T15:40:52Z",
        "test_started_at": "2025-06-23T15:44:10Z",
        "test_finished_at": "2025-06-23T15:45:30Z",
        "ground_answer_counts": {
          "Tech debt": 58,
          "Unclear error messages": 42
        },
        "ground_answer_percentages": {
          "Tech debt": 0.58,
          "Unclear error messages": 0.42
        },
        "population": "af8917b4-a09c-41f9-9c9f-c4c40c1f7415",
        "simulation_engine": "answers-1",
        "status": "Predicted",
        "public": false,
        "answer_options": [
          "Tech debt",
          "Unclear error messages"
        ],
        "population_name": "Developers",
        "question": "Tech debt or unclear error messages, what's worse?",
        "question_options": {
          "question_type": "single-choice"
        },
        "accuracy": 0.8528,
        "squared_error": 0.1607,
        "root_mean_squared_error": 0.1607,
        "simulated_answer_percentages": {
          "Tech debt": 0.5488,
          "Unclear error messages": 0.4512
        },
        "predicted_answer_percentages": {
          "Tech debt": 0.5488,
          "Unclear error messages": 0.4512
        },
        "information_loss": 0.0043,
        "normalised_information_loss": 0.051
      }
    ]
  },
  "errors": [
    {
      "code": "<string>",
      "message": "<string>"
    }
  ]
}

Headers

authorization
string

Path Parameters

batch_id
string
required

ID of the test prediction batch you want to fethc.

Response

Successful Response

data
object | null

The primary response payload. Contains the result of the request if successful.

errors
ErrorResponse · object[] | null

List of structured error messages, if any occurred during the request.