Football Operations

The Football Operations provides comprehensive access to football data including teams, players, matches, and competitions through the sdk.football()

Team Operations

Top Teams

suspend fun getTopTeams(disableCache: Boolean? = null): List<TeamBasicModel>

Returns list of top teams across all competitions.

Team Details

suspend fun getTeamById(id: String, disableCache: Boolean? = null): TeamFullModel

Retrieves detailed team information.

Team Form

suspend fun getTeamForm(
    teamId: String,
    filters: TeamFormFilters? = null,
    disableCache: Boolean? = null
): TeamFormModel

Gets team's recent performance data.

Team Matches

// Next match
suspend fun getNextMatchForTeam(id: String, disableCache: Boolean? = null): MatchFullModel

// Previous match
suspend fun getPrevMatchForTeam(id: String, disableCache: Boolean? = null): MatchFullModel

Team Collection

suspend fun getTeams(
    filters: TeamFilters? = null,
    disableCache: Boolean? = null
): PagedResponse<List<TeamBasicModel>>?

Retrieves filtered list of teams with pagination.

Player Operations

Top Players

suspend fun getTopPlayers(disableCache: Boolean? = null): List<PlayerBasicModel>

Returns list of top players across competitions.

Player Details

suspend fun getPlayerById(id: String, disableCache: Boolean? = null): PlayerFullModel

Player Matches

// Next match
suspend fun getNextMatchForPlayer(id: String, disableCache: Boolean? = null): MatchFullModel

// Previous match
suspend fun getPrevMatchForPlayer(id: String, disableCache: Boolean? = null): MatchFullModel

Player Collection

suspend fun getPlayers(
    filters: PlayerFilters? = null,
    disableCache: Boolean? = null
): PagedResponse<List<PlayerBasicModel>>?

Match Operations

Match Details

suspend fun getMatchById(id: String, disableCache: Boolean? = null): MatchFullModel

Match Collection

suspend fun getMatches(
    filters: MatchFilters? = null,
    disableCache: Boolean? = null
): PagedResponse<List<MatchBasicModel>>?

Retrieves filtered matches with pagination.

Competition Operations

Top Competitions

suspend fun getTopCompetitions(disableCache: Boolean? = null): List<CompetitionBasicModel>

Competition Details

suspend fun getCompetitionById(id: String, disableCache: Boolean? = null): CompetitionFullModel

Competition Collection

suspend fun getCompetitions(
    filters: CompetitionFilters? = null,
    disableCache: Boolean? = null
): List<CompetitionBasicModel>

Search Operations

suspend fun search(
    filters: SearchFilters,
    disableCache: Boolean? = null
): SearchResult

Searches across football entities (players, teams, competitions).

Country Operations

suspend fun getCountries(disableCache: Boolean? = null): List<FootballCountryModel>

Returns available countries.

Example Usage

// Get team details
val team = sdk.football().getTeamById("team:123")

// Search players
val players = sdk.football().getPlayers(
    filters = PlayerFilters(
        competitionId = "comp:456",
        teamId = "team:123"
    )
)

// Get upcoming matches
val matches = sdk.football().getMatches(
    filters = MatchFilters(
        fromDate = "2024-03-20",
        toDate = "2024-03-27"
    )
)

// Search across entities
val searchResults = sdk.football().search(
    filters = SearchFilters(
        entities = listOf(SearchEntity.TEAM, SearchEntity.PLAYER),
        query = "Manchester"
    )
)

Note: All football operations are suspending functions and must be called from a coroutine scope. Use disableCache parameter to bypass caching when needed.