sofascore_wrapper package

Submodules

sofascore_wrapper.american_football module

class sofascore_wrapper.american_football.AmericanFootball(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async best_player_of_playoffs(team_id, tournament_id, season_id)[source]

Retrieves the best players for the selected team, tournament and season.

Parameters:
  • tournament_id (int) – The ID of the tournament id.

  • team_id (int)

  • season_id (int)

Return type:

Dict[str, int]

async categories()[source]

Retrieves all the american football categories such as NFL europa and USA.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async matches_by_date(sport='american-football', date=None)[source]

Retrieves scheduled fixtures for a given sport on a specific date.

Parameters:
  • sport (str) – The sport for which to retrieve fixtures. Available options include: - “football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker” - “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “esports”, “handball” - “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton” - “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

  • date (str, optional) – The date in “YYYY-MM-DD” format. If not provided, the current date is used.

Returns:

A dictionary containing fixture details for the specified sport and date, including match details, teams, venue, and start time.

Return type:

Dict[str, Any]

Raises:

ValueError – If the provided sport is not in the list of supported sports.

async player_stats(player_id, league_id, season_id)[source]

Retrieves a player’s statistics for a specific league and season.

Parameters:
  • player_id (int) – The ID of the player.

  • league_id (int) – The ID of the league (unique tournament).

  • season_id (int) – (int): the ID of the season.

Returns:

A dictionary containing the player’s season statistics, including points, rebounds, assists, and more.

Return type:

Dict[str, Any]

async round_highlights(country_code, tournament_id, season_id, round)[source]

Retrieves highlights for the given round.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • country_code (str)

  • tournament_id (int)

  • season_id (int)

  • round (int)

async season_games(tournament_id, season_id)[source]

Retrieves all matches for the selected tournament and season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async standings(tournament_id, season_id)[source]

Retrieves the current standings for the tournament and season. :returns: A dictionary containing two keys: :rtype: Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

Return type:

Dict[str, int]

async team_near_games(team_id)[source]

Retrieves the nearest games for the selected team.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

team_id (int)

async team_player_stats(team_id, league_id, season_id)[source]

Retrieves a team’s best players for a given season. :param team_id: The ID of the tea,. :type team_id: int :param league_id: The ID of the league (unique tournament). :type league_id: int :param season_id: The ID of the season. :type season_id: int

Returns:

A dictionary containing the team’s best players stats.

Return type:

Dict[str, Any]

Parameters:
  • team_id (int)

  • league_id (int)

  • season_id (int)

async team_seasons(team_id)[source]

Retrieves the seasons for a given american football team.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

team_id (int)

async total_matches()[source]

Retrieves the total count of today’s e-sport matches and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live e-sport matches.

  • ”total”: The total number of e-sport matches scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 8, “total”: 16

}

async tournament_info(tournament_id, season_id)[source]

Retrieves the tournament info.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async tournaments(category_id)[source]

Retrieves all tournaments for a selected esports category i.e NFL PRE SEASON.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

category_id (int)

sofascore_wrapper.api module

class sofascore_wrapper.api.SofascoreAPI(headers=None)[source]

Bases: object

Parameters:

headers (dict)

async close()[source]

sofascore_wrapper.baseball module

class sofascore_wrapper.baseball.Baseball(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async all_tournaments(country_code='GB')[source]

Retrieves all the baseball tournaments

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

country_code (str)

async categories()[source]

Retrieves all the tennis categories such as the countries.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async matches_by_date(sport='baseball', date=None)[source]

Retrieves scheduled fixtures for a given sport on a specific date.

Parameters:
  • sport (str) – The sport for which to retrieve fixtures. Available options include: - “football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker” - “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “esports”, “handball” - “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton” - “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

  • date (str, optional) – The date in “YYYY-MM-DD” format. If not provided, the current date is used.

Returns:

A dictionary containing fixture details for the specified sport and date, including match details, teams, venue, and start time.

Return type:

Dict[str, Any]

Raises:

ValueError – If the provided sport is not in the list of supported sports.

async player_last_year_summary(player_id)[source]

Retrieves the players last year summary

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

player_id (int)

async player_stats(player_id, league_id, season_id)[source]

Retrieves a player’s statistics for a specific league and season.

Parameters:
  • player_id (int) – The ID of the player.

  • league_id (int) – The ID of the league (unique tournament).

  • season_id (int) – The ID of the season.

Returns:

A dictionary containing the player’s season statistics, including points, rebounds, assists, and more.

Return type:

Dict[str, Any]

async season_games(tournament_id, season_id)[source]

Retrieves all matches for the selected tournament and season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async team_seasons(team_id)[source]

Retrieves a team’s seasons

Parameters:

team_id (int) – The Id of the team.

Return type:

Dict[str, Any]

async total_matches()[source]

Retrieves the total count of today’s baseball matches and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live baseball matches.

  • ”total”: The total number of basebally matches scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 8, “total”: 16

}

sofascore_wrapper.basketball module

class sofascore_wrapper.basketball.Basketball(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async games_by_date(sport='basketball', date=None)[source]

Retrieves the fixtures for today or a specific date.

Parameters:
  • sport (str) – The sport of which you wish to gain fixtures for. Check below for appropriate sport names.

  • date (str, optional) – The date in the format “YYYY-MM-DD”. If not provided, today’s date is used.

Return type:

Dict[str, Any]

Arg sport (str, Any):
[

“football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker”, “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “e-sports”, “handball”, “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton”, “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

]

}

Returns:

A dictionary containing the fixtures for the specified date, including match details, teams, and timings.

Return type:

Dict[str, Any]

Parameters:
  • sport (str)

  • date (str | None)

Example Response:

{
“events”: [
{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “customId”: “HsR”, “status”: {

“code”: 0, “description”: “Not started”, “type”: “notstarted”

}, “winnerCode”: 0, “homeTeam”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “awayTeam”: {

“name”: “Liverpool”, “slug”: “liverpool”, “shortName”: “Liverpool”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2572976, “nameCode”: “LIV”, “disabled”: false, “national”: false, “type”: 0, “id”: 44, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ليفربول”, “ru”: “Ливерпуль”, “hi”: “लिवरपूल”, “bn”: “লিভারপুল”

}, “shortNameTranslation”: {

“ar”: “ليفربول”, “hi”: “लिवरपूल”, “bn”: “লিভারপুল”

}

}

}, “homeScore”: {

“current”: 0, “display”: 0, “period1”: 0, “period2”: 0, “normaltime”: 0

}, “awayScore”: {

“current”: 0, “display”: 0, “period1”: 0, “period2”: 0, “normaltime”: 0

}, “time”: {

“injuryTime1”: 0, “injuryTime2”: 0, “currentPeriodStartTimestamp”: 0

}, “changes”: {

“changes”: [], “changeTimestamp”: 0

}, “hasGlobalHighlights”: false, “hasXg”: false, “hasEventPlayerStatistics”: false, “hasEventPlayerHeatMap”: false, “detailId”: 1, “crowdsourcingDataDisplayEnabled”: false, “id”: 12436472, “startTimestamp”: 1735330500, “slug”: “arsenal-liverpool”, “finalResultOnly”: false, “feedLocked”: false, “isEditor”: false

}

]

}

async live_games()[source]

Retrieves all currently live basketball games.

Returns:

A dictionary containing a list of live basketball games under the key “events”.

Each game is represented as a dictionary with details such as tournament, teams, scores, and match status.

Return type:

Dict[str, List[Dict[str, Any]]]

Example Response:

{
“events”: [
{
“tournament”: {

“name”: “U20 CONMEBOL Championship, Group B”, “slug”: “u20-conmebol-championship-group-b”, “category”: {

“name”: “South America”, “slug”: “south-america”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1470, “flag”: “south-america”

}, “uniqueTournament”: {

“name”: “U20 CONMEBOL Championship”, “slug”: “u20-conmebol-championship”, “primaryColorHex”: “#348925”, “secondaryColorHex”: “#afc402”, “category”: {

“name”: “South America”, “slug”: “south-america”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1470, “flag”: “south-america”

}, “userCount”: 11952, “id”: 632, “hasPerformanceGraphFeature”: false, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 0, “isGroup”: true, “groupName”: “Group B”, “isLive”: false, “id”: 10066

}, “season”: {

“name”: “U20 CONMEBOL Ch.ship 2025”, “year”: “2025”, “editor”: false, “id”: 68914

}, “roundInfo”: {

“round”: 4

}, “customId”: “xdjsiAn”, “status”: {

“code”: 6, “description”: “1st half”, “type”: “inprogress”

}, “homeTeam”: {

“name”: “Ecuador U20”, “slug”: “ecuador-u20”, “shortName”: “Ecuador U20”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 4401, “nameCode”: “ECU”, “disabled”: false, “national”: true, “type”: 0, “id”: 33758, “country”: {

“alpha2”: “EC”, “alpha3”: “ECU”, “name”: “Ecuador”, “slug”: “ecuador”

}, “entityType”: “team”, “teamColors”: {

“primary”: “#ffff00”, “secondary”: “#000063”, “text”: “#000063”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الإكوادور تحت 20”, “ru”: “Эквадор U20”

}

}

}, “awayTeam”: {

“name”: “Brazil U20”, “slug”: “brazil-u20”, “shortName”: “Brazil U20”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 39092, “nameCode”: “BRA”, “disabled”: false, “national”: true, “type”: 0, “id”: 22672, “country”: {

“alpha2”: “BR”, “alpha3”: “BRA”, “name”: “Brazil”, “slug”: “brazil”

}, “entityType”: “team”, “teamColors”: {

“primary”: “#ffff00”, “secondary”: “#009933”, “text”: “#009933”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “البرازيل تحت 20”, “ru”: “Бразилия U20”

}

}

}, “homeScore”: {

“current”: 0, “display”: 0, “period1”: 0, “normaltime”: 0

}, “awayScore”: {

“current”: 0, “display”: 0, “period1”: 0, “normaltime”: 0

}, “time”: {

“initial”: 0, “max”: 2700, “extra”: 540, “currentPeriodStartTimestamp”: 1738279810

}, “changes”: {

“changes”: [

“homeScore.period1”, “homeScore.normaltime”, “awayScore.period1”, “awayScore.normaltime”

], “changeTimestamp”: 1738279909

}, “hasGlobalHighlights”: false, “hasEventPlayerStatistics”: true, “hasEventPlayerHeatMap”: true, “detailId”: 1, “crowdsourcingDataDisplayEnabled”: false, “id”: 13123315, “statusTime”: {

“prefix”: “”, “initial”: 0, “max”: 2700, “timestamp”: 1738279810, “extra”: 540

}, “startTimestamp”: 1738279800, “slug”: “ecuador-u20-brazil-u20”, “lastPeriod”: “period1”, “finalResultOnly”: false, “feedLocked”: true, “isEditor”: false

}

]

}

async player_ratings(player_id, league_id, season_id)[source]

Retrieves a player’s ratings for a specific league and season.

Parameters:
  • player_id (int) – The ID of the player.

  • league_id (int) – The ID of the league (unique tournament).

  • season_id (int) – The ID of the season.

Returns:

A dictionary containing the player’s ratings.

Return type:

Dict[str, int]

Example Response:
{
    "seasonRatings": [
        {
            "eventId": 12696938,
            "event": {
                "homeTeam": {
                    "name": "Milwaukee Bucks",
                    "id": 3410
                },
                "awayTeam": {
                    "name": "Memphis Grizzlies",
                    "id": 3415
                },
                "homeScore": {
                    "current": 119
                },
                "awayScore": {
                    "current": 132
                },
                "status": {
                    "description": "Ended"
                }
            },
            "rating": 7.9,
            "opponent": {
                "name": "Memphis Grizzlies",
                "id": 3415
            },
            "isHome": true
        }
    ]
}
Example Usage:
ratings = await api.player_ratings(player_id=123, league_id=132, season_id=2024)
print(ratings["seasonRatings"][0]["rating"])  # Output: 7.9
async player_seasons(player_id)[source]

Retrieves a player’s seasons and the leagues they participated in.

Parameters:

player_id (int) – The ID of the player.

Returns:

A dictionary containing the player’s seasons and league details.

Return type:

Dict[str, Any]

Example Response:
{
    "uniqueTournamentSeasons": [
        {
            "uniqueTournament": {
                "name": "NBA",
                "slug": "nba",
                "primaryColorHex": "#045daf",
                "secondaryColorHex": "#cc2b31",
                "category": {
                    "name": "USA",
                    "slug": "usa",
                    "sport": {
                        "name": "Basketball",
                        "slug": "basketball",
                        "id": 2
                    },
                    "id": 15,
                    "flag": "usa",
                    "alpha2": "US"
                },
                "userCount": 241408,
                "id": 132,
                "displayInverseHomeAwayTeams": true
            },
            "seasons": [
                {
                    "name": "NBA 24/25",
                    "year": "24/25",
                    "editor": false,
                    "id": 65360
                }
            ]
        }
    ]
}
Example Usage:
seasons = await api.player_seasons(player_id=123)
print(seasons["uniqueTournamentSeasons"][0]["uniqueTournament"]["name"])  # Output: "NBA"
async player_stats(player_id, league_id)[source]

Retrieves a player’s statistics for a specific league and season.

Parameters:
  • player_id (int) – The ID of the player.

  • league_id (int) – The ID of the league (unique tournament).

Returns:

A dictionary containing the player’s season statistics, including points, rebounds, assists, and more.

Return type:

Dict[str, Any]

Example Response:
{
    "seasons": [
        {
            "statistics": {
                "points": 1302,
                "rebounds": 499,
                "assists": 241,
                "blocks": 54,
                "steals": 31,
                "rating": 8.3,
                "appearances": 41
            },
            "team": {
                "name": "Milwaukee Bucks",
                "slug": "milwaukee-bucks",
                "shortName": "Bucks",
                "id": 3410
            },
            "season": {
                "name": "NBA 24/25",
                "year": "24/25",
                "id": 65360
            }
        }
    ]
}
Example Usage:
stats = await api.player_stats(player_id=123, league_id=132)
print(stats["seasons"][0]["statistics"]["points"])  # Output: 1302
async top_players_per_game(league_id, season_id)[source]

Retrieves the top players’ statistics per game for a specific league and season.

Parameters:
  • league_id (int) – The ID of the league (unique tournament).

  • season_id (int) – The ID of the season.

Returns:

A dictionary containing top players’ statistics per game, including points, rebounds, assists, and more.

Return type:

Dict[str, Any]

Example Response:
{
    "topPlayers": {
        "points": [
            {
                "statistic": 60,
                "player": {
                    "name": "De'Aaron Fox",
                    "shortName": "D. Fox",
                    "position": "G",
                    "id": 885244
                },
                "event": {
                    "tournament": {
                        "name": "NBA",
                        "id": 177
                    },
                    "homeTeam": {
                        "name": "Sacramento Kings",
                        "id": 3413
                    },
                    "awayTeam": {
                        "name": "Minnesota Timberwolves",
                        "id": 3426
                    },
                    "homeScore": {
                        "current": 126
                    },
                    "awayScore": {
                        "current": 130
                    },
                    "id": 12687000
                }
            }
        ]
    }
}
Example Usage:
stats = await api.top_players_per_game(league_id=132, season_id=65360)
print(stats["topPlayers"]["points"][0]["player"]["name"])  # Output: De'Aaron Fox
async top_players_per_season(league_id, season_id)[source]

Retrieves the top players’ statistics per game for a specific league and season.

Parameters:
  • league_id (int) – The ID of the league (unique tournament).

  • season_id (int) – The ID of the season.

Returns:

A dictionary containing top players’ statistics per game, including points, rebounds, assists, and more.

Return type:

Dict[str, Any]

Example Response:
{
    "topPlayers": {
        "points": [
            {
                "statistic": 60,
                "player": {
                    "name": "De'Aaron Fox",
                    "shortName": "D. Fox",
                    "position": "G",
                    "id": 885244
                },
                "event": {
                    "tournament": {
                        "name": "NBA",
                        "id": 177
                    },
                    "homeTeam": {
                        "name": "Sacramento Kings",
                        "id": 3413
                    },
                    "awayTeam": {
                        "name": "Minnesota Timberwolves",
                        "id": 3426
                    },
                    "homeScore": {
                        "current": 126
                    },
                    "awayScore": {
                        "current": 130
                    },
                    "id": 12687000
                }
            }
        ]
    }
}
Example Usage:
stats = await api.top_players_per_game(league_id=132, season_id=65360)
print(stats["topPlayers"]["points"][0]["player"]["name"])  # Output: De'Aaron Fox
async top_teams_per_season(league_id, season_id)[source]

Retrieves the top teams’ statistics per game for a specific league and season.

Parameters:
  • league_id (int) – The ID of the league (unique tournament).

  • season_id (int) – The ID of the season.

Returns:

A dictionary containing top teams’ statistics per game, including points, rebounds, assists, and more.

Return type:

Dict[str, Any]

Example Response:
{
    "topTeams": {
        "points": [
            {
                "team": {
                    "name": "Memphis Grizzlies",
                    "slug": "memphis-grizzlies",
                    "shortName": "Memphis Grizzlies",
                    "gender": "M",
                    "userCount": 51009,
                    "national": false,
                    "type": 0,
                    "id": 3415,
                    "entityType": "team",
                    "teamColors": {
                        "primary": "#374df5",
                        "secondary": "#374df5",
                        "text": "#ffffff"
                    },
                    "fieldTranslations": {
                        "nameTranslation": {
                            "ar": "ممفيس جريزليز",
                            "ru": "Мемфис Гриззлис",
                            "hi": "मेम्फिस ग्रिजलीज़",
                            "bn": "মেমফিস গ্রিজলিস"
                        },
                        "shortNameTranslation": {
                            "ar": "جريزليس",
                            "hi": "ग्रिज़लीज़",
                            "bn": "গ্রিজলিস"
                        }
                    }
                },
                "statistics": {
                    "points": 6046,
                    "id": 3834,
                    "matches": 49,
                    "awardedMatches": 0
                }
            }
        ]
    }
}
Example Usage:
stats = await api.top_teams_per_season(league_id=132, season_id=65360)
print(stats["topTeams"]["points"][0]["team"]["name"])  # Output: Memphis Grizzlies
async total_games()[source]

Retrieves the total count of today’s basketball games and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live basketball games.

  • ”total”: The total number of basketball games scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 21, “total”: 270

}

sofascore_wrapper.cricket module

class sofascore_wrapper.cricket.Cricket(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async all_tournaments(country_code='GB')[source]

Retrieves all the cricket tournaments

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

country_code (str)

async categories()[source]

Retrieves all the cricket categories such as the countries.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async match_innings(match_id)[source]

Retrieves the current innings for the given game.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async matches_by_date(sport='cricket', date=None)[source]

Retrieves scheduled fixtures for a given sport on a specific date.

Parameters:
  • sport (str) – The sport for which to retrieve fixtures. Available options include: - “football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker” - “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “esports”, “handball” - “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton” - “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

  • date (str, optional) – The date in “YYYY-MM-DD” format. If not provided, the current date is used.

Returns:

A dictionary containing fixture details for the specified sport and date, including match details, teams, venue, and start time.

Return type:

Dict[str, Any]

Raises:

ValueError – If the provided sport is not in the list of supported sports.

async season_games(tournament_id, season_id)[source]

Retrieves all matches for the selected tournament and season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async total_matches()[source]

Retrieves the total count of today’s cricket matches and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live cricket matches.

  • ”total”: The total number of cricket matches scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 8, “total”: 16

}

sofascore_wrapper.esports module

class sofascore_wrapper.esports.Esports(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async all_tournaments(country_code='GB')[source]

Retrieves all the e-sport tournaments

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

country_code (str)

async categories()[source]

Retrieves all the esports categories such as LoL, Counter-Strike.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async featured_matches(tournament_id)[source]

Retrieves the tournament current featured matches.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

tournament_id (int)

async get_match(match_id)[source]

Retrieves match info.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async get_tournament(tournament_id)[source]

Retrieves the tournament.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

tournament_id (int)

async highlights(match_id)[source]

Retrieves the match highlights.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async last_tournament_matches(tournament_id, season_id)[source]

Retrieves the last matches for the selected tournament and season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async lineups(match_id)[source]

Retrieves match lineups

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async live_matches()[source]

Retrieve all currently live e-sport events.

Returns:

A dictionary containing a list of live esport events under the key “events”. Each event is represented as a dictionary with details such as tournament, teams, scores, and match status.

Return type:

Dict[str, List[Dict[str, Any]]]

async match_rounds(match_id)[source]

Retrieves further match info which cannot be pulled from match.get_match()

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async matches_by_date(sport='esports', date=None)[source]

Retrieves scheduled fixtures for a given sport on a specific date.

Parameters:
  • sport (str) – The sport for which to retrieve fixtures. Available options include: - “football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker” - “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “esports”, “handball” - “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton” - “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

  • date (str, optional) – The date in “YYYY-MM-DD” format. If not provided, the current date is used.

Returns:

A dictionary containing fixture details for the specified sport and date, including match details, teams, venue, and start time.

Return type:

Dict[str, Any]

Raises:

ValueError – If the provided sport is not in the list of supported sports.

async next_tournament_matches(tournament_id, season_id)[source]

Retrieves the next matches for the selected tournament and season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async team_streaks(match_id)[source]

Retrieves team streaks for the selected match.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async total_matches()[source]

Retrieves the total count of today’s e-sport matches and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live e-sport matches.

  • ”total”: The total number of e-sport matches scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 8, “total”: 16

}

async tournament_cuptree(tournament_id, season_id)[source]

Retrieves the tournament current cup tree for the selected season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async tournament_info(tournament_id, season_id)[source]

Retrieves the tournament info.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async tournament_matches(tournament_id, season_id)[source]

Retrieves all matches for the selected tournament and season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async tournament_media(tournament_id)[source]

Retrieves the tournament media such as highlights and streams.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

tournament_id (int)

async tournament_seasons(tournament_id)[source]

Retrieves the tournament seasons.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

tournament_id (int)

async tournaments(category_id)[source]

Retrieves all tournaments for a selected esports category i.e counter strike.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

category_id (int)

sofascore_wrapper.flag module

class sofascore_wrapper.flag.Flag(api, flag_code)[source]

Bases: object

Parameters:
async image()[source]

Retrieves the URL of the flag image for the specified country code.

Returns:

The URL of the flag image.

Return type:

str

Example Response:

https://www.sofascore.com/static/images/flags/gb.png

sofascore_wrapper.ice_hockey module

class sofascore_wrapper.ice_hockey.Tennis(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async all_tournaments(country_code='GB')[source]

Retrieves all the ice hockey tournaments

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

country_code (str)

async categories()[source]

Retrieves all the tennis categories such as the countries.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async matches_by_date(sport='ice-hockey', date=None)[source]

Retrieves scheduled fixtures for a given sport on a specific date.

Parameters:
  • sport (str) – The sport for which to retrieve fixtures. Available options include: - “football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker” - “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “esports”, “handball” - “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton” - “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

  • date (str, optional) – The date in “YYYY-MM-DD” format. If not provided, the current date is used.

Returns:

A dictionary containing fixture details for the specified sport and date, including match details, teams, venue, and start time.

Return type:

Dict[str, Any]

Raises:

ValueError – If the provided sport is not in the list of supported sports.

async player_last_year_summary(player_id)[source]

Retrieves the players last year summary

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

player_id (int)

async player_shot_actions(player_id, league_id, season_id)[source]

Retrieves a player’s shot actions for a specific league and season.

Parameters:
  • player_id (int) – The ID of the player.

  • league_id (int) – The ID of the league (unique tournament).

  • season_id (int) – The ID of the season.

Returns:

A dictionary containing the player’s season statistics, including points, rebounds, assists, and more.

Return type:

Dict[str, Any]

async player_stats(player_id, league_id, season_id)[source]

Retrieves a player’s statistics for a specific league and season.

Parameters:
  • player_id (int) – The ID of the player.

  • league_id (int) – The ID of the league (unique tournament).

  • season_id (int) – The ID of the season.

Returns:

A dictionary containing the player’s season statistics, including points, rebounds, assists, and more.

Return type:

Dict[str, Any]

async season_games(tournament_id, season_id)[source]

Retrieves all matches for the selected tournament and season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async team_top_players(team_id, tournament_id, season_id)[source]

Retrieves the top players for the given team.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • team_id (int)

  • tournament_id (int)

  • season_id (int)

async total_matches()[source]

Retrieves the total count of today’s ice hockey matches and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live ice hockey matches.

  • ”total”: The total number of ice hockey matches scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 8, “total”: 16

}

sofascore_wrapper.league module

class sofascore_wrapper.league.League(api, league_id)[source]

Bases: object

Parameters:
async cup_fixtures_per_round(season_id, round_id)[source]

Fetch the next fixtures for the given season and round.

This method retrieves the upcoming fixtures based on the specified round of the current season for a league. It filters events where the status is “Not Started” (status code 0).

Parameters:
  • season_id (int) – The ID of the season.

  • round_id (int) – The ID of the round.

Returns:

A dictionary representing the fixtures for the next round where the status is “Not Started”. If no fixtures match the criteria, it returns None.

Return type:

Dict[Dict, Any]

Example Response:

[
{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1360406, “hasPerformanceGraphFeature”: true, “id”: 17, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 617, “isGroup”: false, “isLive”: false, “id”: 1

}, “season”: {

“name”: “Premier League 24/25”, “year”: “24/25”, “editor”: false, “id”: 61627

}, “roundInfo”: {

“round”: 24

}, “customId”: “osF”, “status”: {

“code”: 0, “description”: “Not started”, “type”: “notstarted”

}, “homeTeam”: {

“name”: “Nottingham Forest”, “slug”: “nottingham-forest”, “shortName”: “Forest”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 350038, “nameCode”: “NFO”, “disabled”: false, “national”: false, “type”: 0, “id”: 14

}, “awayTeam”: {

“name”: “Manchester City”, “slug”: “manchester-city”, “shortName”: “City”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 498380, “nameCode”: “MCI”, “disabled”: false, “national”: false, “type”: 0, “id”: 13

}

}

]

async cup_tree(season_id)[source]

Retrieves the cup tree structure for a given season, displaying the knockout rounds and fixtures.

Parameters:

season_id (int) – The ID of the season.

Returns:

A dictionary containing the cup tree layout, including rounds, teams, and match results.

Return type:

Dict[str, Any]

Example Response:
{
    "cupTrees": [
        {
            "id": 10569462,
            "name": "FA Cup 24/25",
            "tournament": {
                "name": "FA Cup",
                "slug": "fa-cup",
                "category": {
                    "name": "England",
                    "slug": "england",
                    "sport": {
                        "name": "Football",
                        "slug": "football",
                        "id": 1
                    },
                    "id": 1,
                    "flag": "england",
                    "alpha2": "EN"
                }
            },
            "currentRound": 4,
            "rounds": [
                {
                    "order": 1,
                    "description": "Round 1",
                    "blocks": [
                        {
                            "blockId": 2253397,
                            "finished": true,
                            "matchesInRound": 1,
                            "result": "0:2",
                            "homeTeamScore": "0",
                            "awayTeamScore": "2",
                            "participants": [
                                {
                                    "team": {
                                        "name": "Gillingham",
                                        "slug": "gillingham",
                                        "shortName": "Gillingham",
                                        "id": 20
                                    },
                                    "winner": false
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
Example Usage:
cup_tree_data = await api.cup_tree(season_id=65360)
print(cup_tree_data["cupTrees"][0]["name"])  # Output: FA Cup 24/25
async current_round(season)[source]

Get the current round for a specific season.

Parameters:

season (int) – The season ID to fetch the current round for.

Returns:

The current round number.

Return type:

int

Raises:

Exception – If the API request fails.

Example Response:

24

async current_season()[source]

Returns the current season for the selected league.

Returns:

A list of season objects.

Return type:

List[Dict[str, Any]]

Raises:

Exception – If the API request fails.

Example Response:

{

“name”: “Premier League 24/25”, “year”: “24/25”, “editor”: false, “id”: 61627

}

async featured_games()[source]

Get the featured game for a specific season.

Returns:

A dictionary containing the featured game details.

Return type:

Dict

Raises:

Exception – If the API request fails.

Example Response:

{
“featuredEvents”: [
{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “country”: {}, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 617, “isGroup”: false, “isLive”: false, “id”: 1

}, “season”: {

“name”: “Premier League 24/25”, “year”: “24/25”, “editor”: false, “id”: 61627

}, “roundInfo”: {

“round”: 24

}, “customId”: “osF”, “status”: {

“code”: 0, “description”: “Not started”, “type”: “notstarted”

}, “homeTeam”: {

“name”: “Nottingham Forest”, “slug”: “nottingham-forest”, “shortName”: “Forest”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 349426, “nameCode”: “NFO”, “disabled”: false, “national”: false, “type”: 0, “id”: 14, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#cc0000”, “text”: “#cc0000”

}

}, “awayTeam”: {

“name”: “Brighton & Hove Albion”, “slug”: “brighton-and-hove-albion”, “shortName”: “Brighton”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 621440, “nameCode”: “BHA”, “disabled”: false, “national”: false, “type”: 0, “id”: 30, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#0054a6”, “secondary”: “#ffffff”, “text”: “#ffffff”

}

}, “homeScore”: {}, “awayScore”: {}, “time”: {}, “changes”: {

“changeTimestamp”: 0

}, “hasGlobalHighlights”: false, “detailId”: 1, “crowdsourcingDataDisplayEnabled”: false, “id”: 12436930, “startTimestamp”: 1738413000, “slug”: “brighton-and-hove-albion-nottingham-forest”, “finalResultOnly”: false, “feedLocked”: true, “isEditor”: false

}

]

}

async fixtures(season, round)[source]

Fetch the fixtures for a specific season and round.

This method retrieves the fixtures of a particular round in a given season for a league. It filters events where the status is “Not Started” (status code 0).

Parameters:
  • season (int) – The season ID for which to fetch the fixtures (e.g., 61627 for Premier League 24/25).

  • round (int) – The round number for which to fetch the fixtures (e.g., 24).

Returns:

A dictionary of fixtures for the specified season and round, with events where the status code is 0 (Not Started). Returns an empty list if no fixtures match the criteria.

Return type:

dict

Example response: { “events”: [

{ “tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: { “name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN” }, “uniqueTournament”: { “name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: { “name”: “Football”, “slug”: “football”, “id”: 1 }, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1360406, “hasPerformanceGraphFeature”: true, “id”: 17, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false }, “priority”: 617, “isGroup”: false, “isLive”: false, “id”: 1

}, “season”: {

“name”: “Premier League 24/25”, “year”: “24/25”, “editor”: false, “id”: 61627

}, “roundInfo”: {

“round”: 24

}, “customId”: “osF”, “status”: {

“code”: 0, “description”: “Not started”, “type”: “notstarted”

}, “homeTeam”: {

“name”: “Nottingham Forest”, “slug”: “nottingham-forest”, “shortName”: “Forest”, “gender”: “M”, “sport”: { “name”: “Football”, “slug”: “football”, “id”: 1 }, “userCount”: 350038, “nameCode”: “NFO”, “disabled”: false, “national”: false, “type”: 0, “id”: 14

}, “awayTeam”: {

“name”: “Manchester City”, “slug”: “manchester-city”, “shortName”: “City”, “gender”: “M”, “sport”: { “name”: “Football”, “slug”: “football”, “id”: 1 }, “userCount”: 498380, “nameCode”: “MCI”, “disabled”: false, “national”: false, “type”: 0, “id”: 13

]

Example usage: >>> fixtures = await league.fixtures(season=61627, round=24) >>> print(fixtures)

async get_image(image_type='dark')[source]

Get the league image URL.

Parameters:

image_type (str, optional) – The type of image (“dark” or “light”). Defaults to “dark”.

Returns:

The URL for the requested league image.

Return type:

str

Raises:

Exception – If the API request fails.

Example Response:

https://img.sofascore.com/api/v1/unique-tournament/17/image/dark

async get_info(season)[source]

Fetch statistical information about the league for a specific season.

Parameters:

season (int) – The season ID to fetch information for.

Returns:

A dictionary containing league statistics for the season.

Return type:

dict

Raises:

Exception – If the API request fails.

Example Response:

{
“info”: {

“goals”: 691, “homeTeamWins”: 89, “awayTeamWins”: 79, “draws”: 61, “yellowCards”: 1041, “redCards”: 31, “newcomersUpperDivision”: [], “newcomersLowerDivision”: [

{

“name”: “Leicester City”, “slug”: “leicester-city”, “shortName”: “Leicester”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 536747, “nameCode”: “LEI”, “disabled”: false, “national”: false, “type”: 0, “id”: 31, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “teamColors”: {

“primary”: “#003090”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ليستر سيتي”, “ru”: “Лестер Сити”, “hi”: “लीसेस्टर सिटी”, “bn”: “লেস্টার সিটি”

}, “shortNameTranslation”: {

“ar”: “ليستر”, “hi”: “लीसेस्टर”, “bn”: “লেস্টার”

}

}

}

]

}

}

async get_latest_highlights()[source]

Get the latest match highlights for the league.

Returns:

A dictionary containing the latest match highlights.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Example Response:

{
“media”: [
{

“title”: “Fulham 0 - 1 Man Utd”, “subtitle”: “Full Highlights”, “url”: “https://www.youtube.com/watch?v=1BYRn04UOaw”, “thumbnailUrl”: “https://i.ytimg.com/vi/1BYRn04UOaw/hqdefault.jpg”, “mediaType”: 1, “doFollow”: false, “keyHighlight”: false, “id”: 6193980, “createdAtTimestamp”: 1737944333, “sourceUrl”: “https://www.youtube.com/watch?v=1BYRn04UOaw

}

]

}

async get_league(league_id)[source]

Retrieves the tournament.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

league_id (int)

async get_seasons()[source]

Fetch all available seasons for the league.

Returns:

A list of season objects.

Return type:

List[Dict[str, Any]]

Raises:

Exception – If the API request fails.

Example Response:

[
{

“name”: “Premier League 24/25”, “year”: “24/25”, “editor”: false, “id”: 61627

]

async last_fixtures()[source]

Fetch the last fixtures for the current season and round or previous round.

This method retrieves fixtures based on the current round of the current season for a league. If there is at least one fixture with the status code 100, those fixtures are returned. If no such fixtures are found, it fetches fixtures from the previous round (if the current round is not the first).

Returns:

A list of dictionaries representing the fixtures for the last round with at least one fixture with status code 100, or from the previous round if no fixtures match the criteria.

Return type:

list or None

Example response: [

{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1360406, “hasPerformanceGraphFeature”: true, “id”: 17, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 617, “isGroup”: false, “isLive”: false, “id”: 1

}, “season”: {

“name”: “Premier League 24/25”, “year”: “24/25”, “editor”: false, “id”: 61627

}, “roundInfo”: {

“round”: 24

}, “customId”: “osF”, “status”: {

“code”: 100, “description”: “Started”, “type”: “started”

}, “homeTeam”: {

“name”: “Nottingham Forest”, “slug”: “nottingham-forest”, “shortName”: “Forest”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 350038, “nameCode”: “NFO”, “disabled”: false, “national”: false, “type”: 0, “id”: 14

}, “awayTeam”: {

“name”: “Manchester City”, “slug”: “manchester-city”, “shortName”: “City”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 498380, “nameCode”: “MCI”, “disabled”: false, “national”: false, “type”: 0, “id”: 13

}

}

]

async league_fixtures_per_round(season_id, round_id)[source]

Fetch the next fixtures for the given season and round.

This method retrieves the upcoming fixtures based on the specified round of the current season for a league. It filters events where the status is “Not Started” (status code 0).

Parameters:
  • season_id (int) – The ID of the season.

  • round_id (int) – The ID of the round.

Returns:

A dictionary representing the fixtures for the next round where the status is “Not Started”. If no fixtures match the criteria, it returns None.

Return type:

Dict[Dict, Any]

Example Response:

[
{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1360406, “hasPerformanceGraphFeature”: true, “id”: 17, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 617, “isGroup”: false, “isLive”: false, “id”: 1

}, “season”: {

“name”: “Premier League 24/25”, “year”: “24/25”, “editor”: false, “id”: 61627

}, “roundInfo”: {

“round”: 24

}, “customId”: “osF”, “status”: {

“code”: 0, “description”: “Not started”, “type”: “notstarted”

}, “homeTeam”: {

“name”: “Nottingham Forest”, “slug”: “nottingham-forest”, “shortName”: “Forest”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 350038, “nameCode”: “NFO”, “disabled”: false, “national”: false, “type”: 0, “id”: 14

}, “awayTeam”: {

“name”: “Manchester City”, “slug”: “manchester-city”, “shortName”: “City”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 498380, “nameCode”: “MCI”, “disabled”: false, “national”: false, “type”: 0, “id”: 13

}

}

]

async league_info(league_id, season_id)[source]

Retrieves the tournament info.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • league_id (int)

  • season_id (int)

async leagues(category_id)[source]

Retrieves all tournaments for a selected sport category.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

category_id (int)

async next_fixtures()[source]

Fetch the next fixtures for the current season and round.

This method retrieves the next fixtures based on the current round of the current season for a league. It filters events where the status is “Not Started” (status code 0).

Returns:

A list of dictionaries representing the fixtures for the next round where the status is “Not Started”. If no fixtures match the criteria, it returns None.

Return type:

list or None

Example response: [

{

“tournament”: { “name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: { “name”: “Football”, “slug”: “football”, “id”: 1 }, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: { “name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN” }, “userCount”: 1360406, “hasPerformanceGraphFeature”: true, “id”: 17, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 617, “isGroup”: false, “isLive”: false, “id”: 1 }, “season”: { “name”: “Premier League 24/25”, “year”: “24/25”, “editor”: false, “id”: 61627 }, “roundInfo”: { “round”: 24 }, “customId”: “osF”, “status”: { “code”: 0, “description”: “Not started”, “type”: “notstarted” }, “homeTeam”: { “name”: “Nottingham Forest”, “slug”: “nottingham-forest”, “shortName”: “Forest”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 350038, “nameCode”: “NFO”, “disabled”: false, “national”: false, “type”: 0, “id”: 14 }, “awayTeam”: { “name”: “Manchester City”, “slug”: “manchester-city”, “shortName”: “City”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 498380, “nameCode”: “MCI”, “disabled”: false, “national”: false, “type”: 0, “id”: 13 }

}

]

async player_of_the_season(season)[source]

Get the player of the season for a specific season.

Parameters:

season (int) – The season ID to fetch the player of the season for.

Returns:

A dictionary containing the player of the season details.

Return type:

Dict

Raises:

Exception – If the API request fails.

Example Response:

{
“player”: {

“name”: “Rodri”, “slug”: “rodri”, “shortName”: “Rodri”, “position”: “M”, “userCount”: 100726, “id”: 827606, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “رودري”, “hi”: “रोड्री”, “bn”: “রডরি”

}, “shortNameTranslation”: {

“ar”: “رودري”, “hi”: “रोड्री”, “bn”: “রডরি”

}

}

}, “statistics”: {

“rating”: 8.0117647058824, “id”: 1069463, “type”: “overall”, “appearances”: 34

}, “team”: {

“name”: “Manchester City”, “slug”: “manchester-city”, “shortName”: “Manchester City”, “userCount”: 2901739, “national”: false, “id”: 17, “entityType”: “team”, “teamColors”: {

“primary”: “#374df5”, “secondary”: “#374df5”, “text”: “#ffffff”

}

}

}

async rounds(season)[source]

Get the available rounds for a specific season.

Parameters:

season (int) – The season ID to fetch rounds for.

Returns:

A dictionary containing the available rounds.

Return type:

Dict

Raises:

Exception – If the API request fails.

Example Response:

{
“currentRound”: {

“round”: 24

}, “rounds”: [

{

“round”: 1

]

}

async standings(season)[source]

Get the current league standings for a specific season.

Parameters:

season (int) – The season ID to fetch standings for.

Returns:

A dictionary containing the league standings.

Return type:

Dict[str, Dict[str, Any]]

Raises:

Exception – If the API request fails.

Example Response:

{
“standings”: [
{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “displayInverseHomeAwayTeams”: false

}, “priority”: 617, “isGroup”: false, “isLive”: false, “id”: 1

}, “type”: “total”, “name”: “Premier League”, “descriptions”: [], “tieBreakingRule”: {

“text”: “In the event that two (or more) teams have an equal number of points, the following rules break the tie: 1. Goal difference 2. Goals scored 3. H2H”, “id”: 2393

}, “rows”: [

{
“team”: {

“name”: “Liverpool”, “slug”: “liverpool”, “shortName”: “Liverpool”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2600079, “nameCode”: “LIV”, “disabled”: false, “national”: false, “type”: 0, “id”: 44, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}

}, “descriptions”: [], “promotion”: {

“text”: “Champions League”, “id”: 804

}, “position”: 1, “matches”: 22, “wins”: 16, “scoresFor”: 54, “scoresAgainst”: 21, “id”: 1134312, “losses”: 1, “draws”: 5, “points”: 53, “scoreDiffFormatted”: “+33”

}

]

}

]

}

async standings_away(season)[source]

Get the current league standings for away games in a specific season.

Parameters:

season (int) – The season ID to fetch away standings for.

Returns:

A dictionary containing the away standings.

Return type:

Dict[str, Dict[str, Any]]

Raises:

Exception – If the API request fails.

Example Response:

{
“standings”: [
{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “displayInverseHomeAwayTeams”: false

}, “priority”: 617, “isGroup”: false, “isLive”: false, “id”: 1

}, “type”: “away”, “name”: “Premier League”, “descriptions”: [], “tieBreakingRule”: {

“text”: “In the event that two (or more) teams have an equal number of points, the following rules break the tie: 1. Goal difference 2. Goals scored 3. H2H”, “id”: 2393

}, “rows”: [

{
“team”: {

“name”: “Liverpool”, “slug”: “liverpool”, “shortName”: “Liverpool”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2600079, “nameCode”: “LIV”, “disabled”: false, “national”: false, “type”: 0, “id”: 44, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}

}, “descriptions”: [], “promotion”: {

“text”: “Champions League”, “id”: 804

}, “position”: 1, “matches”: 11, “wins”: 8, “scoresFor”: 30, “scoresAgainst”: 12, “id”: 1134352, “losses”: 0, “draws”: 3, “points”: 27, “scoreDiffFormatted”: “+18”

}

]

}

]

}

async standings_home(season)[source]

Get the current league standings for home games in a specific season.

Parameters:

season (int) – The season ID to fetch home standings for.

Returns:

A dictionary containing the home standings.

Return type:

Dict[str, Dict[str, Any]]

Raises:

Exception – If the API request fails.

Example Response:

{
“standings”: [
{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “displayInverseHomeAwayTeams”: false

}, “priority”: 617, “isGroup”: false, “isLive”: false, “id”: 1

}, “type”: “home”, “name”: “Premier League”, “descriptions”: [], “tieBreakingRule”: {

“text”: “In the event that two (or more) teams have an equal number of points, the following rules break the tie: 1. Goal difference 2. Goals scored 3. H2H”, “id”: 2393

}, “rows”: [

{
“team”: {

“name”: “Liverpool”, “slug”: “liverpool”, “shortName”: “Liverpool”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2600079, “nameCode”: “LIV”, “disabled”: false, “national”: false, “type”: 0, “id”: 44, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}

}, “descriptions”: [], “promotion”: {

“text”: “Champions League”, “id”: 804

}, “position”: 1, “matches”: 11, “wins”: 8, “scoresFor”: 24, “scoresAgainst”: 9, “id”: 1134332, “losses”: 1, “draws”: 2, “points”: 26, “scoreDiffFormatted”: “+15”

}

]

}

]

}

async top_players(season)[source]

Get top players for a specific season.

Parameters:

season (int) – The season ID to fetch top players for.

Returns:

A dictionary containing top players’ statistics.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Example Response:

{
“topPlayers”: {
“rating”: [
{
“statistics”: {

“rating”: 8.0090909090909, “id”: 1508984, “type”: “overall”, “appearances”: 22

}, “playedEnough”: true, “player”: {

“name”: “Mohamed Salah”, “slug”: “mohamed-salah”, “shortName”: “M. Salah”, “position”: “F”, “userCount”: 345702, “id”: 159665, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “محمد صلاح”, “hi”: “मोहम्मद सलाह”, “bn”: “মোহাম্মদ সালাহ”

}, “shortNameTranslation”: {

“ar”: “م. صلاح”, “hi”: “एम. सलाह”, “bn”: “এম. সালাহ”

}

}

}, “team”: {

“name”: “Liverpool”, “slug”: “liverpool”, “shortName”: “Liverpool”, “userCount”: 2600079, “national”: false, “id”: 44, “entityType”: “team”, “teamColors”: {

“primary”: “#374df5”, “secondary”: “#374df5”, “text”: “#ffffff”

}

}

}

]

}

}

async top_players_per_game(season)[source]

Fetch the top players per game for a specific season.

Parameters:

season (int) – The season ID to fetch top players for.

Returns:

A list of top players with their statistics.

Return type:

List[Dict[str, Any]]

Raises:

Exception – If the API request fails.

Example Response:

[
{

“statistic”: 10, “player”: {

“name”: “Phil Foden”, “slug”: “phil-foden”, “shortName”: “P. Foden”, “position”: “M”, “jerseyNumber”: “47”, “userCount”: 212999, “id”: 859765, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “فيل فودين”, “hi”: “फिल फोडेन”, “bn”: “ফিল ফোডেন”

}, “shortNameTranslation”: {

“ar”: “ف. فودين”, “hi”: “पी. फोडेन”, “bn”: “পি. ফোডেন”

}

}

}, “event”: {

“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “id”: 17, “displayInverseHomeAwayTeams”: false

}, “priority”: 617, “isLive”: false, “id”: 1

}, “customId”: “rP”, “status”: {

“code”: 100, “description”: “Ended”, “type”: “finished”

}, “winnerCode”: 1, “homeTeam”: {

“name”: “Manchester City”, “slug”: “manchester-city”, “shortName”: “Man City”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2901739, “nameCode”: “MCI”, “disabled”: false, “national”: false, “type”: 0, “id”: 17, “entityType”: “team”, “teamColors”: {

“primary”: “#66ccff”, “secondary”: “#ffffff”, “text”: “#ffffff”

}

}, “awayTeam”: {

“name”: “Aston Villa”, “slug”: “aston-villa”, “shortName”: “Aston Villa”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 878821, “nameCode”: “AVL”, “disabled”: false, “national”: false, “type”: 0, “id”: 40, “entityType”: “team”, “teamColors”: {

“primary”: “#670e36”, “secondary”: “#94bee5”, “text”: “#94bee5”

}

}, “homeScore”: {

“current”: 4, “display”: 4, “period1”: 2, “period2”: 2, “normaltime”: 4

}, “awayScore”: {

“current”: 1, “display”: 1, “period1”: 1, “period2”: 0, “normaltime”: 1

}, “hasXg”: true, “id”: 11352352, “startTimestamp”: 1712171700, “slug”: “aston-villa-manchester-city”, “finalResultOnly”: false

}

]

async top_teams(season)[source]

Get top teams for a specific season.

Parameters:

season (int) – The season ID to fetch top teams for.

Returns:

A dictionary containing top teams’ statistics.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Example Response:

{
“topTeams”: {
“avgRating”: [
{
“team”: {

“name”: “Manchester City”, “slug”: “manchester-city”, “shortName”: “Manchester City”, “gender”: “M”, “userCount”: 2901739, “national”: false, “type”: 0, “id”: 17, “entityType”: “team”, “teamColors”: {

“primary”: “#374df5”, “secondary”: “#374df5”, “text”: “#ffffff”

}

}, “statistics”: {

“avgRating”: 7.1757097791798, “id”: 24789, “matches”: 23, “awardedMatches”: 0

}

}

]

}

}

async totw(season, round)[source]

Get the team of the week for a specific round in a season.

Parameters:
  • season (int) – The season ID to fetch the team of the week for.

  • round (int) – The round ID to fetch the team of the week for.

Returns:

A dictionary containing the team of the week details.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Example Response:

{

“formation”: “3-4-3”, “players”: [

{
“player”: {

“name”: “Jakub Stolarczyk”, “firstName”: “”, “lastName”: “”, “slug”: “jakub-stolarczyk”, “shortName”: “J. Stolarczyk”, “position”: “G”, “jerseyNumber”: “41”, “userCount”: 952, “id”: 997830, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ياكوب ستولارتشيك”, “hi”: “जकूब स्टोलार्स्की”, “bn”: “জ্যাকুব স্টোলারকজিক”

}, “shortNameTranslation”: {

“ar”: “ي. ستولارتشيك”, “hi”: “जे. स्टोलार्स्की”, “bn”: “জে. স্টোলারজিক”

}

}

}, “team”: {

“name”: “Leicester City”, “slug”: “leicester-city”, “shortName”: “Leicester”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 536747, “nameCode”: “LEI”, “disabled”: false, “national”: false, “type”: 0, “id”: 31, “entityType”: “team”, “teamColors”: {

“primary”: “#003090”, “secondary”: “#ffffff”, “text”: “#ffffff”

}

}, “event”: {

“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “id”: 17, “displayInverseHomeAwayTeams”: false

}, “priority”: 617, “isLive”: false, “id”: 1

}, “customId”: “MXpf”, “status”: {

“code”: 100, “description”: “Ended”, “type”: “finished”

}, “winnerCode”: 2, “homeTeam”: {

“name”: “Tottenham Hotspur”, “slug”: “tottenham-hotspur”, “shortName”: “Tottenham “, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 1327772, “nameCode”: “TOT”, “disabled”: false, “national”: false, “type”: 0, “id”: 33, “entityType”: “team”, “teamColors”: {

“primary”: “#ffffff”, “secondary”: “#000066”, “text”: “#000066”

}

}, “awayTeam”: {

“name”: “Leicester City”, “slug”: “leicester-city”, “shortName”: “Leicester”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 536747, “nameCode”: “LEI”, “disabled”: false, “national”: false, “type”: 0, “id”: 31, “entityType”: “team”, “teamColors”: {

“primary”: “#003090”, “secondary”: “#ffffff”, “text”: “#ffffff”

}

}, “homeScore”: {

“current”: 1, “display”: 1, “period1”: 1, “period2”: 0, “normaltime”: 1

}, “awayScore”: {

“current”: 2, “display”: 2, “period1”: 0, “period2”: 2, “normaltime”: 2

}, “hasXg”: true, “id”: 12436907, “startTimestamp”: 1737900000, “slug”: “tottenham-hotspur-leicester-city”, “finalResultOnly”: false

}, “rating”: “8.1”, “order”: 1, “id”: 198034

}

]

}

async totw_rounds(season)[source]

Get the available team of the week rounds for a specific season.

Parameters:

season (int) – The season ID to fetch team of the week rounds for.

Returns:

A dictionary containing the available rounds.

Return type:

Dict

Raises:

Exception – If the API request fails.

Example Response:

{
“rounds”: [
{

“roundId”: 23, “roundName”: “23”, “roundSlug”: “23:23”, “id”: 16987, “createdAtTimestamp”: 1737966749

}

]

}

sofascore_wrapper.manager module

class sofascore_wrapper.manager.Manager(api, manager_id)[source]

Bases: object

Parameters:
async get_manager()[source]

Retrieves detailed information about the manager.

Returns:

A dictionary containing manager details such as name, slug, short name, sport, teams, preferred formation, and more.

Return type:

Dict

Example Response:

{
“manager”: {

“name”: “Mikel Arteta”, “slug”: “mikel-arteta”, “shortName”: “M. Arteta”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “teams”: [

{

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “primaryUniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}

], “preferredFormation”: “4-3-3”, “deceased”: false, “id”: 794075, “country”: {

“alpha2”: “ES”, “name”: “Spain”

}, “team”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “primaryUniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “formerPlayerId”: 1152, “nationality”: “ESP”, “nationalityISO2”: “ES”, “performance”: {

“total”: 267, “wins”: 162, “draws”: 43, “losses”: 62, “goalsScored”: 526, “goalsConceded”: 281, “totalPoints”: 529

}, “dateOfBirthTimestamp”: 385948800, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ميكيل أرتيتا”, “hi”: “मिकेल आर्टेटा”, “bn”: “মিকেল আর্তেতা”

}, “shortNameTranslation”: {

“ar”: “م. أرتيتا”, “hi”: “एम. आर्टेटा”, “bn”: “এম. আরতেতা”

}

}

}

}

sofascore_wrapper.match module

class sofascore_wrapper.match.Match(api, match_id=None)[source]

Bases: object

Parameters:
async best_away_players()[source]

Fetches the best-rated players of the away team for the specified match.

Returns:

A list of dictionaries containing the best-rated players of the away team.
Each dictionary includes:
  • value (str): The rating value of the player.

  • label (str): The label for the value (e.g., “rating”).

  • player (Dict[str, Any]): Details about the player, including:
    • name (str): The player’s full name.

    • slug (str): The player’s slug or unique identifier.

    • shortName (str): The player’s short name.

    • position (str): The player’s position on the field.

    • jerseyNumber (str): The player’s jersey number.

    • height (int): The player’s height in centimeters.

    • userCount (int): The number of users following the player.

    • id (int): The player’s unique ID.

    • marketValueCurrency (str): The currency of the player’s market value.

    • dateOfBirthTimestamp (int): The player’s date of birth as a timestamp.

    • proposedMarketValueRaw (Dict[str, Any]): The player’s proposed market value, including:
      • value (int): The market value amount.

      • currency (str): The currency of the market value.

    • fieldTranslations (Dict[str, Any]): Translations of the player’s name and short name in various languages.

Returns None if no data is available.

Return type:

Optional[List[Dict[str, Any]]]

Example

[
{

“value”: “7.8”, “label”: “rating”, “player”: {

“name”: “Pau López”, “slug”: “pau-lopez”, “shortName”: “P. López”, “position”: “G”, “jerseyNumber”: “25”, “height”: 189, “userCount”: 1060, “id”: 548848, “marketValueCurrency”: “EUR”, “dateOfBirthTimestamp”: 787276800, “proposedMarketValueRaw”: {

“value”: 3700000, “currency”: “EUR”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “باو لوبيز”, “hi”: “पाऊ लोपेज़”, “bn”: “পাউ লোপেজ”

}, “shortNameTranslation”: {

“ar”: “ب. لوبيز”, “hi”: “पी. लोपेज़”, “bn”: “পি. লোপেজ”

}

}

}

}

]

Raises:

Exception – If the API request fails or returns an error.

Return type:

List[Dict[str, Any]] | None

async best_home_players()[source]

Fetches the best-rated players of the Home team for the specified match.

Returns:

A list of dictionaries containing the best-rated players of the away team.
Each dictionary includes:
  • value (str): The rating value of the player.

  • label (str): The label for the value (e.g., “rating”).

  • player (Dict[str, Any]): Details about the player, including:
    • name (str): The player’s full name.

    • slug (str): The player’s slug or unique identifier.

    • shortName (str): The player’s short name.

    • position (str): The player’s position on the field.

    • jerseyNumber (str): The player’s jersey number.

    • height (int): The player’s height in centimeters.

    • userCount (int): The number of users following the player.

    • id (int): The player’s unique ID.

    • marketValueCurrency (str): The currency of the player’s market value.

    • dateOfBirthTimestamp (int): The player’s date of birth as a timestamp.

    • proposedMarketValueRaw (Dict[str, Any]): The player’s proposed market value, including:
      • value (int): The market value amount.

      • currency (str): The currency of the market value.

    • fieldTranslations (Dict[str, Any]): Translations of the player’s name and short name in various languages.

Returns None if no data is available.

Return type:

Optional[List[Dict[str, Any]]]

Example

[
{

“value”: “7.8”, “label”: “rating”, “player”: {

“name”: “Pau López”, “slug”: “pau-lopez”, “shortName”: “P. López”, “position”: “G”, “jerseyNumber”: “25”, “height”: 189, “userCount”: 1060, “id”: 548848, “marketValueCurrency”: “EUR”, “dateOfBirthTimestamp”: 787276800, “proposedMarketValueRaw”: {

“value”: 3700000, “currency”: “EUR”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “باو لوبيز”, “hi”: “पाऊ लोपेज़”, “bn”: “পাউ লোপেজ”

}, “shortNameTranslation”: {

“ar”: “ب. لوبيز”, “hi”: “पी. लोपेज़”, “bn”: “পি. লোপেজ”

}

}

}

}

]

Raises:

Exception – If the API request fails or returns an error.

Return type:

List[Dict[str, Any]] | None

async channel_schedule(channel_id)[source]

Get the channel schedule for the given channel ID.

This function retrieves the upcoming games for the provided channel.

Parameters:

channel_id (int) – The ID of the TV channel for which the name is required.

Return type:

str

async commentary()[source]

Retrieves commentary and highlights for the given match.

This function fetches the live commentary and highlights for a specific match, including text comments such as match events, player actions, and game status updates.

Returns:

A dictionary containing a list of commentary objects, each of which includes details about the comment, type, time, and optionally player information.

Return type:

dict

Example Response:
{
    "comments": [
        {
            "text": "Match ends, Girona 1, Arsenal 2.",
            "type": "matchEnded",
            "id": 27698855,
            "time": 0
        },
        {
            "text": "Second Half ends, Girona 1, Arsenal 2.",
            "type": "endSecondHalf",
            "id": 27698807,
            "periodName": "2ND",
            "time": 96
        },
        {
            "text": "Foul by Cristhian Stuani (Girona).",
            "type": "freeKickLost",
            "isHome": true,
            "player": {
                "name": "Cristhian Stuani",
                "slug": "cristhian-stuani",
                "shortName": "C. Stuani",
                "position": "F",
                "jerseyNumber": "7",
                "height": 184,
                "userCount": 1757,
                "id": 32048,
                "marketValueCurrency": "EUR",
                "dateOfBirthTimestamp": 529459200,
                "proposedMarketValueRaw": {
                    "value": 1100000,
                    "currency": "EUR"
                },
                "fieldTranslations": {
                    "nameTranslation": {
                        "ar": "كريستيان ستواني",
                        "hi": "क्रिस्टियन स्टुआनी",
                        "bn": "ক্রিশ্চিয়ান স্টুয়ানি"
                    },
                    "shortNameTranslation": {
                        "ar": "ك. ستواني",
                        "hi": "सी. स्टुआनी",
                        "bn": "সি. স্টুয়ানি"
                    }
                }
            },
            "id": 27698809,
            "periodName": "2ND",
            "time": 96
        }
    ]
}
Commentary Object Details:
  • text: The text of the commentary, describing the match event or action.

  • type: The type of comment (e.g., “matchEnded”, “freeKickLost”).

  • id: Unique identifier for the comment.

  • time: The time (in seconds) when the comment occurred in the match.

  • periodName (optional): The name of the period, such as “1ST”, “2ND”.

  • isHome (optional): Boolean indicating if the event relates to the home team.

  • player (optional): Player information for player-related events.
    • name: Player’s full name.

    • slug: URL-friendly identifier for the player.

    • shortName: Shortened player name.

    • position: Player’s position (e.g., “F” for forward).

    • jerseyNumber: Player’s jersey number.

    • height: Player’s height in centimeters.

    • marketValueCurrency: The currency for the player’s market value.

    • proposedMarketValueRaw: Proposed market value for the player, including currency.

    • fieldTranslations: Translations for the player’s name and short name in different languages.

async featured_odds()[source]

Fetches the featured odds for the specified match.

Returns:

A dictionary containing the featured odds data. The structure includes:
  • featured (Dict[str, Dict[str, Any]]): A dictionary of featured markets, each containing:
    • default (Dict[str, Any]): The default market data, including:
      • sourceId (int): The source ID of the market.

      • structureType (int): The structure type of the market.

      • marketId (int): The ID of the market.

      • marketName (str): The name of the market.

      • isLive (bool): Indicates if the market is live.

      • fid (int): The fid of the market.

      • suspended (bool): Indicates if the market is suspended.

      • id (int): The ID of the market.

      • choices (List[Dict[str, Any]]): A list of choices/outcomes for the market, each containing:
        • initialFractionalValue (str): The initial fractional odds value.

        • fractionalValue (str): The current fractional odds value.

        • sourceId (int): The source ID of the choice.

        • name (str): The name of the choice.

        • winning (bool): Indicates if the choice is winning.

        • change (int): The change in odds.

    • asian (Dict[str, Any]): The Asian handicap market data, with the same structure as default.

    • fullTime (Dict[str, Any]): The full-time market data, with the same structure as default.

  • hasMoreOdds (bool): Indicates if there are more odds available.

Return type:

Dict[str, Any]

Example Response:

{
“featured”: {
“default”: {

“sourceId”: 168664758, “structureType”: 1, “marketId”: 1, “marketName”: “Full time”, “isLive”: false, “fid”: 168664758, “suspended”: false, “id”: 1962878117, “choices”: [

{

“initialFractionalValue”: “17/4”, “fractionalValue”: “9/2”, “sourceId”: 2114984998, “name”: “1”, “winning”: false, “change”: 1

}, {

“initialFractionalValue”: “10/3”, “fractionalValue”: “31/10”, “sourceId”: 2114985000, “name”: “X”, “winning”: false, “change”: -1

}, {

“initialFractionalValue”: “53/100”, “fractionalValue”: “57/100”, “sourceId”: 2114985001, “name”: “2”, “winning”: true, “change”: 1

}

]

}, “asian”: {

“sourceId”: 168664758, “structureType”: 1, “marketId”: 17, “marketName”: “Asian handicap”, “isLive”: false, “fid”: 168664760, “suspended”: false, “id”: 1962996370, “choices”: [

{

“initialFractionalValue”: “49/50”, “fractionalValue”: “22/25”, “sourceId”: 2114985005, “name”: “(1) Girona FC”, “change”: -1

}, {

“initialFractionalValue”: “23/25”, “fractionalValue”: “51/50”, “sourceId”: 2114985008, “name”: “(-1) Arsenal”, “change”: 1

}

]

}, “fullTime”: {

“sourceId”: 168664758, “structureType”: 1, “marketId”: 1, “marketName”: “Full time”, “isLive”: false, “fid”: 168664758, “suspended”: false, “id”: 1962878117, “choices”: [

{

“initialFractionalValue”: “17/4”, “fractionalValue”: “9/2”, “sourceId”: 2114984998, “name”: “1”, “winning”: false, “change”: 1

}, {

“initialFractionalValue”: “10/3”, “fractionalValue”: “31/10”, “sourceId”: 2114985000, “name”: “X”, “winning”: false, “change”: -1

}, {

“initialFractionalValue”: “53/100”, “fractionalValue”: “57/100”, “sourceId”: 2114985001, “name”: “2”, “winning”: true, “change”: 1

}

]

}

}, “hasMoreOdds”: true

}

Raises:

Exception – If the API request fails or returns an error.

Return type:

Dict[str, Any]

async games_by_date(sport, date=None)[source]

Retrieves the fixtures for today or a specific date.

Parameters:
  • sport (str) – The sport of which you wish to gain fixtures for. Check below for appropriate sport names.

  • date (str, optional) – The date in the format “YYYY-MM-DD”. If not provided, today’s date is used.

Return type:

Dict[str, Any]

Arg sport (str, Any):
[

“football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker”, “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “e-sports”, “handball”, “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton”, “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

]

}

Returns:

A dictionary containing the fixtures for the specified date, including match details, teams, and timings.

Return type:

Dict[str, Any]

Parameters:
  • sport (str)

  • date (str | None)

Example Response:

{
“events”: [
{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “customId”: “HsR”, “status”: {

“code”: 0, “description”: “Not started”, “type”: “notstarted”

}, “winnerCode”: 0, “homeTeam”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “awayTeam”: {

“name”: “Liverpool”, “slug”: “liverpool”, “shortName”: “Liverpool”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2572976, “nameCode”: “LIV”, “disabled”: false, “national”: false, “type”: 0, “id”: 44, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ليفربول”, “ru”: “Ливерпуль”, “hi”: “लिवरपूल”, “bn”: “লিভারপুল”

}, “shortNameTranslation”: {

“ar”: “ليفربول”, “hi”: “लिवरपूल”, “bn”: “লিভারপুল”

}

}

}, “homeScore”: {

“current”: 0, “display”: 0, “period1”: 0, “period2”: 0, “normaltime”: 0

}, “awayScore”: {

“current”: 0, “display”: 0, “period1”: 0, “period2”: 0, “normaltime”: 0

}, “time”: {

“injuryTime1”: 0, “injuryTime2”: 0, “currentPeriodStartTimestamp”: 0

}, “changes”: {

“changes”: [], “changeTimestamp”: 0

}, “hasGlobalHighlights”: false, “hasXg”: false, “hasEventPlayerStatistics”: false, “hasEventPlayerHeatMap”: false, “detailId”: 1, “crowdsourcingDataDisplayEnabled”: false, “id”: 12436472, “startTimestamp”: 1735330500, “slug”: “arsenal-liverpool”, “finalResultOnly”: false, “feedLocked”: false, “isEditor”: false

}

]

}

async get_channel(channel_id)[source]

Get the channel name for the given channel ID.

This function retrieves the name of a TV channel based on the provided channel ID for a specific match. It returns the name of the channel if available.

Example Response:

“TV2 Play” # The channel name corresponding to the channel ID.

Parameters:

channel_id (int) – The ID of the TV channel for which the name is required.

Returns:

The name of the channel associated with the given channel ID, or None if the channel name is not found.

Return type:

str

async get_match()[source]

Returns the match info.

Example Response:

{
“tournament”: {

“name”: “U20 CONMEBOL Championship, Group B”, “slug”: “u20-conmebol-championship-group-b”, “category”: {

“name”: “South America”, “slug”: “south-america”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1470, “flag”: “south-america”

}, “uniqueTournament”: {

“name”: “U20 CONMEBOL Championship”, “slug”: “u20-conmebol-championship”, “primaryColorHex”: “#348925”, “secondaryColorHex”: “#afc402”, “category”: {

“name”: “South America”, “slug”: “south-america”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1470, “flag”: “south-america”

}, “userCount”: 11952, “id”: 632, “hasPerformanceGraphFeature”: false, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 0, “isGroup”: true, “groupName”: “Group B”, “isLive”: false, “id”: 10066

}, “season”: {

“name”: “U20 CONMEBOL Ch.ship 2025”, “year”: “2025”, “editor”: false, “id”: 68914

}, “roundInfo”: {

“round”: 4

}, “customId”: “xdjsiAn”, “status”: {

“code”: 6, “description”: “1st half”, “type”: “inprogress”

}, “homeTeam”: {

“name”: “Ecuador U20”, “slug”: “ecuador-u20”, “shortName”: “Ecuador U20”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 4401, “nameCode”: “ECU”, “disabled”: false, “national”: true, “type”: 0, “id”: 33758, “country”: {

“alpha2”: “EC”, “alpha3”: “ECU”, “name”: “Ecuador”, “slug”: “ecuador”

}, “entityType”: “team”, “teamColors”: {

“primary”: “#ffff00”, “secondary”: “#000063”, “text”: “#000063”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الإكوادور تحت 20”, “ru”: “Эквадор U20”

}

}

}, “awayTeam”: {

“name”: “Brazil U20”, “slug”: “brazil-u20”, “shortName”: “Brazil U20”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 39092, “nameCode”: “BRA”, “disabled”: false, “national”: true, “type”: 0, “id”: 22672, “country”: {

“alpha2”: “BR”, “alpha3”: “BRA”, “name”: “Brazil”, “slug”: “brazil”

}, “entityType”: “team”, “teamColors”: {

“primary”: “#ffff00”, “secondary”: “#009933”, “text”: “#009933”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “البرازيل تحت 20”, “ru”: “Бразилия U20”

}

}

}, “homeScore”: {

“current”: 0, “display”: 0, “period1”: 0, “normaltime”: 0

}, “awayScore”: {

“current”: 0, “display”: 0, “period1”: 0, “normaltime”: 0

}, “time”: {

“initial”: 0, “max”: 2700, “extra”: 540, “currentPeriodStartTimestamp”: 1738279810

}, “changes”: {

“changes”: [

“homeScore.period1”, “homeScore.normaltime”, “awayScore.period1”, “awayScore.normaltime”

], “changeTimestamp”: 1738279909

}, “hasGlobalHighlights”: false, “hasEventPlayerStatistics”: true, “hasEventPlayerHeatMap”: true, “detailId”: 1, “crowdsourcingDataDisplayEnabled”: false, “id”: 13123315, “statusTime”: {

“prefix”: “”, “initial”: 0, “max”: 2700, “timestamp”: 1738279810, “extra”: 540

}, “startTimestamp”: 1738279800, “slug”: “ecuador-u20-brazil-u20”, “lastPeriod”: “period1”, “finalResultOnly”: false, “feedLocked”: true, “isEditor”: false

}

Return type:

Dict

async h2h()[source]

Fetches the head-to-head (H2H) data for the teams involved in the specified match.

Returns:

A dictionary containing the head-to-head data. The structure includes:
  • teamDuel (Dict[str, int]): A dictionary representing the head-to-head results between the teams:
    • homeWins (int): The number of wins for the home team.

    • awayWins (int): The number of wins for the away team.

    • draws (int): The number of draws between the teams.

  • managerDuel (Dict[str, int]): A dictionary representing the head-to-head results between the managers:
    • homeWins (int): The number of wins for the home team’s manager.

    • awayWins (int): The number of wins for the away team’s manager.

    • draws (int): The number of draws between the managers.

Return type:

Dict[str, Any]

Example Response:

{
“teamDuel”: {

“homeWins”: 0, “awayWins”: 1, “draws”: 0

}, “managerDuel”: {

“homeWins”: 0, “awayWins”: 1, “draws”: 0

}

}

Raises:

Exception – If the API request fails or returns an error.

Return type:

Dict[str, Any]

async h2h_results(match_code)[source]

Retrieves more h2h data for a given match. Please provide the match code such as xNbsDNb rather than the match id.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

match_code (str)

async heatmap(team_id)[source]

Retrieves the heatmap data for the given team in the specified match.

The heatmap contains the coordinates of player activity during the match, represented by points on the field. This data provides insights into the movement and positioning of players on the field.

Parameters:

team_id (int) – The ID of the team for which the heatmap is to be fetched.

Returns:

A dictionary containing the heatmap data with player points, each represented by x and y coordinates.

Return type:

dict

Example Response:

{
“playerPoints”: [
{

“x”: 55.3, “y”: 10.3

}, {

“x”: 40.5, “y”: 30.2

]

}

async highlight()[source]

Retrieves a match highlight video for the given game.

Returns:

A dictionary containing a list of highlights for the match. Each highlight contains the video title, subtitle, URL, thumbnail, and additional metadata like whether it’s a key highlight.

Return type:

dict

Example Response:
{
    "highlights": [
        {
            "title": "Girona FC 1-2 Arsenal",
            "subtitle": "Full Highlights",
            "url": "https://youtu.be/3C0wBjYhqLE",
            "thumbnailUrl": "https://i.ytimg.com/vi/3C0wBjYhqLE/hqdefault.jpg",
            "mediaType": 1,
            "doFollow": false,
            "keyHighlight": true,
            "id": 6209847,
            "createdAtTimestamp": 1738195753,
            "sourceUrl": "https://youtu.be/3C0wBjYhqLE"
        }
    ]
}
async incidents()[source]

Fetches the important incidents for the specified match, including game status changes and key events.

Returns:

A dictionary containing the incidents data. The structure includes:
  • incidents (List[Dict[str, Any]]): A list of incident objects, each containing:
    • text (str): A description or label for the incident (e.g., “FT” for full-time).

    • homeScore (int): The home team’s score at the time of the incident.

    • awayScore (int): The away team’s score at the time of the incident.

    • isLive (bool): Indicates if the match was live at the time of the incident.

    • time (int): The time in minutes when the incident occurred.

    • addedTime (int): The added or stoppage time when the incident occurred.

    • timeSeconds (int): The time in seconds when the incident occurred.

    • reversedPeriodTime (int): The reversed period time (e.g., 1 for first half, 2 for second half).

    • reversedPeriodTimeSeconds (int): The reversed period time in seconds.

    • incidentType (str): The type of incident (e.g., “period”, “inGamePenalty”).

    • player (Dict[str, Any], optional): Details about the player involved in the incident, including:
      • name (str): The player’s full name.

      • slug (str): The player’s slug or unique identifier.

      • shortName (str): The player’s short name.

      • position (str): The player’s position on the field.

      • jerseyNumber (str): The player’s jersey number.

      • height (int): The player’s height in centimeters.

      • userCount (int): The number of users following the player.

      • id (int): The player’s unique ID.

      • marketValueCurrency (str): The currency of the player’s market value.

      • dateOfBirthTimestamp (int): The player’s date of birth as a timestamp.

      • proposedMarketValueRaw (Dict[str, Any]): The player’s proposed market value, including:
        • value (int): The market value amount.

        • currency (str): The currency of the market value.

      • fieldTranslations (Dict[str, Any]): Translations of the player’s name and short name in various languages.

    • description (str, optional): A description of the incident (e.g., “Goalkeeper save”).

    • id (int): The unique ID of the incident.

    • isHome (bool, optional): Indicates if the incident involved the home team.

    • incidentClass (str, optional): The class of the incident (e.g., “missed”).

    • reason (str, optional): The reason for the incident (e.g., “goalkeeperSave”).

Return type:

Dict[str, Any]

Example Response:

{
“incidents”: [
{

“text”: “FT”, “homeScore”: 1, “awayScore”: 2, “isLive”: false, “time”: 90, “addedTime”: 999, “timeSeconds”: 5400, “reversedPeriodTime”: 1, “reversedPeriodTimeSeconds”: 0, “incidentType”: “period”

}, {

“time”: 90, “player”: {

“name”: “Raheem Sterling”, “slug”: “raheem-sterling”, “shortName”: “R. Sterling”, “position”: “M”, “jerseyNumber”: “30”, “height”: 170, “userCount”: 49508, “id”: 138534, “marketValueCurrency”: “EUR”, “dateOfBirthTimestamp”: 786844800, “proposedMarketValueRaw”: {

“value”: 21000000, “currency”: “EUR”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “رحيم ستيرلينغ”, “hi”: “रहीम स्टर्लिंग”, “bn”: “রাহিম স্টার্লিং”

}, “shortNameTranslation”: {

“ar”: “ر. سترلينغ”, “hi”: “आर. स्टर्लिंग”, “bn”: “আর. স্টার্লিং”

}

}

}, “description”: “Goalkeeper save”, “id”: 118513874, “addedTime”: 3, “incidentType”: “inGamePenalty”, “isHome”: false, “incidentClass”: “missed”, “reason”: “goalkeeperSave”, “reversedPeriodTime”: 1

}

]

}

Raises:

Exception – If the API request fails or returns an error.

Return type:

Dict[str, Any]

async lineups_away()[source]

Get the lineup of the away team for the given match.

This function retrieves the confirmed lineup of the away team, including details of the players such as name, position, jersey number, market value, and translations in different languages.

Returns:

A dictionary containing the away team’s confirmed lineup and details of each player, including player name, position, jersey number, country, market value, and translations.

Return type:

dict

Example Response:
{
    "confirmed": true,
    "players": [
        {
            "player": {
                "name": "Pau López",
                "slug": "pau-lopez",
                "shortName": "P. López",
                "position": "G",
                "jerseyNumber": "25",
                "height": 189,
                "userCount": 1060,
                "id": 548848,
                "country": {
                    "alpha2": "ES",
                    "alpha3": "ESP",
                    "name": "Spain",
                    "slug": "spain"
                },
                "marketValueCurrency": "EUR",
                "dateOfBirthTimestamp": 787276800,
                "proposedMarketValueRaw": {
                    "value": 3700000,
                    "currency": "EUR"
                },
                "fieldTranslations": {
                    "nameTranslation": {
                        "ar": "باو لوبيز",
                        "hi": "पाऊ लोपेज़",
                        "bn": "পাউ লোপেজ"
                    },
                    "shortNameTranslation": {
                        "ar": "ب. لوبيز",
                        "hi": "पी. लोपेज़",
                        "bn": "পি. লোপেজ"
                    }
                }
            }
        }
    ]
}
async lineups_home()[source]

Get the lineup of the home team for the given match.

This function retrieves the confirmed lineup of the home team, including details of the players such as name, position, jersey number, market value, and translations in different languages.

Returns:

A dictionary containing the home team’s confirmed lineup and details of each player, including player name, position, jersey number, country, market value, and translations.

Return type:

dict

Example Response:
async live_games()[source]

Retrieves all currently live football games.

Returns:

A dictionary containing a list of live football games under the key “events”.

Each game is represented as a dictionary with details such as tournament, teams, scores, and match status.

Return type:

Dict[str, List[Dict[str, Any]]]

Example Response:

{
“events”: [
{
“tournament”: {

“name”: “U20 CONMEBOL Championship, Group B”, “slug”: “u20-conmebol-championship-group-b”, “category”: {

“name”: “South America”, “slug”: “south-america”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1470, “flag”: “south-america”

}, “uniqueTournament”: {

“name”: “U20 CONMEBOL Championship”, “slug”: “u20-conmebol-championship”, “primaryColorHex”: “#348925”, “secondaryColorHex”: “#afc402”, “category”: {

“name”: “South America”, “slug”: “south-america”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1470, “flag”: “south-america”

}, “userCount”: 11952, “id”: 632, “hasPerformanceGraphFeature”: false, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 0, “isGroup”: true, “groupName”: “Group B”, “isLive”: false, “id”: 10066

}, “season”: {

“name”: “U20 CONMEBOL Ch.ship 2025”, “year”: “2025”, “editor”: false, “id”: 68914

}, “roundInfo”: {

“round”: 4

}, “customId”: “xdjsiAn”, “status”: {

“code”: 6, “description”: “1st half”, “type”: “inprogress”

}, “homeTeam”: {

“name”: “Ecuador U20”, “slug”: “ecuador-u20”, “shortName”: “Ecuador U20”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 4401, “nameCode”: “ECU”, “disabled”: false, “national”: true, “type”: 0, “id”: 33758, “country”: {

“alpha2”: “EC”, “alpha3”: “ECU”, “name”: “Ecuador”, “slug”: “ecuador”

}, “entityType”: “team”, “teamColors”: {

“primary”: “#ffff00”, “secondary”: “#000063”, “text”: “#000063”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الإكوادور تحت 20”, “ru”: “Эквадор U20”

}

}

}, “awayTeam”: {

“name”: “Brazil U20”, “slug”: “brazil-u20”, “shortName”: “Brazil U20”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 39092, “nameCode”: “BRA”, “disabled”: false, “national”: true, “type”: 0, “id”: 22672, “country”: {

“alpha2”: “BR”, “alpha3”: “BRA”, “name”: “Brazil”, “slug”: “brazil”

}, “entityType”: “team”, “teamColors”: {

“primary”: “#ffff00”, “secondary”: “#009933”, “text”: “#009933”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “البرازيل تحت 20”, “ru”: “Бразилия U20”

}

}

}, “homeScore”: {

“current”: 0, “display”: 0, “period1”: 0, “normaltime”: 0

}, “awayScore”: {

“current”: 0, “display”: 0, “period1”: 0, “normaltime”: 0

}, “time”: {

“initial”: 0, “max”: 2700, “extra”: 540, “currentPeriodStartTimestamp”: 1738279810

}, “changes”: {

“changes”: [

“homeScore.period1”, “homeScore.normaltime”, “awayScore.period1”, “awayScore.normaltime”

], “changeTimestamp”: 1738279909

}, “hasGlobalHighlights”: false, “hasEventPlayerStatistics”: true, “hasEventPlayerHeatMap”: true, “detailId”: 1, “crowdsourcingDataDisplayEnabled”: false, “id”: 13123315, “statusTime”: {

“prefix”: “”, “initial”: 0, “max”: 2700, “timestamp”: 1738279810, “extra”: 540

}, “startTimestamp”: 1738279800, “slug”: “ecuador-u20-brazil-u20”, “lastPeriod”: “period1”, “finalResultOnly”: false, “feedLocked”: true, “isEditor”: false

}

]

}

async managers()[source]

Get the managers for the given match.

This function retrieves the managers for the home and away teams in the given match. It returns the managers’ names, IDs, and translations in different languages.

Returns:

A dictionary containing the home and away team managers’ details, including names, IDs, and translations in multiple languages.

Return type:

dict

Example Response:
{
    "homeManager": {
        "name": "Michel",
        "slug": "michel",
        "shortName": "Michel",
        "id": 788163,
        "fieldTranslations": {
            "nameTranslation": {
                "ar": "ميشيل",
                "hi": "मिशेल",
                "bn": "মিশেল"
            },
            "shortNameTranslation": {
                "ar": "ميشيل",
                "hi": "मिशेल",
                "bn": "মিশেল"
            }
        }
    },
    "awayManager": {
        "name": "Mikel Arteta",
        "slug": "mikel-arteta",
        "shortName": "M. Arteta",
        "id": 794075,
        "fieldTranslations": {
            "nameTranslation": {
                "ar": "ميكيل أرتيتا",
                "hi": "मिकेल आर्टेटा",
                "bn": "মিকেল আর্তেতা"
            },
            "shortNameTranslation": {
                "ar": "م. أرتيتا",
                "hi": "एम. आर्टेटा",
                "bn": "এম. আরতেতা"
            }
        }
    }
}
async match_channels()[source]

Get all the available channels for the given match, grouped by country code.

This function returns a dictionary of available channels for a match based on different country codes. The user can use get_channel() to fetch the channel names.

Example Response:

{
“countryChannels”: {

“TG”: [2781, 3025, 644], # Country code “TG” with channel IDs “EN”: [1234, 5678], # Country code “EN” with channel IDs “US”: [9876, 5432] # Country code “US” with channel IDs

}

}

Returns:

A dictionary containing country codes as keys and a list of channel IDs as values.

Return type:

dict

async match_odds()[source]

Fetches the match odds for the specified match.

Returns:

A dictionary containing the match odds data. The structure includes:
  • markets (List[Dict[str, Any]]): A list of market objects, each containing:
    • sourceId (int): The source ID of the market.

    • structureType (int): The structure type of the market.

    • marketId (int): The ID of the market.

    • marketName (str): The name of the market.

    • isLive (bool): Indicates if the market is live.

    • fid (int): The fid of the market.

    • suspended (bool): Indicates if the market is suspended.

    • id (int): The ID of the market.

    • choices (List[Dict[str, Any]]): A list of choices/outcomes for the market, each containing:
      • initialFractionalValue (str): The initial fractional odds value.

      • fractionalValue (str): The current fractional odds value.

      • sourceId (int): The source ID of the choice.

      • name (str): The name of the choice.

      • winning (bool): Indicates if the choice is winning.

      • change (int): The change in odds.

Return type:

Dict[str, Any]

Example Response:

{
“markets”: [
{

“sourceId”: 168664758, “structureType”: 1, “marketId”: 1, “marketName”: “Full time”, “isLive”: false, “fid”: 168664758, “suspended”: false, “id”: 1962878117, “choices”: [

{

“initialFractionalValue”: “17/4”, “fractionalValue”: “9/2”, “sourceId”: 2114984998, “name”: “1”, “winning”: false, “change”: 1

}, {

“initialFractionalValue”: “10/3”, “fractionalValue”: “31/10”, “sourceId”: 2114985000, “name”: “X”, “winning”: false, “change”: -1

}, {

“initialFractionalValue”: “53/100”, “fractionalValue”: “57/100”, “sourceId”: 2114985001, “name”: “2”, “winning”: true, “change”: 1

}

]

}

]

}

Raises:

Exception – If the API request fails or returns an error.

Return type:

Dict[str, Any]

async motm()[source]

Get the Man of the Match (MOTM) for the given game.

This function returns the player who was awarded Man of the Match based on the performance in a given game. The result includes the player’s details such as name, position, jersey number, market value, and translations for the player’s name in various languages.

Example Response:

{

“value”: “7.8”, “label”: “rating”, “player”: {

“name”: “Pau López”, “slug”: “pau-lopez”, “shortName”: “P. López”, “position”: “G”, “jerseyNumber”: “25”, “height”: 189, “userCount”: 1060, “id”: 548848, “marketValueCurrency”: “EUR”, “dateOfBirthTimestamp”: 787276800, “proposedMarketValueRaw”: {

“value”: 3700000, “currency”: “EUR”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “باو لوبيز”, “hi”: “पाऊ लोपेज़”, “bn”: “পাউ লোপেজ”

}, “shortNameTranslation”: {

“ar”: “ب. لوبيز”, “hi”: “पी. लोपेज़”, “bn”: “পি. লোপেজ”

}

}

}

}

Returns:

The player information for the Man of the Match, including player details and ratings. If no player of the match is found, it returns None.

Return type:

dict

async pre_match_form()[source]

Get the pre-match form of the two teams for the given game.

This function returns the recent form of both the home and away teams, along with their average ratings, position, and points value.

Example Response:

{
“homeTeam”: {

“avgRating”: “6.81”, “position”: 31, “value”: “3”, “form”: [

“W”, # Win “L”, # Loss “L”, # Loss “L”, # Loss “L” # Loss

]

}, “awayTeam”: {

“avgRating”: “7.08”, “position”: 3, “value”: “16”, “form”: [

“W”, # Win “L”, # Loss “W”, # Win “W”, # Win “W” # Win

]

}, “label”: “Pts” # Label for the points value (optional)

}

Returns:

A dictionary containing the pre-match form data for both teams, including their recent results, average ratings, and positions.

Return type:

dict

async shotmap(team_id=None)[source]

Retrieves the shot map for the given match.

Parameters:

team_id (int) – Show specific shotmap data for one of the teams for the selected match, Some sports like basketball require the team_id as the request will fail without it.

Return type:

Dict

This function returns a list of shot events that occurred during the match, including details about each shot, such as the player who took the shot, the shot type, situation, coordinates, expected goal (xG), and other relevant information such as body part used and goal mouth location.

Returns:

A dictionary containing a list of shot events, including player information, shot type, coordinates, xG value, and additional shot data.

Return type:

dict

Parameters:

team_id (int | None)

Example Response:
{
    "shotmap": [
        {
            "player": {
                "name": "Mikel Merino",
                "slug": "mikel-merino",
                "shortName": "M. Merino",
                "position": "M",
                "jerseyNumber": "23",
                "userCount": 7943,
                "id": 592010,
                "fieldTranslations": {
                    "nameTranslation": {
                        "ar": "ميكيل ميرينو",
                        "hi": "मिकेल मेरिनो",
                        "bn": "মাইকেল মেরিনো"
                    },
                    "shortNameTranslation": {
                        "ar": "م. ميرينو",
                        "hi": "एम. मेरिनो",
                        "bn": "এম. মেরিনো"
                    }
                }
            },
            "isHome": false,
            "shotType": "block",
            "situation": "assisted",
            "playerCoordinates": {
                "x": 15.8,
                "y": 33.6,
                "z": 0
            },
            "bodyPart": "left-foot",
            "goalMouthLocation": "low-centre",
            "goalMouthCoordinates": {
                "x": 0,
                "y": 50.3,
                "z": 19
            },
            "blockCoordinates": {
                "x": 11.8,
                "y": 37.7,
                "z": 0
            },
            "xg": 0.073860235512257,
            "xgot": 0,
            "id": 4347934,
            "time": 90,
            "addedTime": 4,
            "timeSeconds": 5637,
            "draw": {
                "start": {
                    "x": 33.6,
                    "y": 15.8
                },
                "block": {
                    "x": 37.7,
                    "y": 11.8
                },
                "end": {
                    "x": 49.7,
                    "y": 0
                },
                "goal": {
                    "x": 49.7,
                    "y": 81
                }
            },
            "reversedPeriodTime": 1,
            "reversedPeriodTimeSeconds": 663,
            "incidentType": "shot"
        }
    ]
}
async stats()[source]

Retrieves the statistics for the given game.

The statistics provide a detailed overview of various match metrics, such as ball possession, shots, and other performance indicators for both teams.

Example Response:

{ “statistics”: [

{ “period”: “ALL”, “groups”: [

{ “groupName”: “Match overview”, “statisticsItems”: [

{ “name”: “Ball possession”, “home”: “39%”, “away”: “61%”, “compareCode”: 2, “statisticsType”: “positive”, “valueType”: “event”, “homeValue”: 39, “awayValue”: 61, “renderType”: 2, “key”: “ballPossession” }, …

] }, …

Returns:

A dictionary containing the statistics for the match, including various categories like

”Match overview”, and performance indicators for both home and away teams.

Return type:

dict

async team_streaks()[source]

Retrieves team streaks for the selected match.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async top_team_streaks()[source]

Fetches the top current team streaks.

Returns:

A dictionary containing the match odds data.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails or returns an error.

async total_games()[source]

Retrieves the total count of today’s football games and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live football games.

  • ”total”: The total number of football games scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 21, “total”: 270

}

async votes()[source]

Get the SofaScore votes for the given match.

This function returns various votes related to a match, including votes for the most popular outcome (home win, away win, draw), as well as votes for specific events, such as who will score first or whether both teams will score.

Example Response:

{
“vote”: {

“vote1”: 8779, “vote2”: 98254, “voteX”: 11223

}, “bothTeamsToScoreVote”: {

“voteYes”: 16294, “voteNo”: 8891

}, “firstTeamToScoreVote”: {

“voteHome”: 2429, “voteNoGoal”: 404, “voteAway”: 20338

}, “whoShouldHaveWonVote”: {

“vote1”: 0, “vote2”: 0

}

}

Returns:

A dictionary containing the vote results, including vote counts for different match outcomes and events.

Return type:

dict

async win_probability()[source]

Retrieves the match win probability, Does not provide data for all sports.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

sofascore_wrapper.mma module

class sofascore_wrapper.mma.MMA(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async fighter_career_stats(fighter_id)[source]

Retrieves career statistics for a given fighter.

Parameters:

fighter_id (int) – The ID of the fighter.

Returns:

A dictionary containing the fighter’s career statistics.

Return type:

Dict[str, int]

Example Response:
{
    "issued": {
        "strikes": {
            "total": {
                "landed": {
                    "roundAvg": 46.64
                }
            },
            "distance": {
                "landed": {
                    "roundAvg": 38.45,
                    "roundPct": 82.5
                }
            },
            "ground": {
                "landed": {
                    "roundAvg": 8.18,
                    "roundPct": 17.5
                }
            }
        },
        "significantStrikes": {
            "total": {
                "landed": {
                    "roundAvg": 20.27,
                    "roundPct": 43.5
                }
            }
        }
    }
}
Example Usage:
stats = await mma.fighter_career_stats(fighter_id=12345)
print(stats["issued"]["strikes"]["total"]["landed"]["roundAvg"])  # Output: 46.64
async fighter_image(fighter_id)[source]

Returns the fighter image

Parameters:

fighter_id (int)

Return type:

Dict

async fighter_info(fighter_id)[source]

Pulls info about the fighter

Parameters:

fighter_id (int) – The ID of the fighter.

Returns:

A list of dictionaries containing details about previous fights, including tournament, season, venue, teams, scores, and more. Returns None if no data is found.

Return type:

Optional[List[Dict[str, Any]]]

Example Usage:
fighter_data = await mma.fighter_info(fighter_id=12345)
if fighter_data:
    print(fighter_data["team"]["name"])  # Example Output: Dricus Du Plessis
async fighter_last_fights(fighter_id)[source]

Retrieves previous fights for a given fighter.

Parameters:

fighter_id (int) – The ID of the fighter.

Returns:

A list of dictionaries containing details about previous fights, including tournament, season, venue, teams, scores, and more.

Return type:

List[Dict[str, Any]]

Example Response:
{
    "events": [
        {
            "venue": {
                "city": { "name": "Sydney" },
                "name": "Qudos Bank Arena",
                "country": { "alpha2": "AU", "name": "Australia" }
            },
            "fightType": "maincard",
            "weightClass": "middle",
            "tournament": {
                "name": "UFC 312: Du Plessis vs. Strickland 2",
                "id": 144072,
                "startTimestamp": 1739055600
            },
            "season": { "name": "UFC 312", "year": "2025" },
            "status": { "description": "Not started", "type": "notstarted" },
            "homeTeam": { "name": "Dricus Du Plessis", "id": 461874 },
            "awayTeam": { "name": "Sean Strickland", "id": 461861 }
        }
    ],
    "hasNextPage": false
}
Example Usage:
upcoming_fights = await mma.fighter_last_fights(fighter_id=12345)
print(upcoming_fights[0]["tournament"]["name"])  # Output: UFC 312: Du Plessis vs. Strickland 2
async fighter_next_fights(fighter_id)[source]

Retrieves upcoming fights for a given fighter.

Parameters:

fighter_id (int) – The ID of the fighter.

Returns:

A list of dictionaries containing details about upcoming fights, including tournament, season, venue, teams, scores, and more.

Return type:

List[Dict[str, Any]]

Example Response:
{
    "events": [
        {
            "venue": {
                "city": { "name": "Sydney" },
                "name": "Qudos Bank Arena",
                "country": { "alpha2": "AU", "name": "Australia" }
            },
            "fightType": "maincard",
            "weightClass": "middle",
            "tournament": {
                "name": "UFC 312: Du Plessis vs. Strickland 2",
                "id": 144072,
                "startTimestamp": 1739055600
            },
            "season": { "name": "UFC 312", "year": "2025" },
            "status": { "description": "Not started", "type": "notstarted" },
            "homeTeam": { "name": "Dricus Du Plessis", "id": 461874 },
            "awayTeam": { "name": "Sean Strickland", "id": 461861 }
        }
    ],
    "hasNextPage": false
}
Example Usage:
upcoming_fights = await mma.fighter_next_fights(fighter_id=12345)
print(upcoming_fights[0]["tournament"]["name"])  # Output: UFC 312: Du Plessis vs. Strickland 2
async fighter_rankings(fighter_id)[source]

Retrieves rankings and previous fights for a given fighter.

Parameters:

fighter_id (int) – The ID of the fighter.

Returns:

A list of dictionaries containing details about previous fights, including tournament, season, venue, teams, scores, and more. Returns None if no data is found.

Return type:

Optional[List[Dict[str, Any]]]

Example Usage:
fighter_data = await mma.fighter_rankings(fighter_id=12345)
if fighter_data:
    print(fighter_data[0]["tournament"]["name"])  # Example Output: UFC 312: Du Plessis vs. Strickland 2
async fights_by_date(sport='mma', date=None)[source]

Retrieves scheduled fixtures for a given sport on a specific date.

Parameters:
  • sport (str) – The sport for which to retrieve fixtures. Available options include: - “football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker” - “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “e-sports”, “handball” - “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton” - “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

  • date (str, optional) – The date in “YYYY-MM-DD” format. If not provided, the current date is used.

Returns:

A dictionary containing fixture details for the specified sport and date, including match details, teams, venue, and start time.

Return type:

Dict[str, Any]

Raises:

ValueError – If the provided sport is not in the list of supported sports.

Example Response:
{
    "events": [
        {
            "venue": {
                "city": {"name": "Sydney"},
                "name": "Qudos Bank Arena",
                "country": {"alpha2": "AU", "name": "Australia"}
            },
            "tournament": {
                "name": "UFC 312: Du Plessis vs. Strickland 2",
                "category": {"name": "World", "sport": {"name": "Mixed Martial Arts"}}
            },
            "homeTeam": {"name": "Aleksandre Topuria", "shortName": "A. Topuria"},
            "awayTeam": {"name": "Colby Thicknesse", "shortName": "C. Thicknesse"},
            "status": {"description": "Not started"},
            "startTimestamp": 1739055600
        }
    ]
}
async live_fights()[source]

Retrieve all currently live MMA events.

Returns:

A dictionary containing a list of live MMA events under the key “events”. Each event is represented as a dictionary with details such as tournament, teams, scores, and match status.

Return type:

Dict[str, List[Dict[str, Any]]]

Example

The response follows this structure:

{
    "events": [
        {
            "fightType": "maincard",
            "tournament": {
                "name": "FS - MAT B - World OG Qualif.",
                "slug": "fs-mat-b-world-og-qualif",
                "category": {
                    "name": "World",
                    "slug": "world",
                    "sport": {
                        "name": "Mixed Martial Arts",
                        "slug": "mma",
                        "id": 76
                    },
                    "id": 1708,
                    "flag": "international"
                },
                "id": 134691,
                "startTimestamp": 1715414400,
                "location": "Istanbul"
            },
            "season": {
                "name": "FS - MAT B - World OG Qualif.",
                "year": "2024",
                "id": 63132
            },
            "status": {
                "code": 58,
                "description": "Awaiting announcement",
                "type": "inprogress"
            },
            "homeTeam": {
                "name": "Thomas John Mcglinchey BARNS",
                "shortName": "T. J. M. BARNS",
                "id": 528778,
                "teamColors": {
                    "primary": "#374df5",
                    "secondary": "#374df5",
                    "text": "#ffffff"
                }
            },
            "awayTeam": {
                "name": "Maxwell Lemar LACEY GARITA",
                "shortName": "M. L. L. GARITA",
                "id": 528779,
                "teamColors": {
                    "primary": "#374df5",
                    "secondary": "#374df5",
                    "text": "#ffffff"
                }
            },
            "homeScore": {},
            "awayScore": {},
            "time": {
                "current": 7,
                "period1": 7,
                "totalPeriodCount": 3
            },
            "id": 12490984,
            "startTimestamp": 1715415495,
            "slug": "maxwell-lemar-lacey-garita-thomas-john-mcglinchey-barns"
        }
    ]
}
async main_events_date(date=None)[source]

Pulls MMA main events for the provided date, or today.

Parameters:

date (Optional) – YYYY-MM-DD provided date.

Returns:

A list of dictionaries containing details about previous fights, including tournament, season, venue, teams, scores, and more. Returns None if no data is found.

Return type:

Optional[List[Dict[str, Any]]]

Example Usage:
fighter_data = await mma.main_events_date(date="2025-02-06")
async main_events_month(organisation_id, date=None)[source]

Pulls MMA main events for the provided month, or the current month.

Parameters:
  • date (Optional) – YYYY-MM provided date.

  • organisation_id (int)

Returns:

A list of dictionaries containing details about previous fights, including tournament, season, venue, teams, scores, and more. Returns None if no data is found.

Return type:

Optional[List[Dict[str, Any]]]

Example Usage:
fighter_data = await mma.main_events_month(date="2025-02")
async mma_tournaments()[source]

Pulls active MMA tournaments such as UFC and BELLATOR.

Returns:

A list of dictionaries, including tournament info

Return type:

Optional[List[Dict[str, Any]]]

Example Usage:
fighter_data = await mma.mma_tournaments()
async mma_tournaments_months(tournament_id)[source]

Pulls which months has fights for the provided tournament

Returns:

A list of dictionaries, including tournament info

Return type:

Optional[List[Dict[str, Any]]]

Parameters:

tournament_id (int)

Example Response:
{
    "monthsWithEvents": [
        {
            "month": 9,
            "year": 2024
        },
...
Example Usage:
fighter_data = await mma.mma_tournaments_months(19906)
async ranking_summary(tournament_id)[source]

Pulls the ranking summary for the chosen tournament

Returns:

A list of dictionaries, including tournament info

Return type:

Optional[List[Dict[str, Any]]]

Parameters:

tournament_id (int)

Example Usage:
fighter_data = await mma.ranking_summary(19906)
async rankings(ranking_id)[source]

Pulls the full ranking data from the ranking provided by ranking_summary()

Returns:

A list of dictionaries, including tournament info

Return type:

Optional[List[Dict[str, Any]]]

Parameters:

ranking_id (int)

Example Usage:
fighter_data = await mma.ranking_summary(19906)
async total_fights()[source]

Retrieves the total count of today’s basketball games and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live basketball games.

  • ”total”: The total number of basketball games scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 21, “total”: 270

}

async tournament_image(tournament_id)[source]

Returns the tournament image

Parameters:

tournament_id (int)

Return type:

Dict

async tournament_info(tournament_id)[source]

Pulls info about the provided tournament

Returns:

A list of dictionaries, including tournament info

Return type:

Optional[List[Dict[str, Any]]]

Parameters:

tournament_id (int)

Example Usage:
fighter_data = await mma.tournament_info(19906)

sofascore_wrapper.motorsport module

class sofascore_wrapper.motorsport.Motorsport(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async categories()[source]

Retrieves all the motorsport categories such as Rally, F1.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Example Response:

{
“categories”: [
{

“name”: “DTM”, “slug”: “dtm”, “sport”: {

“name”: “Motorsport”, “slug”: “motorsport”, “id”: 11

},

“priority”: 1, “uniqueStages”: [

{

“name”: “DTM”, “slug”: “dtm”, “id”: 10, “primaryColorHex”: “#0d2750”, “secondaryColorHex”: “#99cfff”

}

],

“id”: 198, “flag”: “dtm”

},

async current_season(motorsport_id)[source]

Retrieves the current season for the selected motorsport (e.g., Formula 1, Rally).

Parameters:

motorsport_id (int) – The ID of the motorsport category.

Returns:

A dictionary containing season details for the specified motorsport.

Return type:

Dict[str, int]

Example Response:
209766
Example Usage:
current_season = await api.current_season(motorsport_id=40)
print(current_season)  # Output: "209766"
async driver_image(driver_id)[source]

Returns the driver image

Parameters:

driver_id (int)

Return type:

str

async driver_info(driver_id)[source]

Retrieves detailed information about a driver.

Parameters:

driver_id (int) – The ID of the driver.

Returns:

A dictionary containing driver details.

Return type:

dict

Example Response:
{
"team": {
    "name": "Verstappen M.",
    "shortName": "Verstappen M.",
    "country": {
    "name": "Netherlands",
    "alpha2": "NL",
    "alpha3": "NLD"
    },
    "playerTeamInfo": {
    "residence": "Monte Carlo, Monaco",
    "birthplace": "Hasselt, Belgium",
    "height": 1.8,
    "weight": 67,
    "number": 1,
    "birthDateTimestamp": 875577600
    },
    "parentTeam": {
    "name": "Red Bull Racing",
    "country": {
        "name": "United Kingdom",
        "alpha2": "GB",
        "alpha3": "GBR"
    }
    },
    "teamColors": {
    "primary": "#374df5",
    "secondary": "#374df5",
    "text": "#ffffff"
    }
}
}
Example Usage:
driver_details = await api.driver_info(driver_id=191417)
print(driver_details)
async driver_races(driver_id, season_id)[source]

Retrieves a list of races in which the driver participated for the given season

Parameters:
  • driver_id (int) – The ID of the driver.

  • season_id (int)

Returns:

A dictionary containing season details for the given driver.

Return type:

dict

Example Usage:
driver_races = await api.driver_races(driver_id=191417, season_id=206455)
print(driver_races)
async driver_rankings(season_id)[source]

Retrieves the current standings of drivers for a given motorsport season.

Parameters:

season_id (int) – The ID of the season for which to retrieve driver rankings.

Returns:

The driver rankings for the given season, including details such as position, points, victories, and other stats.

Return type:

int

Example Response:
{
    "standings": [
        {
            "team": {
                "name": "Verstappen M.",
                "slug": "verstappen-max",
                "shortName": "Verstappen M.",
                "gender": "M",
                "sport": {
                    "name": "Motorsport",
                    "slug": "motorsport",
                    "id": 11
                },
                "category": {
                    "name": "Formula 1",
                    "slug": "formula-1",
                    "sport": {
                        "name": "Motorsport",
                        "slug": "motorsport",
                        "id": 11
                    },
                    "id": 36,
                    "country": {},
                    "flag": "formula-1"
                },
                "userCount": 31878,
                "nameCode": "VER",
                "disabled": false,
                "national": false,
                "parentTeam": {
                    "name": "Red Bull Racing",
                    "slug": "red-bull-racing",
                    "shortName": "Red Bull Racing",
                    "gender": "M",
                    "sport": {
                        "name": "Motorsport",
                        "slug": "motorsport",
                        "id": 11
                    },
                    "category": {
                        "name": "Formula 1",
                        "slug": "formula-1",
                        "sport": {
                            "name": "Motorsport",
                            "slug": "motorsport",
                            "id": 11
                        },
                        "id": 36,
                        "country": {},
                        "flag": "formula-1"
                    },
                    "userCount": 0,
                    "nameCode": "RBR",
                    "disabled": false,
                    "national": false,
                    "type": 0,
                    "id": 214902,
                    "country": {
                        "alpha2": "GB",
                        "alpha3": "GBR",
                        "name": "United Kingdom",
                        "slug": "united-kingdom"
                    },
                    "entityType": "team",
                    "flag": "great-britain",
                    "teamColors": {
                        "primary": "#1e40ff",
                        "secondary": "#222226",
                        "text": "#222226"
                    }
                },
                "type": 1,
                "id": 191417,
                "country": {
                    "alpha2": "NL",
                    "alpha3": "NLD",
                    "name": "Netherlands",
                    "slug": "netherlands"
                },
                "entityType": "team",
                "flag": "netherlands",
                "teamColors": {
                    "primary": "#374df5",
                    "secondary": "#374df5",
                    "text": "#ffffff"
                }
            },
            "points": 437,
            "position": 1,
            "victories": 9,
            "racesStarted": 24,
            "racesWithPoints": 23,
            "polePositions": 8,
            "podiums": 14,
            "fastestLaps": 3,
            "updatedAtTimestamp": 1733672824
        }
    ]
}
Example Usage:
# Example usage of the driver_rankings method
standings = await api.driver_rankings(season_id=206455)
print(standings)  # Output: Driver rankings for the given season
async driver_seasons(driver_id)[source]

Retrieves a list of seasons in which a driver has participated.

Parameters:

driver_id (int) – The ID of the driver.

Returns:

A dictionary containing season details for the given driver.

Return type:

dict

Example Usage:
driver_seasons = await api.driver_seasons(driver_id=191417)
print(driver_seasons)
async featured_races()[source]

Retrieves the featured motorsport races.

Returns:

A dictionary containing details about upcoming motorsport races.

Return type:

Dict[str, int]

Example Response:
{
"stages": [
    {
    "uniqueStage": {
        "category": {
        "name": "Formula E",
        "slug": "formula-e",
        "sport": {
            "name": "Motorsport",
            "slug": "motorsport",
            "id": 11
        },
        "id": 1321,
        "flag": "formula-e"
        },
        "name": "Formula E",
        "slug": "formula-e",
        "id": 68
    },
    "description": "GP Diriyah 1",
    "slug": "gp-diriyah-1",
    "type": {
        "id": 2,
        "name": "Event"
    },
    "status": {
        "description": "Not started",
        "type": "notstarted"
    },
    "year": "2025",
    "id": 210100,
    "country": {
        "alpha2": "SA",
        "name": "Saudi Arabia"
    },
    "name": "GP Diriyah 1",
    "info": {
        "circuit": "Jeddah Corniche Circuit",
        "circuitCity": "Jeddah",
        "circuitCountry": "Saudi Arabia",
        "circuitLength": 6174,
        "laps": 50,
        "raceDistance": 308700
    },
    "startDateTimestamp": 1739460600,
    "endDateTimestamp": 1739556000,
    "seasonStageName": "Formula E 2025",
    "flag": "saudi-arabia",
    "stageParent": {
        "description": "Formula E 2025",
        "id": 210097,
        "startDateTimestamp": 1733513400
    }
    }
]
}
Example Usage:
featured_races = await api.motorsport_featured_races()
print(featured_races["stages"][0]["name"])  # Output: "GP Diriyah 1"
async live_races()[source]

Retrieve all currently live motorsport events.

Returns:

A dictionary containing a list of live motorsport events under the key “events”. Each event is represented as a dictionary with details such as stage, teams, results, and race status.

Return type:

Dict[str, List[Dict[str, Any]]]

async race_image(stage_id)[source]

Returns the race track image

Parameters:

stage_id (int)

Return type:

str

async race_info(stage_id)[source]

Retrieves detailed information about a specific race stage for a selected motorsport event (e.g., Formula 1, Rally) based on the provided stage ID.

Parameters:

stage_id (int) – The ID of the specific race stage (e.g., Formula 1 Grand Prix event).

Returns:

A dictionary containing details about the selected race stage, including the name, description, country, circuit info, start and end times, and more.

Return type:

Dict[str, int]

Example Response:
{
    "stage": {
        "uniqueStage": {
            "category": {
                "name": "Formula 1",
                "slug": "formula-1",
                "sport": {
                    "name": "Motorsport",
                    "slug": "motorsport",
                    "id": 11
                },
                "id": 36,
                "country": {},
                "flag": "formula-1"
            },
            "name": "Formula 1",
            "slug": "formula-1",
            "id": 40
        },
        "description": "Australia GP",
        "slug": "formula-1-gp",
        "type": {
            "id": 2,
            "name": "Event"
        },
        "status": {
            "description": "Not started",
            "type": "notstarted"
        },
        "year": "2025",
        "id": 209767,
        "country": {
            "alpha2": "AU",
            "name": "Australia"
        },
        "name": "Australia GP",
        "info": {
            "circuit": "Melbourne Grand Prix Circuit",
            "circuitCity": "Melbourne",
            "circuitCountry": "Australia",
            "circuitLength": 5278,
            "laps": 58,
            "raceDistance": 306124
        },
        "startDateTimestamp": 1741916100,
        "endDateTimestamp": 1742104800,
        "seasonStageName": "Formula 1 2025",
        "flag": "australia",
        "stageParent": {
            "description": "Formula 1 2025",
            "id": 209766,
            "startDateTimestamp": 1741916100
        }
    }
}
Example Usage:
# Example usage of the race_info method
race_details = await api.race_info(stage_id=40)
print(race_details)  # Output: Details about the Australia GP stage
async race_results(stage_id)[source]

Retrieves the driver rankings for a specific race

Parameters:

stage_id (int) – The ID of the race (stage)

Returns:

The driver rankings for the given season, including details such as position, points, victories, and other stats.

Return type:

int

Example Response:
{
    "standings": [
        {
            "team": {
                "name": "Verstappen M.",
                "slug": "verstappen-max",
                "shortName": "Verstappen M.",
                "gender": "M",
                "sport": {
                    "name": "Motorsport",
                    "slug": "motorsport",
                    "id": 11
                },
                "category": {
                    "name": "Formula 1",
                    "slug": "formula-1",
                    "sport": {
                        "name": "Motorsport",
                        "slug": "motorsport",
                        "id": 11
                    },
                    "id": 36,
                    "country": {},
                    "flag": "formula-1"
                },
                "userCount": 31878,
                "nameCode": "VER",
                "disabled": false,
                "national": false,
                "parentTeam": {
                    "name": "Red Bull Racing",
                    "slug": "red-bull-racing",
                    "shortName": "Red Bull Racing",
                    "gender": "M",
                    "sport": {
                        "name": "Motorsport",
                        "slug": "motorsport",
                        "id": 11
                    },
                    "category": {
                        "name": "Formula 1",
                        "slug": "formula-1",
                        "sport": {
                            "name": "Motorsport",
                            "slug": "motorsport",
                            "id": 11
                        },
                        "id": 36,
                        "country": {},
                        "flag": "formula-1"
                    },
                    "userCount": 0,
                    "nameCode": "RBR",
                    "disabled": false,
                    "national": false,
                    "type": 0,
                    "id": 214902,
                    "country": {
                        "alpha2": "GB",
                        "alpha3": "GBR",
                        "name": "United Kingdom",
                        "slug": "united-kingdom"
                    },
                    "entityType": "team",
                    "flag": "great-britain",
                    "teamColors": {
                        "primary": "#1e40ff",
                        "secondary": "#222226",
                        "text": "#222226"
                    }
                },
                "type": 1,
                "id": 191417,
                "country": {
                    "alpha2": "NL",
                    "alpha3": "NLD",
                    "name": "Netherlands",
                    "slug": "netherlands"
                },
                "entityType": "team",
                "flag": "netherlands",
                "teamColors": {
                    "primary": "#374df5",
                    "secondary": "#374df5",
                    "text": "#ffffff"
                }
            },
            "points": 437,
            "position": 1,
            "victories": 9,
            "racesStarted": 24,
            "racesWithPoints": 23,
            "polePositions": 8,
            "podiums": 14,
            "fastestLaps": 3,
            "updatedAtTimestamp": 1733672824
        }
    ]
}
Example Usage:
# Example usage of the team_rankings method
standings = await api.team_rankings(season_id=206455)
print(standings)  # Output: Driver rankings for the given season
async races(season_id)[source]

Retrieves all the races for the selected season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

season_id (int)

Example Response:

{

“stages”: [

{ “uniqueStage”: {

“category”: { “name”: “Formula 1”, “slug”: “formula-1”, “sport”: {

“name”: “Motorsport”, “slug”: “motorsport”, “id”: 11

}, “id”: 36, “country”: {

}, “flag”: “formula-1” }, “name”: “Formula 1”, “slug”: “formula-1”, “id”: 40

}, “description”: “Australia GP”, “slug”: “formula-1-gp”, “type”: {

“id”: 2, “name”: “Event”

}, “status”: {

“description”: “Not started”, “type”: “notstarted”

}, “year”: “2025”, “id”: 209767, “country”: {

“alpha2”: “AU”, “name”: “Australia”

}, “name”: “Australia GP”, “info”: {

“circuit”: “Melbourne Grand Prix Circuit”, “circuitCity”: “Melbourne”, “circuitCountry”: “Australia”, “circuitLength”: 5278, “laps”: 58, “raceDistance”: 306124

}, “startDateTimestamp”: 1741916100, “endDateTimestamp”: 1742104800, “seasonStageName”: “Formula 1 2025”, “flag”: “australia”, “stageParent”: {

“description”: “Formula 1 2025”, “id”: 209766, “startDateTimestamp”: 1741916100

} },

async seasons(motorsport_id)[source]

Retrieves season details for a specific motorsport category (e.g., Formula 1, Rally).

Parameters:

motorsport_id (int) – The ID of the motorsport category.

Returns:

A dictionary containing season details for the specified motorsport.

Return type:

Dict[str, int]

Example Response:
{
"seasons": [
    {
    "uniqueStage": {
        "category": {
        "name": "Formula 1",
        "slug": "formula-1",
        "sport": {
            "name": "Motorsport",
            "slug": "motorsport",
            "id": 11
        },
        "id": 36,
        "flag": "formula-1"
        },
        "name": "Formula 1",
        "slug": "formula-1",
        "id": 40
    },
    "description": "Formula 1 2025",
    "slug": "formula-1-2025",
    "year": "2025",
    "id": 209766,
    "name": "Formula 1 2025",
    "startDateTimestamp": 1741916100,
    "endDateTimestamp": 1765119600
    }
]
}
Example Usage:
seasons_data = await api.seasons(motorsport_id=40)
print(seasons_data["seasons"][0]["name"])  # Output: "Formula 1 2025"
async team_image(team_id)[source]

Returns the team image

Parameters:

team_id (int)

Return type:

str

async team_info(team_id)[source]

Retrieves detailed information about a team.

Parameters:

team_id (int) – The ID of the team.

Returns:

A dictionary containing team details.

Return type:

dict

Example Response:
{
"team": {
    "name": "Red Bull Racing",
    "slug": "red-bull-racing",
    "shortName": "Red Bull Racing",
    "gender": "M",
    "sport": {
    "name": "Motorsport",
    "slug": "motorsport",
    "id": 11
    },
    "category": {
    "name": "Formula 1",
    "slug": "formula-1",
    "sport": {
        "name": "Motorsport",
        "slug": "motorsport",
        "id": 11
    },
    "id": 36,
    "country": {

    },
    "flag": "formula-1"
    },
    "userCount": 0,
    "nameCode": "RBR",
    "disabled": false,
    "national": false,
    "type": 0,
    "id": 214902,
    "country": {
    "alpha2": "GB",
    "alpha3": "GBR",
    "name": "United Kingdom",
    "slug": "united-kingdom"
    },
    "entityType": "team",
    "fullName": "Red Bull Racing",
    "teamColors": {
    "primary": "#1e40ff",
    "secondary": "#222226",
    "text": "#222226"
    }
},
"pregameForm": null
}
Example Usage:
team_details = await api.team_info(team_id=191417)
print(team_details)
async team_races(team_id, season_id)[source]

Retrieves a list of races in which the team participated for the given season

Parameters:
  • team_id (int) – The ID of the team.

  • season_id (int)

Returns:

A dictionary containing season details for the given team.

Return type:

dict

Example Usage:
team_races = await api.team_races(team_id=214902, season_id=206455)
print(team_races)
async team_rankings(season_id)[source]

Retrieves the current standings of teams for a given motorsport season.

Parameters:

season_id (int) – The ID of the season for which to retrieve team rankings.

Returns:

The driver rankings for the given season, including details such as position, points, victories, and other stats.

Return type:

int

Example Response:
{
    "standings": [
        {
            "team": {
                "name": "Verstappen M.",
                "slug": "verstappen-max",
                "shortName": "Verstappen M.",
                "gender": "M",
                "sport": {
                    "name": "Motorsport",
                    "slug": "motorsport",
                    "id": 11
                },
                "category": {
                    "name": "Formula 1",
                    "slug": "formula-1",
                    "sport": {
                        "name": "Motorsport",
                        "slug": "motorsport",
                        "id": 11
                    },
                    "id": 36,
                    "country": {},
                    "flag": "formula-1"
                },
                "userCount": 31878,
                "nameCode": "VER",
                "disabled": false,
                "national": false,
                "parentTeam": {
                    "name": "Red Bull Racing",
                    "slug": "red-bull-racing",
                    "shortName": "Red Bull Racing",
                    "gender": "M",
                    "sport": {
                        "name": "Motorsport",
                        "slug": "motorsport",
                        "id": 11
                    },
                    "category": {
                        "name": "Formula 1",
                        "slug": "formula-1",
                        "sport": {
                            "name": "Motorsport",
                            "slug": "motorsport",
                            "id": 11
                        },
                        "id": 36,
                        "country": {},
                        "flag": "formula-1"
                    },
                    "userCount": 0,
                    "nameCode": "RBR",
                    "disabled": false,
                    "national": false,
                    "type": 0,
                    "id": 214902,
                    "country": {
                        "alpha2": "GB",
                        "alpha3": "GBR",
                        "name": "United Kingdom",
                        "slug": "united-kingdom"
                    },
                    "entityType": "team",
                    "flag": "great-britain",
                    "teamColors": {
                        "primary": "#1e40ff",
                        "secondary": "#222226",
                        "text": "#222226"
                    }
                },
                "type": 1,
                "id": 191417,
                "country": {
                    "alpha2": "NL",
                    "alpha3": "NLD",
                    "name": "Netherlands",
                    "slug": "netherlands"
                },
                "entityType": "team",
                "flag": "netherlands",
                "teamColors": {
                    "primary": "#374df5",
                    "secondary": "#374df5",
                    "text": "#ffffff"
                }
            },
            "points": 437,
            "position": 1,
            "victories": 9,
            "racesStarted": 24,
            "racesWithPoints": 23,
            "polePositions": 8,
            "podiums": 14,
            "fastestLaps": 3,
            "updatedAtTimestamp": 1733672824
        }
    ]
}
Example Usage:
# Example usage of the team_rankings method
standings = await api.team_rankings(season_id=206455)
print(standings)  # Output: Driver rankings for the given season
async team_seasons(team_id)[source]

Retrieves a list of seasons in which a team has participated.

Parameters:

team_id (int) – The ID of the team.

Returns:

A dictionary containing season details for the given team.

Return type:

dict

Example Usage:
team_seasons = await api.team_seasons(team_id=191417)
print(team_seasons)
async total_races()[source]

Retrieves the total count of today’s motorsport races and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live motorsport races.

  • ”total”: The total number of motorsport races scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 8, “total”: 16

}

sofascore_wrapper.news module

class sofascore_wrapper.news.News(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async news_feed()[source]

Retrieves sofascore’s latest football published news articles

Returns:

A dict containg a list of objects.

Return type:

Dict[str, Any]

Example Response:
{
“newsArticles”: [
{

“source”: 8, “description”: “Arsenal remain comfortably adrift of relentless Premier League leaders Liverpool despite a 5-1 hammering of Manchester City on Sunday, but midfielder Declan Rice says there is a determination to hunt them down.”, “thumbnailUrl”: “https://a.espncdn.com/combiner/i?img=%2Fphoto%2F2025%2F0202%2Fr1446625_1024x576_16%2D9.jpg”, “tags”: [

“player”, “team”, “tournament”

], “header”: “Rice says Arsenal ready to ‘hunt down’ Liverpool”, “externalUrl”: “https://www.espn.com/soccer/story/_/id/43667029/arsenal-hunt-liverpool-title-race-rice-says”, “contentId”: “8:US-EN-43667029”, “publishedAtTimestamp”: 1738544104

},

]

}

sofascore_wrapper.player module

class sofascore_wrapper.player.Player(api, player_id)[source]

Bases: object

Parameters:
async attributes()[source]

Fetch the player’s attributes and performance overview.

Returns:

A dictionary containing the player’s attributes and performance statistics.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Example Response:

{
“averageAttributeOverviews”: [
{

“attacking”: 62, “technical”: 54, “tactical”: 44, “defending”: 32, “creativity”: 47, “position”: “F”, “yearShift”: 0, “id”: 19812

}

], “playerAttributeOverviews”: [

{

“attacking”: 85, “technical”: 77, “tactical”: 58, “defending”: 35, “creativity”: 80, “position”: “D”, “yearShift”: 0, “id”: 50004

}

]

}

async get_player()[source]

Fetch detailed information about the player.

Returns:

A dictionary containing player details.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Example Response:

{
“player”: {

“name”: “Bukayo Saka”, “firstName”: “”, “lastName”: “”, “slug”: “bukayo-saka”, “shortName”: “B. Saka”, “team”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “id”: 17, “country”: {}, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “primaryUniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “id”: 17, “country”: {}, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “position”: “F”, “jerseyNumber”: “7”, “height”: 178, “preferredFoot”: “Left”, “retired”: false, “userCount”: 168684, “gender”: “M”, “id”: 934235, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “shirtNumber”: 7, “dateOfBirthTimestamp”: 999648000, “contractUntilTimestamp”: 1814313600, “proposedMarketValue”: 157000000, “proposedMarketValueRaw”: {

“value”: 157000000, “currency”: “EUR”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “بوكايو ساكا”, “hi”: “बुकायो साका”, “bn”: “বুকায়ো সাকা”

}, “shortNameTranslation”: {

“ar”: “ب. ساكا”, “hi”: “बी. साका”, “bn”: “বি. সাকা”

}

}

}

}

async image()[source]
Example Response:

https://img.sofascore.com/api/v1/player/934235/image

Return type:

str

async last_fixtures()[source]

Fetch the last matches the player participated in.

The matches are returned in reverse chronological order, meaning the most recent match is the first item in the list.

Returns:

A list of dictionaries containing match details, with the most recent match first.

Each dictionary includes information about the tournament, teams, scores, and timestamps.

Return type:

List[Dict[str, Any]]

Raises:

Exception – If the API request fails.

Example Response:

[
{
“tournament”: {

“name”: “Euro, Knockout stage”, “slug”: “uefa-euro-knockout-stage”, “category”: {

“name”: “Europe”, “slug”: “europe”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1465, “flag”: “europe”

}, “uniqueTournament”: {

“name”: “EURO”, “slug”: “european-championship”, “primaryColorHex”: “#293cdb”, “secondaryColorHex”: “#00ba5d”, “category”: {

“name”: “Europe”, “slug”: “europe”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1465, “flag”: “europe”

}, “userCount”: 1011793, “id”: 1, “hasPerformanceGraphFeature”: false, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 683, “isGroup”: false, “isLive”: false, “id”: 2137

}, “season”: {

“name”: “EURO 2024”, “year”: “2024”, “editor”: false, “id”: 56953

}, “roundInfo”: {

“round”: 27, “name”: “Quarterfinals”, “slug”: “quarterfinals”, “cupRoundType”: 4

}, “customId”: “GObseUb”, “status”: {

“code”: 120, “description”: “AP”, “type”: “finished”

}, “winnerCode”: 2, “homeTeam”: {

“name”: “Portugal”, “slug”: “portugal”, “shortName”: “Portugal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 1382625, “nameCode”: “POR”, “ranking”: 6, “national”: true, “type”: 0, “id”: 4704, “country”: {

“alpha2”: “PT”, “alpha3”: “PRT”, “name”: “Portugal”, “slug”: “portugal”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#66cc66”, “text”: “#66cc66”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “البرتغال”, “ru”: “Португалия”, “hi”: “पुर्तगाल”, “bn”: “পর্তুগাল”

}

}

}, “awayTeam”: {

“name”: “France”, “slug”: “france”, “shortName”: “France”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 1155922, “nameCode”: “FRA”, “ranking”: 2, “disabled”: false, “national”: true, “type”: 0, “id”: 4481, “country”: {

“alpha2”: “FR”, “alpha3”: “FRA”, “name”: “France”, “slug”: “france”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#01509e”, “secondary”: “#e30613”, “text”: “#e30613”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “فرنسا”, “ru”: “Франция”, “hi”: “फ्रांस”, “bn”: “ফ্রান্স”

}

}

}, “homeScore”: {

“current”: 3, “display”: 0, “period1”: 0, “period2”: 0, “normaltime”: 0, “extra1”: 0, “extra2”: 0, “overtime”: 0, “penalties”: 3

}, “awayScore”: {

“current”: 5, “display”: 0, “period1”: 0, “period2”: 0, “normaltime”: 0, “extra1”: 0, “extra2”: 0, “overtime”: 0, “penalties”: 5

}, “time”: {

“injuryTime1”: 0, “injuryTime2”: 3, “injuryTime3”: 0, “injuryTime4”: 0, “currentPeriodStartTimestamp”: 1720214035

}, “changes”: {

“changes”: [

“status.code”, “status.description”, “status.type”, “homeScore.display”, “homeScore.penalties”, “awayScore.display”, “awayScore.penalties”

], “changeTimestamp”: 1720215795

}, “hasGlobalHighlights”: false, “hasXg”: true, “hasEventPlayerStatistics”: true, “hasEventPlayerHeatMap”: true, “detailId”: 1, “crowdsourcingDataDisplayEnabled”: false, “id”: 11874026, “startTimestamp”: 1720206000, “slug”: “portugal-france”, “finalResultOnly”: false, “feedLocked”: true, “isEditor”: false

]

async league_stats(league_id, season)[source]

Fetch the player’s statistics for a specific league and season.

Parameters:
  • league_id (int) – The unique ID of the league.

  • season (int) – The season ID.

Returns:

A dictionary containing the player’s statistics for the specified league and season.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Example Response:

{
“statistics”: {

“rating”: 6.9, “totalRating”: 34.5, “countRating”: 5, “goals”: 0, “bigChancesCreated”: 0, “bigChancesMissed”: 0, “assists”: 0, “expectedAssists”: 0.14556703, “goalsAssistsSum”: 0, “accuratePasses”: 127, “inaccuratePasses”: 16, “totalPasses”: 143, “accuratePassesPercentage”: 88.811188811189, “accurateOwnHalfPasses”: 64, “accurateOppositionHalfPasses”: 64, “accurateFinalThirdPasses”: 31, “keyPasses”: 2, “successfulDribbles”: 2, “successfulDribblesPercentage”: 50, “tackles”: 10, “interceptions”: 3, “yellowCards”: 1, “directRedCards”: 0, “redCards”: 0, “accurateCrosses”: 1, “accurateCrossesPercentage”: 100, “totalShots”: 4, “shotsOnTarget”: 1, “shotsOffTarget”: 3, “groundDuelsWon”: 15, “groundDuelsWonPercentage”: 46.875, “aerialDuelsWon”: 3, “aerialDuelsWonPercentage”: 50, “totalDuelsWon”: 18, “totalDuelsWonPercentage”: 47.368421052632, “minutesPlayed”: 327, “goalConversionPercentage”: 0, “penaltiesTaken”: 0, “penaltyGoals”: 0, “penaltyWon”: 0, “penaltyConceded”: 0, “shotFromSetPiece”: 0, “freeKickGoal”: 0, “goalsFromInsideTheBox”: 0, “goalsFromOutsideTheBox”: 0, “shotsFromInsideTheBox”: 1, “shotsFromOutsideTheBox”: 3, “headedGoals”: 0, “leftFootGoals”: 0, “rightFootGoals”: 0, “accurateLongBalls”: 1, “accurateLongBallsPercentage”: 25, “clearances”: 7, “errorLeadToGoal”: 0, “errorLeadToShot”: 0, “dispossessed”: 4, “possessionLost”: 30, “possessionWonAttThird”: 1, “totalChippedPasses”: 3, “accurateChippedPasses”: 1, “touches”: 211, “wasFouled”: 3, “fouls”: 5, “hitWoodwork”: 0, “ownGoals”: 0, “dribbledPast”: 6, “offsides”: 1, “blockedShots”: 0, “passToAssist”: 0, “saves”: 0, “cleanSheet”: 1, “penaltyFaced”: 0, “penaltySave”: 0, “savedShotsFromInsideTheBox”: 0, “savedShotsFromOutsideTheBox”: 0, “goalsConcededInsideTheBox”: 1, “goalsConcededOutsideTheBox”: 1, “punches”: 0, “runsOut”: 0, “successfulRunsOut”: 0, “highClaims”: 0, “crossesNotClaimed”: 0, “matchesStarted”: 4, “penaltyConversion”: 0, “setPieceConversion”: 0, “totalAttemptAssist”: 2, “totalContest”: 4, “totalCross”: 1, “duelLost”: 20, “aerialLost”: 3, “attemptPenaltyMiss”: 0, “attemptPenaltyPost”: 0, “attemptPenaltyTarget”: 0, “totalLongBalls”: 4, “goalsConceded”: 2, “tacklesWon”: 9, “tacklesWonPercentage”: 90, “scoringFrequency”: 0, “yellowRedCards”: 0, “savesCaught”: 0, “savesParried”: 0, “totalOwnHalfPasses”: 66, “totalOppositionHalfPasses”: 78, “totwAppearances”: 0, “expectedGoals”: 0.1684, “goalKicks”: 0, “ballRecovery”: 11, “id”: 1595217, “type”: “overall”, “appearances”: 5

}, “team”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}

}

async national_stats()[source]

Fetch the player’s statistics for their national team.

Returns:

A dictionary containing the player’s national team statistics, including appearances, goals, and debut information.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Example Response:

{
“statistics”: [
{
“team”: {

“name”: “Italy”, “slug”: “italy”, “shortName”: “Italy”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 905551, “nameCode”: “ITA”, “ranking”: 9, “disabled”: false, “national”: true, “type”: 0, “id”: 4707, “entityType”: “team”, “teamColors”: {

“primary”: “#0066ff”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “إيطاليا”, “ru”: “Италия”, “hi”: “इटली”, “bn”: “ইতালি”

}, “shortNameTranslation”: {

“ar”: “إيطاليا”, “hi”: “इटली”, “bn”: “ইতালি”

}

}

}, “appearances”: 8, “goals”: 0, “debutTimestamp”: 1717459200

}

]

}

async player_leagues(player_id)[source]

Retrieves a list of players unique leagues of which they have participated.

Parameters:

player_id (int) – The ID of the player.

Returns:

A dictionary containing the player’s total leagues participated

Return type:

Dict[str, Any]

async player_seasons(player_id)[source]

Retrieves a player’s full seasons info

Parameters:

player_id (int) – The ID of the player.

Returns:

A dictionary containing the player’s season statistics.

Return type:

Dict[str, Any]

async transfer_history()[source]

Fetch the transfer history of the player.

Returns:

A dictionary containing the player’s transfer history.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Example Response:

{
“transferHistory”: [
{
“player”: {

“name”: “Cristiano Ronaldo”, “slug”: “cristiano-ronaldo”, “shortName”: “C. Ronaldo”, “position”: “F”, “jerseyNumber”: “7”, “userCount”: 1067318, “id”: 750, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “كريستيانو رونالدو”, “hi”: “क्रिस्टियानो रोनाल्डो”, “bn”: “ক্রিশ্চিয়ানো রোনালদো”

}, “shortNameTranslation”: {

“ar”: “ك. رونالدو”, “hi”: “सी. रोनाल्डो”, “bn”: “সি. রোনালদো”

}

}

}, “transferFrom”: {

“name”: “No team”, “slug”: “no-team”, “shortName”: “No team”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 10, “nameCode”: “NTE”, “disabled”: true, “national”: false, “type”: 0, “id”: 241802, “entityType”: “team”, “teamColors”: {

“primary”: “#d0d0d0”, “secondary”: “#000000”, “text”: “#000000”

}

}, “transferTo”: {

“name”: “Al-Nassr”, “slug”: “al-nassr”, “shortName”: “Al-Nassr”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 1481629, “nameCode”: “ALN”, “disabled”: false, “national”: false, “type”: 0, “id”: 23400, “entityType”: “team”, “teamColors”: {

“primary”: “#ffff00”, “secondary”: “#ffff00”, “text”: “#ffff00”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “النصر”, “ru”: “Аль-Наср”, “hi”: “अल-नासर”, “bn”: “আল-নাসর”

}, “shortNameTranslation”: {

“ar”: “النصر”, “hi”: “अल-नासर”, “bn”: “আল-নাসর”

}

}

}, “fromTeamName”: “No team”, “toTeamName”: “Al-Nassr”, “type”: 3, “transferFee”: 0, “transferFeeDescription”: “Free”, “id”: 1529662, “transferDateTimestamp”: 1672531200

}

]

}

class sofascore_wrapper.player.PlayerSearch(api, query)[source]

Bases: object

Parameters:
async search_player()[source]

Perform a dedicated player search. This endpoint is more specific than the general search.

Returns:

A dictionary containing player search results.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Example Response:

{
“players”: [
{

“name”: “Cole Palmer”, “slug”: “cole-palmer”, “shortName”: “C. Palmer”, “team”: {

“name”: “Chelsea”, “slug”: “chelsea”, “shortName”: “Chelsea”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “id”: 17, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “primaryUniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “id”: 17, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “userCount”: 2130321, “nameCode”: “CHE”, “disabled”: false, “national”: false, “type”: 0, “id”: 38, “entityType”: “team”, “teamColors”: {

“primary”: “#0310a7”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “تشيلسي”, “ru”: “Челси”, “hi”: “चेल्सी”, “bn”: “চেলসি”

}, “shortNameTranslation”: {

“ar”: “تشيلسي”, “hi”: “चेल्सी”, “bn”: “চেলসি”

}

}

}, “position”: “M”, “jerseyNumber”: “20”, “userCount”: 234297, “id”: 982780, “dateOfBirthTimestamp”: 1020643200, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “كول بالمر”, “hi”: “कोल पाल्मर”, “bn”: “কোল পামার”

}, “shortNameTranslation”: {

“ar”: “ك. بالمر”, “hi”: “सी. पाल्मर”, “bn”: “সি. পামার”

}

}

}

]

}

sofascore_wrapper.rugby module

class sofascore_wrapper.rugby.Rugby(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async all_tournaments(country_code='GB')[source]

Retrieves all the ruby tournaments

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

country_code (str)

async categories()[source]

Retrieves all the rugby categories.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async matches_by_date(sport='rugby', date=None)[source]

Retrieves scheduled fixtures for a given sport on a specific date.

Parameters:
  • sport (str) – The sport for which to retrieve fixtures. Available options include: - “football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker” - “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “esports”, “handball” - “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton” - “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

  • date (str, optional) – The date in “YYYY-MM-DD” format. If not provided, the current date is used.

Returns:

A dictionary containing fixture details for the specified sport and date, including match details, teams, venue, and start time.

Return type:

Dict[str, Any]

Raises:

ValueError – If the provided sport is not in the list of supported sports.

async season_games(tournament_id, season_id)[source]

Retrieves all matches for the selected tournament and season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async total_matches()[source]

Retrieves the total count of today’s rugby matches and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live rugby matches.

  • ”total”: The total number of rugby matches scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 8, “total”: 16

}

sofascore_wrapper.search module

class sofascore_wrapper.search.Search(api, search_string, page=0)[source]

Bases: object

Parameters:
async search_all(sport=None)[source]

Perform a search across all categories (teams, players, matches, leagues, managers).

Parameters:

sport (str) – The sport of which you wish to gain fixtures for. Check below for appropriate sport names.

Return type:

Dict[str, Any]

Arg sport (str, Any):
[

“football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker”, “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “e-sports”, “handball”, “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton”, “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

]

Returns:

A dictionary containing search results across all categories.

Return type:

Dict[str, Any]

Raises:

Exception – If the API request fails.

Parameters:

sport (str | None)

Example Response:

{
“results”: [
{

“type”: “team”, “entity”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “country”: {

“alpha2”: “EN”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “score”: 1358595.1

]

}

async search_leagues(sport=None)[source]

Perform a search specifically for leagues.

Parameters:

sport (str) – The sport of which you wish to gain fixtures for. Check below for appropriate sport names.

Return type:

List[Dict[str, Any]]

Arg sport (str, Any):
[

“football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker”, “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “e-sports”, “handball”, “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton”, “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

]

Returns:

A list of dictionaries containing league details.

Return type:

List[Dict[str, Any]]

Raises:

Exception – If the API request fails.

Parameters:

sport (str | None)

Example Response:

[
{

“type”: “uniqueTournament”, “entity”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “id”: 17, “country”: {}, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “score”: 577963.7

]

async search_match(sport=None)[source]

Perform a search specifically for matches.

Parameters:

sport (str) – The sport of which you wish to gain fixtures for. Check below for appropriate sport names.

Return type:

List[Dict[str, Any]]

Arg sport (str, Any):
[

“football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker”, “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “e-sports”, “handball”, “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton”, “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

]

Returns:

A list of dictionaries containing match details.

Return type:

List[Dict[str, Any]]

Raises:

Exception – If the API request fails.

Parameters:

sport (str | None)

Example Response:

[
{

“type”: “event”, “entity”: {

“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “id”: 17, “country”: {}, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “customId”: “PR”, “status”: {

“code”: 100, “description”: “Ended”, “type”: “finished”

}, “winnerCode”: 3, “homeTeam”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “country”: {

“alpha2”: “EN”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “awayTeam”: {

“name”: “Aston Villa”, “slug”: “aston-villa”, “shortName”: “Aston Villa”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 878821, “nameCode”: “AVL”, “disabled”: false, “national”: false, “type”: 0, “id”: 40, “country”: {

“alpha2”: “EN”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#670e36”, “secondary”: “#94bee5”, “text”: “#94bee5”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “أستون فيلا”, “ru”: “Астон Вилла”, “hi”: “एस्टन विला”, “bn”: “অ্যাস্টন ভিলা”

}, “shortNameTranslation”: {

“ar”: “أستون فيلا”, “hi”: “एस्टन विला”, “bn”: “অ্যাস্টন ভিলা”

}

}

}, “homeScore”: {

“current”: 2, “display”: 2, “period1”: 1, “period2”: 1, “normaltime”: 2

}, “awayScore”: {

“current”: 2, “display”: 2, “period1”: 0, “period2”: 2, “normaltime”: 2

}, “hasXg”: true, “id”: 12436443, “startTimestamp”: 1737221400, “slug”: “arsenal-aston-villa”, “finalResultOnly”: false

}, “score”: 7288.5156

]

async search_players(sport=None)[source]

Perform a search specifically for players.

Parameters:

sport (str) – The sport of which you wish to gain fixtures for. Check below for appropriate sport names.

Return type:

List[Dict[str, Any]]

Arg sport (str, Any):
[

“football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker”, “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “e-sports”, “handball”, “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton”, “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

]

Returns:

A list of dictionaries containing player details.

Return type:

List[Dict[str, Any]]

Raises:

Exception – If the API request fails.

Parameters:

sport (str | None)

Example Response:

[
{

“type”: “player”, “entity”: {

“name”: “Bukayo Saka”, “firstName”: “”, “lastName”: “”, “slug”: “bukayo-saka”, “shortName”: “B. Saka”, “team”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “country”: {

“alpha2”: “EN”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “position”: “F”, “jerseyNumber”: “7”, “userCount”: 168684, “id”: 934235, “country”: {

“alpha2”: “EN”, “name”: “England”, “slug”: “england”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “بوكايو ساكا”, “hi”: “बुकायो साका”, “bn”: “বুকায়ো সাকা”

}, “shortNameTranslation”: {

“ar”: “ب. ساكا”, “hi”: “बी. साका”, “bn”: “বি. সাকা”

}

}

}, “score”: 90030.805

]

async search_teams(sport=None)[source]

Perform a search specifically for teams.

Parameters:

sport (str) – The sport of which you wish to gain fixtures for. Check below for appropriate sport names.

Return type:

List[Dict[str, Any]]

Arg sport (str, Any):
[

“football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker”, “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “e-sports”, “handball”, “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton”, “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

]

Returns:

A list of dictionaries containing team details.

Return type:

List[Dict[str, Any]]

Raises:

Exception – If the API request fails.

Parameters:

sport (str | None)

Example Response:

[
{

“type”: “team”, “entity”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “country”: {

“alpha2”: “EN”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “score”: 1357694.8

]

sofascore_wrapper.team module

class sofascore_wrapper.team.Team(api, team_id)[source]

Bases: object

Parameters:
async get_team()[source]

Retrieves detailed information about the team.

Returns:

A dictionary containing team details such as name, slug, short name, gender, sport, category, tournament, and more.

Return type:

Dict

Example Response:

{
“team”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “country”: {}, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীग”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “primaryUniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “country”: {}, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীग”

}, “shortNameTranslation”: {}

}

}, “userCount”: 2341486, “manager”: {

“name”: “Mikel Arteta”, “slug”: “mikel-arteta”, “shortName”: “M. Arteta”, “id”: 794075, “country”: {

“alpha2”: “ES”, “alpha3”: “ESP”, “name”: “Spain”, “slug”: “spain”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ميكيل أرتيتا”, “hi”: “मिकेल आर्टेटा”, “bn”: “মিকেল আর্তেতা”

}, “shortNameTranslation”: {

“ar”: “م. أرتيتا”, “hi”: “एम. आर्टेटा”, “bn”: “এম. আরতেতা”

}

}

}, “venue”: {

“city”: {

“name”: “London”

}, “venueCoordinates”: {

“latitude”: 51.55504, “longitude”: -0.1084

}, “hidden”: false, “slug”: “emirates-stadium”, “name”: “Emirates Stadium”, “capacity”: 60260, “id”: 624, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الإمارات”

}, “shortNameTranslation”: {}

}, “stadium”: {

“name”: “Emirates Stadium”, “capacity”: 60260

}

}, “nameCode”: “ARS”, “class”: 4, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “fullName”: “Arsenal”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “foundationDateTimestamp”: -2627164800, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “pregameForm”: {

“avgRating”: “7.04”, “position”: 2, “value”: “47”, “form”: [

“W”, “D”, “W”, “D”, “W”

]

}

}

async image()[source]

Retrieves the URL of the team’s image.

Returns:

The URL of the team’s image.

Return type:

str

Example Response:

https://img.sofascore.com/api/v1/team/42/image

async last_fixtures()[source]

Retrieves the last fixtures for the team.

Returns:

A list of dictionaries containing details about the past fixtures, including tournament, season, round, teams, scores, and more.

Return type:

List

Example Response:

[
{
“tournament”: {

“name”: “EFL Cup”, “slug”: “efl-cup”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “EFL Cup”, “slug”: “efl-cup”, “primaryColorHex”: “#203e93”, “secondaryColorHex”: “#bc1723”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 167174, “id”: 21, “country”: {}, “hasPerformanceGraphFeature”: false, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 426, “isGroup”: false, “isLive”: false, “id”: 17

}, “season”: {

“name”: “EFL Cup 24/25”, “year”: “24/25”, “editor”: false, “id”: 62483

}, “roundInfo”: {

“round”: 3, “name”: “Round 3”, “slug”: “round-3”

}, “customId”: “fsR”, “status”: {

“code”: 100, “description”: “Ended”, “type”: “finished”

}, “winnerCode”: 1, “homeTeam”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “awayTeam”: {

“name”: “Bolton Wanderers”, “slug”: “bolton-wanderers”, “shortName”: “Bolton”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 21304, “nameCode”: “BOL”, “disabled”: false, “national”: false, “type”: 0, “id”: 5, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#ffffff”, “secondary”: “#000033”, “text”: “#000033”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “بولتون وانديريرز”, “ru”: “Болтон Уондерерс”

}, “shortNameTranslation”: {}

}

}, “homeScore”: {

“current”: 5, “display”: 5, “period1”: 2, “period2”: 3, “normaltime”: 5

}, “awayScore”: {

“current”: 1, “display”: 1, “period1”: 0, “period2”: 1, “normaltime”: 1

}, “time”: {

“injuryTime1”: 3, “injuryTime2”: 4, “currentPeriodStartTimestamp”: 1727293717

}, “changes”: {

“changes”: [

“status.code”, “status.description”, “status.type”

], “changeTimestamp”: 1727296678

}, “hasGlobalHighlights”: false, “hasEventPlayerStatistics”: true, “hasEventPlayerHeatMap”: true, “detailId”: 1, “crowdsourcingDataDisplayEnabled”: false, “id”: 12785412, “startTimestamp”: 1727289900, “slug”: “arsenal-bolton-wanderers”, “finalResultOnly”: false, “feedLocked”: true, “isEditor”: false

}

]

async latest_highlights()[source]

Retrieves the latest highlights for the team.

Returns:

A dictionary containing the latest highlights, including titles, subtitles, URLs, and thumbnails.

Return type:

Dict

Example Response:

{
“media”: [
{

“title”: “Wolves 0 - 1 Arsenal”, “subtitle”: “Full Highlights”, “url”: “https://www.youtube.com/watch?v=HUBQ9rFeDCc”, “thumbnailUrl”: “https://i.ytimg.com/vi/HUBQ9rFeDCc/hqdefault.jpg”, “mediaType”: 1, “doFollow”: false, “keyHighlight”: false, “id”: 6193182, “createdAtTimestamp”: 1737844523, “sourceUrl”: “https://www.youtube.com/watch?v=HUBQ9rFeDCc

}, {

“title”: “Wolves 0 - 1 Arsenal”, “subtitle”: “Full Highlights”, “url”: “https://www.youtube.com/watch?v=4SxKKSNOxRI”, “thumbnailUrl”: “https://i.ytimg.com/vi/4SxKKSNOxRI/hqdefault.jpg”, “mediaType”: 1, “forCountries”: [

“BA”, “HR”, “ME”, “MK”, “RS”, “SI”

], “doFollow”: false, “keyHighlight”: false, “id”: 6192993, “createdAtTimestamp”: 1737827674, “sourceUrl”: “https://www.youtube.com/watch?v=4SxKKSNOxRI

}

]

}

async league_stats(league_id, season)[source]

Retrieves the league statistics of the team for a specific league and season.

Parameters:
  • league_id (int) – The unique identifier for the league.

  • season (int) – The season year.

Returns:

A dictionary containing the team’s statistics in the league, including goals scored, goals conceded, assists, shots, and more.

Return type:

Dict

Example Response:

{
“statistics”: {

“goalsScored”: 16, “goalsConceded”: 3, “ownGoals”: 0, “assists”: 9, “shots”: 107, “penaltyGoals”: 2, “penaltiesTaken”: 4, “freeKickGoals”: 1, “freeKickShots”: 2, “goalsFromInsideTheBox”: 13, “goalsFromOutsideTheBox”: 2, “shotsFromInsideTheBox”: 83, “shotsFromOutsideTheBox”: 24, “headedGoals”: 4, “leftFootGoals”: 7, “rightFootGoals”: 4, “bigChances”: 27, “bigChancesCreated”: 17, “bigChancesMissed”: 15, “shotsOnTarget”: 43, “shotsOffTarget”: 35, “blockedScoringAttempt”: 29, “successfulDribbles”: 79, “dribbleAttempts”: 153, “corners”: 51, “hitWoodwork”: 2, “fastBreaks”: 3, “fastBreakGoals”: 0, “fastBreakShots”: 3, “averageBallPossession”: 53.375, “totalPasses”: 3885, “accuratePasses”: 3384, “accuratePassesPercentage”: 87.104247104247, “totalOwnHalfPasses”: 1638, “accurateOwnHalfPasses”: 1517, “accurateOwnHalfPassesPercentage”: 92.612942612943, “totalOppositionHalfPasses”: 2387, “accurateOppositionHalfPasses”: 1909, “accurateOppositionHalfPassesPercentage”: 79.974863845832, “totalLongBalls”: 154, “accurateLongBalls”: 82, “accurateLongBallsPercentage”: 53.246753246753, “totalCrosses”: 140, “accurateCrosses”: 42, “accurateCrossesPercentage”: 30, “cleanSheets”: 5, “tackles”: 136, “interceptions”: 57, “saves”: 17, “errorsLeadingToGoal”: 1, “errorsLeadingToShot”: 5, “penaltiesCommited”: 2, “penaltyGoalsConceded”: 1, “clearances”: 100, “clearancesOffLine”: 0, “lastManTackles”: 2, “totalDuels”: 735, “duelsWon”: 380, “duelsWonPercentage”: 51.700680272109, “totalGroundDuels”: 544, “groundDuelsWon”: 278, “groundDuelsWonPercentage”: 51.102941176471, “totalAerialDuels”: 191, “aerialDuelsWon”: 102, “aerialDuelsWonPercentage”: 53.403141361257, “possessionLost”: 881, “offsides”: 13, “fouls”: 88, “yellowCards”: 12, “yellowRedCards”: 0, “redCards”: 0, “avgRating”: 7.0694214876033, “accurateFinalThirdPassesAgainst”: 647, “accurateOppositionHalfPassesAgainst”: 1400, “accurateOwnHalfPassesAgainst”: 1608, “accuratePassesAgainst”: 2982, “bigChancesAgainst”: 5, “bigChancesCreatedAgainst”: 2, “bigChancesMissedAgainst”: 3, “clearancesAgainst”: 192, “cornersAgainst”: 27, “crossesSuccessfulAgainst”: 26, “crossesTotalAgainst”: 101, “dribbleAttemptsTotalAgainst”: 101, “dribbleAttemptsWonAgainst”: 48, “errorsLeadingToGoalAgainst”: 4, “errorsLeadingToShotAgainst”: 3, “hitWoodworkAgainst”: 4, “interceptionsAgainst”: 56, “keyPassesAgainst”: 58, “longBallsSuccessfulAgainst”: 139, “longBallsTotalAgainst”: 339, “offsidesAgainst”: 9, “redCardsAgainst”: 0, “shotsAgainst”: 72, “shotsBlockedAgainst”: 18, “shotsFromInsideTheBoxAgainst”: 37, “shotsFromOutsideTheBoxAgainst”: 35, “shotsOffTargetAgainst”: 35, “shotsOnTargetAgainst”: 19, “blockedScoringAttemptAgainst”: 18, “tacklesAgainst”: 140, “totalFinalThirdPassesAgainst”: 829, “oppositionHalfPassesTotalAgainst”: 1776, “ownHalfPassesTotalAgainst”: 1825, “totalPassesAgainst”: 3500, “yellowCardsAgainst”: 13, “throwIns”: 119, “goalKicks”: 41, “ballRecovery”: 339, “freeKicks”: 65, “id”: 26614, “matches”: 8, “awardedMatches”: 0

}

}

async near_events()[source]

Retrieves the team’s nearest matches, Does not provide data for all sports.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async next_fixtures()[source]

Retrieves the next fixtures for the team.

Returns:

A list of dictionaries containing details about the upcoming fixtures, including tournament, season, round, teams, scores, and more.

Return type:

List

Example Response:

[
{
“tournament”: {

“name”: “EFL Cup”, “slug”: “efl-cup”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “EFL Cup”, “slug”: “efl-cup”, “primaryColorHex”: “#203e93”, “secondaryColorHex”: “#bc1723”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 167174, “id”: 21, “country”: {}, “hasPerformanceGraphFeature”: false, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false

}, “priority”: 426, “isGroup”: false, “isLive”: false, “id”: 17

}, “season”: {

“name”: “EFL Cup 24/25”, “year”: “24/25”, “editor”: false, “id”: 62483

}, “roundInfo”: {

“round”: 3, “name”: “Round 3”, “slug”: “round-3”

}, “customId”: “fsR”, “status”: {

“code”: 100, “description”: “Ended”, “type”: “finished”

}, “winnerCode”: 1, “homeTeam”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “awayTeam”: {

“name”: “Bolton Wanderers”, “slug”: “bolton-wanderers”, “shortName”: “Bolton”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 21304, “nameCode”: “BOL”, “disabled”: false, “national”: false, “type”: 0, “id”: 5, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#ffffff”, “secondary”: “#000033”, “text”: “#000033”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “بولتون وانديريرز”, “ru”: “Болтон Уондерерс”

}, “shortNameTranslation”: {}

}

}, “homeScore”: {

“current”: 5, “display”: 5, “period1”: 2, “period2”: 3, “normaltime”: 5

}, “awayScore”: {

“current”: 1, “display”: 1, “period1”: 0, “period2”: 1, “normaltime”: 1

}, “time”: {

“injuryTime1”: 3, “injuryTime2”: 4, “currentPeriodStartTimestamp”: 1727293717

}, “changes”: {

“changes”: [

“status.code”, “status.description”, “status.type”

], “changeTimestamp”: 1727296678

}, “hasGlobalHighlights”: false, “hasEventPlayerStatistics”: true, “hasEventPlayerHeatMap”: true, “detailId”: 1, “crowdsourcingDataDisplayEnabled”: false, “id”: 12785412, “startTimestamp”: 1727289900, “slug”: “arsenal-bolton-wanderers”, “finalResultOnly”: false, “feedLocked”: true, “isEditor”: false

}

]

async performance()[source]

Retrieves the performance data of the team.

Returns:

A dictionary containing performance data such as events, tournament details, and team statistics.

Return type:

Dict

Example Response:

{
“events”: [
{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “hasPerformanceGraphFeature”: true, “id”: 17, “hasEventPlayerStatistics”: true, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isGroup”: false, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “season”: {

“name”: “Premier League 24/25”, “year”: “24/25”, “editor”: false, “id”: 61627

}, “roundInfo”: {

“round”: 18

}, “customId”: “HsR”, “status”: {

“code”: 100, “description”: “Ended”, “type”: “finished”

}, “winnerCode”: 1, “homeTeam”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “awayTeam”: {

“name”: “Ipswich Town”, “slug”: “ipswich-town”, “shortName”: “Ipswich”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 154510, “nameCode”: “IPS”, “disabled”: false, “national”: false, “type”: 0, “id”: 32, “entityType”: “team”, “subTeams”: [], “teamColors”: {

“primary”: “#0000ff”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ايبسويتش تاون”, “ru”: “Ипсвич Таун”

}, “shortNameTranslation”: {}

}

}, “homeScore”: {

“current”: 1, “display”: 1, “period1”: 1, “period2”: 0, “normaltime”: 1

}, “awayScore”: {

“current”: 0, “display”: 0, “period1”: 0, “period2”: 0, “normaltime”: 0

}, “time”: {

“injuryTime1”: 1, “injuryTime2”: 4, “currentPeriodStartTimestamp”: 1735334227

}, “changes”: {

“changes”: [

“status.code”, “status.description”, “status.type”

], “changeTimestamp”: 1735337210

}, “hasGlobalHighlights”: false, “hasXg”: true, “hasEventPlayerStatistics”: true, “hasEventPlayerHeatMap”: true, “detailId”: 1, “crowdsourcingDataDisplayEnabled”: false, “id”: 12436472, “startTimestamp”: 1735330500, “slug”: “arsenal-ipswich-town”, “finalResultOnly”: false, “feedLocked”: true, “isEditor”: false

}

]

}

async performance_graph(league_id, season)[source]

Retrieves the performance graph data for the team in a specific league and season.

Parameters:
  • league_id (int) – The unique identifier for the league.

  • season (int) – The season year.

Returns:

A dictionary containing the performance graph data, including events, week, position, and timeframe.

Return type:

Dict

Example Response:

{
“graphData”: [
{
“events”: [
{
“tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1364893, “id”: 17, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “customId”: “NsU”, “status”: {

“code”: 100, “description”: “Ended”, “type”: “finished”

}, “winnerCode”: 3, “homeTeam”: {

“name”: “Chelsea”, “slug”: “chelsea”, “shortName”: “Chelsea”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2114080, “nameCode”: “CHE”, “disabled”: false, “national”: false, “type”: 0, “id”: 38, “entityType”: “team”, “teamColors”: {

“primary”: “#0310a7”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “تشيلسي”, “ru”: “Челси”, “hi”: “चेल्सी”, “bn”: “চেলসি”

}, “shortNameTranslation”: {

“ar”: “تشيلسي”, “hi”: “चेल्सी”, “bn”: “চেলসি”

}

}

}, “awayTeam”: {

“name”: “Liverpool”, “slug”: “liverpool”, “shortName”: “Liverpool”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2572976, “nameCode”: “LIV”, “disabled”: false, “national”: false, “type”: 0, “id”: 44, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ليفربول”, “ru”: “Ливерпуль”, “hi”: “लिवरपूल”, “bn”: “লিভারপুল”

}, “shortNameTranslation”: {

“ar”: “ليفربول”, “hi”: “लिवरपूल”, “bn”: “লিভারপুল”

}

}

}, “homeScore”: {

“current”: 1, “display”: 1, “period1”: 1, “period2”: 0, “normaltime”: 1

}, “awayScore”: {

“current”: 1, “display”: 1, “period1”: 1, “period2”: 0, “normaltime”: 1

}, “hasXg”: true, “id”: 11352316, “startTimestamp”: 1691940600, “slug”: “liverpool-chelsea”, “finalResultOnly”: false

}

], “week”: 1, “position”: 12, “timeframeStart”: 1691712000, “timeframeEnd”: 1692316800

}

]

}

async seasons()[source]

Retrieves the seasons in which the team has participated.

Returns:

A dictionary containing the unique tournament seasons.

Return type:

Dict

Example Response:

{
“uniqueTournamentSeasons”: [
{
“uniqueTournament”: {

“name”: “UEFA Champions League”, “slug”: “uefa-champions-league”, “primaryColorHex”: “#062b5c”, “secondaryColorHex”: “#086aab”, “category”: {

“name”: “Europe”, “slug”: “europe”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1465, “flag”: “europe”

}, “userCount”: 1321299, “id”: 7, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “دوري أبطال أوروبا”, “hi”: “यूईएफए चैंपियंस लीग”, “bn”: “উয়েফা চ্যাম্পিয়ন্স লীগ”

}, “shortNameTranslation”: {}

}

}, “seasons”: [

{

“name”: “UEFA Champions League 24/25”, “year”: “24/25”, “editor”: false, “seasonCoverageInfo”: {}, “id”: 61644

}

]

}

]

}

async squad()[source]

Retrieves the squad of the team.

Returns:

A dictionary containing the players in the team’s squad, including their details, positions, and statistics.

Return type:

Dict

Example Response:

{
“players”: [
{
“player”: {

“name”: “Bukayo Saka”, “firstName”: “”, “lastName”: “”, “slug”: “bukayo-saka”, “shortName”: “B. Saka”, “team”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “tournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “uniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “id”: 17, “country”: {}, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “priority”: 617, “isLive”: false, “id”: 1, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “primaryUniqueTournament”: {

“name”: “Premier League”, “slug”: “premier-league”, “primaryColorHex”: “#3c1c5a”, “secondaryColorHex”: “#f80158”, “category”: {

“name”: “England”, “slug”: “england”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “id”: 1, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “flag”: “england”, “alpha2”: “EN”

}, “userCount”: 1361165, “id”: 17, “country”: {}, “displayInverseHomeAwayTeams”: false, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “الدوري الإنجليزي الممتاز”, “hi”: “प्रिमियर लीग”, “bn”: “প্রিমিয়ার লীগ”

}, “shortNameTranslation”: {}

}

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “position”: “F”, “jerseyNumber”: “7”, “height”: 178, “preferredFoot”: “Left”, “retired”: false, “userCount”: 168684, “gender”: “M”, “id”: 934235, “country”: {

“alpha2”: “EN”, “alpha3”: “ENG”, “name”: “England”, “slug”: “england”

}, “shirtNumber”: 7, “dateOfBirthTimestamp”: 999648000, “contractUntilTimestamp”: 1814313600, “proposedMarketValue”: 157000000, “proposedMarketValueRaw”: {

“value”: 157000000, “currency”: “EUR”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “بوكايو ساكا”, “hi”: “बुकायो साका”, “bn”: “বুকায়ো সাকা”

}, “shortNameTranslation”: {

“ar”: “ب. ساكا”, “hi”: “बी. साका”, “bn”: “বি. সাকা”

}

}

}

}

]

}

async top_players(league_id, season)[source]

Retrieves the top players of the team for a specific league and season.

Parameters:
  • league_id (int) – The unique identifier for the league.

  • season (int) – The season year.

Returns:

A dictionary containing the top players of the team, including their statistics and performance metrics.

Return type:

Dict

Example Response:

{
“topPlayers”: {
“rating”: [
{
“statistics”: {

“rating”: 7.8, “id”: 1595229, “type”: “overall”, “appearances”: 5

}, “playedEnough”: true, “player”: {

“name”: “Bukayo Saka”, “slug”: “bukayo-saka”, “shortName”: “B. Saka”, “position”: “F”, “userCount”: 168684, “id”: 934235, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “بوكايو ساكا”, “hi”: “बुकायो साका”, “bn”: “বুকায়ো সাকা”

}, “shortNameTranslation”: {

“ar”: “ب. ساكা”, “hi”: “बी. साका”, “bn”: “বি. সাকা”

}

}

}

}

]

}

}

async transfers_in()[source]

Retrieves a list of players who have transferred into the team.

Returns:

A list of dictionaries containing details about each transfer, including player information, transfer details, and fees.

Return type:

List

Example Response:

[
{
“player”: {

“name”: “Charles Sagoe Jr.”, “slug”: “charles-sagoe-jr”, “shortName”: “C. S. Jr.”, “position”: “F”, “jerseyNumber”: “15”, “userCount”: 841, “id”: 1119436, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “تشارلز ساغو جونيور”, “hi”: “चार्ल्स सागो जूनियर.”, “bn”: “চার্লস সাগো জুনিয়র”

}, “shortNameTranslation”: {

“ar”: “ت. ساغو جونيور”, “hi”: “सी.एस. जूनियर.”, “bn”: “সি. এস. জুনিয়র”

}

}

}, “transferFrom”: {

“name”: “Shrewsbury Town”, “slug”: “shrewsbury-town”, “shortName”: “Shrewsbury”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 6164, “nameCode”: “SHR”, “national”: false, “type”: 0, “id”: 82, “entityType”: “team”, “teamColors”: {

“primary”: “#0000ff”, “secondary”: “#ffff00”, “text”: “#ffff00”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “شوروسبري تاون”, “ru”: “Шрусбери Таун”

}, “shortNameTranslation”: {}

}

}, “transferTo”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: false, “national”: false, “type”: 0, “id”: 42, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “fromTeamName”: “Shrewsbury Town”, “toTeamName”: “Arsenal”, “type”: 2, “transferFee”: 0, “transferFeeDescription”: “-“, “id”: 2131805, “transferDateTimestamp”: 1736121600, “transferFeeRaw”: {

“value”: 0, “currency”: “EUR”

}

}

]

async transfers_out()[source]

Retrieves a list of players who have transferred out of the team.

Returns:

A list of dictionaries containing details about each transfer, including player information, transfer details, and fees.

Return type:

List

Example Response:

[
{
“player”: {

“name”: “Marquinhos”, “firstName”: “Marquinhos”, “slug”: “marquinhos”, “shortName”: “Marquinhos”, “position”: “M”, “jerseyNumber”: “17”, “userCount”: 4202, “id”: 1116954, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ماركينيوس”, “hi”: “मार्क्विन्होस”, “bn”: “মারকুইনহোস”

}, “shortNameTranslation”: {

“ar”: “ماركينيوس”, “hi”: “मार्क्विन्होस”, “bn”: “মারকুইনহোস”

}

}

}, “transferFrom”: {

“name”: “Arsenal”, “slug”: “arsenal”, “shortName”: “Arsenal”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 2341486, “nameCode”: “ARS”, “disabled”: False, “national”: False, “type”: 0, “id”: 42, “entityType”: “team”, “teamColors”: {

“primary”: “#cc0000”, “secondary”: “#ffffff”, “text”: “#ffffff”

}, “fieldTranslations”: {

“nameTranslation”: {

“ar”: “ارسنال”, “ru”: “Арсенал”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}, “shortNameTranslation”: {

“ar”: “ارسنال”, “hi”: “आर्सेनल”, “bn”: “আর্সেনাল”

}

}

}, “transferTo”: {

“name”: “Cruzeiro”, “slug”: “cruzeiro”, “shortName”: “Cruzeiro”, “gender”: “M”, “sport”: {

“name”: “Football”, “slug”: “football”, “id”: 1

}, “userCount”: 248252, “nameCode”: “CRU”, “disabled”: False, “national”: False, “type”: 0, “id”: 1954, “entityType”: “team”, “teamColors”: {

“primary”: “#0033cc”, “secondary”: “#0033cc”, “text”: “#0033cc”

}, “fieldTranslations”: {

“nameTranslation”: {

“ru”: “Крузейро”

}, “shortNameTranslation”: {}

}

}, “fromTeamName”: “Arsenal”, “toTeamName”: “Cruzeiro”, “type”: 1, “transferFee”: 0, “transferFeeDescription”: “-“, “id”: 2234559, “transferDateTimestamp”: 1736380800, “transferFeeRaw”: {

“value”: 0, “currency”: “USD”

}

}

]

sofascore_wrapper.tennis module

class sofascore_wrapper.tennis.Tennis(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async all_tournaments(country_code)[source]

Retrieves all the tennis tournaments

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

country_code (str)

async categories()[source]

Retrieves all the tennis categories such as the countries.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

async matches_by_date(sport='cricket', date=None)[source]

Retrieves scheduled fixtures for a given sport on a specific date.

Parameters:
  • sport (str) – The sport for which to retrieve fixtures. Available options include: - “football”, “rugby”, “cricket”, “tennis”, “mma”, “motorsport”, “darts”, “snooker” - “cycling”, “basketball”, “table-tennis”, “ice-hockey”, “esports”, “handball” - “volleyball”, “baseball”, “american-football”, “futsal”, “minifootball”, “badminton” - “aussie-rules”, “beach-volley”, “waterpolo”, “floorball”, “bandy”

  • date (str, optional) – The date in “YYYY-MM-DD” format. If not provided, the current date is used.

Returns:

A dictionary containing fixture details for the specified sport and date, including match details, teams, venue, and start time.

Return type:

Dict[str, Any]

Raises:

ValueError – If the provided sport is not in the list of supported sports.

async player_image(player_id)[source]

Retrieves the player’s image.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

player_id (int)

async player_last_matches(player_id)[source]

Retrieves the player’s last matches.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

player_id (int)

async player_next_matches(player_id)[source]

Retrieves the player’s next matches.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

player_id (int)

async player_performance(player_id)[source]

Retrieves the player performance.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

player_id (int)

async player_tournaments(player_id)[source]

Retrieves the point by point data for the given match.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

player_id (int)

async point_by_point(match_id)[source]

Retrieves the point by point data for the given match.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

match_id (int)

async power_per_leg(match_id)[source]

Retrieves the power score per game(round) for the given match.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:

match_id (int)

async season_games(tournament_id, season_id)[source]

Retrieves all matches for the selected tournament and season.

Returns:

A dictionary containing two keys:

Return type:

Dict[str, int]

Parameters:
  • tournament_id (int)

  • season_id (int)

async total_matches()[source]

Retrieves the total count of today’s tennis matches and how many are currently live.

Returns:

A dictionary containing two keys:
  • ”live”: The number of live tennis matches.

  • ”total”: The total number of tennis matches scheduled for today.

Return type:

Dict[str, int]

Example Response:

{

“live”: 8, “total”: 16

}

sofascore_wrapper.transfers module

class sofascore_wrapper.transfers.Transfers(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async get_transfer_feed(page=1, sort_by='transferdate', min_age=15, max_age=50, nationality=None, unique_tournament_id=None, position=None, followers_count=None)[source]

Fetches the transfer feed from Sofascore API with optional filters.

Parameters:
  • page (int) – Page number for pagination (default=1).

  • sort_by (str) – Sorting method (“followers”, “transferfee”, “transferdate”).

  • min_age (int) – Minimum player age (default=15, max=50).

  • max_age (int) – Maximum player age (default=50, min=15).

  • nationality (Optional[str]) – Filter by nationality code (e.g., ‘DZA’ for Algeria).

  • unique_tournament_id (Optional[int]) – Filter by league/tournament ID.

  • position (Optional[str]) – Filter by player position (‘FW’, ‘MF’, ‘DF’, ‘GK’).

  • followers_count (Optional[int]) – Minimum followers count (max=1000).

Returns:

The API response containing transfer feed data.

Return type:

Dict

sofascore_wrapper.user_data module

class sofascore_wrapper.user_data.UserData(api)[source]

Bases: object

Parameters:

api (SofascoreAPI)

async contribution_leaderboard()[source]

Retrieves the top 100 contribution leaderboard.

Return type:

Dict

async editor_leaderboard()[source]

Retrieves the top 100 editors leaderboard.

Return type:

Dict

async last_user_predictions(user_id)[source]

Retrieves the given user last predictions

To get your User ID, go to profile -> share account which will provide a link such as https://www.sofascore.com/user/profile/[userid]

Parameters:

user_id (str)

Return type:

Dict

async next_user_predictions(user_id)[source]

Retrieves the given user last predictions

To get your User ID, go to profile -> share account which will provide a link such as https://www.sofascore.com/user/profile/[userid]

Parameters:

user_id (str)

Return type:

Dict

async predictions_leaderboard()[source]

Retrieves the top 100 predictions leaderboard.

Return type:

Dict

async sofascore_news_rss_feed()[source]

Retrieves the current sofascore news RSS feed.

Return type:

str

async user_account(user_id)[source]

Retrieves the given user data.

To get your User ID, go to profile -> share account which will provide a link such as https://www.sofascore.com/user/profile/[userid]

Parameters:

user_id (str)

Return type:

Dict

async user_flares(user_id)[source]

Retrieves the given user flares data.

To get your User ID, go to profile -> share account which will provide a link such as https://www.sofascore.com/user/profile/[userid]

Parameters:

user_id (str)

Return type:

Dict