Skip to content

GetPlayerSuperCoachPointsPredictions API

Overview

The GetPlayerSuperCoachPointsPredictions API returns SuperCoach points predictions for the players in a single match. Predictions are keyed by player and returned as a flat map of player to predicted points.

Query: PlayerSuperCoachPointsPredictionsQuery Handler: PlayerSuperCoachPointsPredictionsQueryHandler Response: PlayerSuperCoachPointsPredictionContract File: src/Integration/LBS.Sport.Integration/Queries/PlayerSuperCoachPointsPredictionsQuery.cs

Endpoint

POST /api/readmodel

Authentication

This query is secured with [RequiresRoles(RoleDefinition.Member)]. The caller must be authenticated and hold the Member role.

Request Format

The query carries a single required field, MatchId. There are no filter, ordering, or pagination inputs.

{
  "query": {
    "queryType": "GetPlayerSuperCoachPointsPredictions",
    "matchId": "match-123"
  }
}

Query Parameters

Parameter Type Required Description
queryType string Yes Must be "GetPlayerSuperCoachPointsPredictions"
matchId string Yes The fixture/match ID to get predictions for

Response Format

The handler returns a single PlayerSuperCoachPointsPredictionContract (DataContract name PlayerSuperCoachPointsPrediction). Its only field, predictions, is a map of player identifier to predicted SuperCoach points.

{
  "predictions": {
    "player-456": 85.5,
    "player-789": 62.0
  }
}

Response Fields

Field Type Description
predictions object (map of string to double) Predicted SuperCoach points keyed by player identifier. Empty if no predictions are available for the match.

Example Usage

curl -X POST "https://api.ballr.live/api/readmodel" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "query": {
      "queryType": "GetPlayerSuperCoachPointsPredictions",
      "matchId": "match-123"
    }
  }'

TypeScript SDK

The query is exposed from the core module of @luckboxstudios/foundry-sdk.

Import Type Purpose
@luckboxstudios/foundry-sdk GetPlayerSuperCoachPointsPredictions Query input interface
@luckboxstudios/foundry-sdk PlayerSuperCoachPointsPrediction Response interface (predictions: Record<string, number>)
@luckboxstudios/foundry-sdk/core coreQueries.getPlayerSuperCoachPointsPredictions(...) Builder function (sets queryType automatically)
import type {
  GetPlayerSuperCoachPointsPredictions,
  PlayerSuperCoachPointsPrediction
} from '@luckboxstudios/foundry-sdk';
import { coreQueries } from '@luckboxstudios/foundry-sdk/core';

const query = coreQueries.getPlayerSuperCoachPointsPredictions({
  matchId: 'match-123'
});

const response = await client.query<
  GetPlayerSuperCoachPointsPredictions,
  PlayerSuperCoachPointsPrediction
>(query);

How It Works

  1. The handler validates that MatchId is present; if it is missing or blank it returns an empty result.
  2. The fixture mapping (MappedFixture) is loaded and the supplied MatchId (matched against FoxMatchId) is resolved to a FixtureId.
  3. If a FixtureId is found, predictions are fetched from the SuperCoach model API (FixturePredictions.GetPlayerSuperCoachPointsPredictions). The model API base URL comes from configuration key Modelling:SupercoachModelApi, defaulting to https://api.supercoach.com.au/.
  4. The resulting Dictionary<string, double> is wrapped in a single PlayerSuperCoachPointsPredictionContract and returned. If no fixture mapping or predictions are found, an empty result is returned.

Caching

The query implements ISecureCacheableQuery, so results are cached automatically by the query infrastructure:

  • Cache key: nrlPredictions_{matchId}
  • Duration: 1 minute
  • Tags: supercoach, predictions, match-{matchId}

Module

The handler requires the SuperCoach module ([RequiresModule(ModuleDefinition.SuperCoach)]).

See Also