New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

statsbombpy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

statsbombpy

easily stream StatsBomb data into Python

  • 1.14.0
  • PyPI
  • Socket score

Maintainers
1

statsbombpy StatsBombPython_Lock

PyPI version

Brought to you by StatsBomb, this repository is a Python package that allows users to easily stream StatsBomb data into Python using your log in credentials for the API or free data from our GitHub page. API access is for paying customers only

Support: support@statsbomb.com

Installation Instructions

pip install statsbombpy

Running the tests

nose2 -v --pretty-assert

Configuration

Authentication

Environment Variables

Authentication can be done by setting environment variables named SB_USERNAME and SB_PASSWORD to your login credentials.

Manual Calls

Alternatively, if you don't want to use environment variables, all functions accept an argument creds to pass your login credentials in the format {"user": "", "passwd": ""}

Concurrency

You can specify how many of your computer's cores to use when running the sb.competition_events() and sb.competition_frames() functions by setting the environment variable SB_CORES to the number you want to use. Allowing statsbombpy to use more cores will speed up those functions.

If you don't have an environment variable set we will try to detect the number of cores in your system and use 2 less than that number. If we cannot detect the number of cores we set the number to 4.

Open Data

StatsBomb's open data can be accessed without the need of authentication.

StatsBomb are committed to sharing new data and research publicly to enhance understanding of the game of Football. We want to actively encourage new research and analysis at all levels. Therefore we have made certain leagues of StatsBomb Data freely available for public use for research projects and genuine interest in football analytics.

StatsBomb are hoping that by making data freely available, we will extend the wider football analytics community and attract new talent to the industry. We would like to collect some basic personal information about users of our data. By giving us your email address, it means we will let you know when we make more data, tutorials and research available. We will store the information in accordance with our Privacy Policy and the GDPR.

Terms & Conditions

Whilst we are keen to share data and facilitate research, we also urge you to be responsible with the data. Please register your details on https://www.statsbomb.com/resource-centre and read our User Agreement carefully. By using this repository, you are agreeing to the user agreement. If you publish, share or distribute any research, analysis or insights based on this data, please state the data source as StatsBomb and use our logo.

Usage

from statsbombpy import sb

Competitions

sb.competitions()
competition_idseason_idcountry_namecompetition_namecompetition_genderseason_namematch_updatedmatch_available
0942Germany1. Bundesligamale2019/20202019-12-29T07:47:45.9812019-12-29T07:47:45.981
194Germany1. Bundesligamale2018/20192019-12-16T23:09:16.1687562019-12-16T23:09:16.168756
291Germany1. Bundesligamale2017/20182019-12-16T23:09:16.1687562019-12-16T23:09:16.168756
37842Croatia1. HNLmale2019/20202020-01-02T10:35:49.0652020-01-02T10:35:49.065
41042Germany2. Bundesligamale2019/20202019-12-27T00:36:37.4982019-12-27T00:36:37.498

Matches

sb.matches(competition_id=9, season_id=42)
match_idmatch_datekick_offcompetitionseasonhome_teamaway_teamhome_scoreaway_scorematch_statuslast_updatedmatch_weekcompetition_stagestadiumrefereehome_managersaway_managersdata_versionshot_fidelity_versionxy_fidelity_version
03032992019-12-1518:00:00.000Germany - 1. Bundesliga2019/2020Schalke 04Eintracht Frankfurt10available2019-12-17T09:50:17.55815Regular SeasonVELTINS-ArenaF. ZwayerDavid WagnerAdi Hütter1.1.022
13032232019-09-0118:00:00.000Germany - 1. Bundesliga2019/2020Eintracht FrankfurtFortuna Düsseldorf21available2019-12-16T23:09:16.1687563Regular SeasonCommerzbank-ArenaF. WillenborgAdi HütterFriedhelm Funkel1.1.022
23030832019-12-1515:30:00.000Germany - 1. Bundesliga2019/2020WolfsburgBorussia Mönchengladbach21available2019-12-17T15:52:17.84315Regular SeasonVOLKSWAGEN ARENAF. BrychOliver GlasnerMarco Rose1.1.022
33032662019-12-1415:30:00.000Germany - 1. Bundesliga2019/2020Hertha BerlinFreiburg10available2019-12-17T17:43:18.28515Regular SeasonOlympiastadion BerlinF. WillenborgJürgen KlinsmannChristian Streich1.1.022
43030732019-12-2115:30:00.000Germany - 1. Bundesliga2019/2020Bayern MunichWolfsburg20available2019-12-23T18:02:36.45417Regular SeasonAllianz ArenaC. DingertHans-Dieter FlickOliver Glasner 1.1.022

Lineups

sb.lineups(match_id=303299)["Eintracht Frankfurt"]
player_idplayer_nameplayer_nicknamebirth_dateplayer_genderplayer_heightplayer_weightjersey_numbercountry
03204Almamy TouréNone1996-04-28male182.072.018Mali
15591Filip KostićNone1992-11-01male184.082.010Serbia
27713Obite Evan N"DickaEvan N'Dicka1999-08-20male190.0NaN2France
38307Martin HintereggerNone1992-09-07male184.083.013Austria
48669Mijat GaćinovićNone1995-02-08male175.066.011Serbia

Events

The default settings for querying events return a single dataframe with all event types and event attributes.

events = sb.events(match_id=303299)
ball_receipt_outcomeball_recovery_offensiveball_recovery_recovery_failureblock_deflectioncarry_end_locationclearance_aerial_wonclearance_body_partclearance_headclearance_left_footclearance_right_footcounterpressdribble_no_touchdribble_outcomedribble_overrunduel_outcomeduel_typedurationfoul_committed_advantagefoul_committed_cardfoul_won_advantagefoul_won_defensivegoalkeeper_body_partgoalkeeper_end_locationgoalkeeper_outcomegoalkeeper_positiongoalkeeper_techniquegoalkeeper_typeidindexinjury_stoppage_in_chaininterception_outcomelocationmatch_idminuteoff_cameraoutpass_aerial_wonpass_anglepass_assisted_shot_idpass_body_partpass_crosspass_cut_backpass_deflectedpass_end_locationpass_goal_assistpass_heightpass_lengthpass_outcomepass_outswingingpass_recipientpass_shot_assistpass_straightpass_switchpass_techniquepass_through_ballpass_typepass_xclaimperiodplay_patternplayerpositionpossessionpossession_teamrelated_eventssecondshot_aerial_wonshot_body_partshot_end_locationshot_first_timeshot_freeze_frameshot_key_pass_idshot_one_on_oneshot_outcomeshot_statsbomb_xgshot_statsbomb_xg2shot_techniqueshot_typesubstitution_outcomesubstitution_replacementteamtimestamptypeunder_pressure
500NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN3.498736NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN84828c06-41b5-44eb-aa92-1710bdb818ac1838NaNNaN[50.1, 16.6]30329947NaNNaNNaN2.720095NaNLeft FootNaNNaNNaN[13.3, 33.1]NaNGround Pass40.329765NaNNaNFrederik RønnowNaNNaNNaNNaNNaNNaNNaN2Regular PlayObite Evan N"DickaLeft Center Back103Eintracht Frankfurt[ae3094e3-faa3-4608-8284-d9b8cca77711, c1202f1c-0831-4e88-83b2-597f56f0c858]52NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNEintracht Frankfurt00:02:52.438PassTrue
501NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN3.604236NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN9061cd20-513b-499f-b925-f1de5f2412811840NaNNaN[13.3, 33.1]30329947NaNNaNNaN-0.153945NaNRight FootNaNNaNNaN[77.1, 23.2]NaNHigh Pass64.563540IncompleteNaNMijat GaćinovićNaNNaNNaNNaNNaNNaNNaN2Regular PlayFrederik RønnowGoalkeeper103Eintracht Frankfurt[8e6495a7-782a-4f1a-845f-3ec50d761a1e, ff758a12-1ba6-4dd4-8b2c-7d39aa7aed97]55NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNEintracht Frankfurt00:02:55.937PassNaN
502NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN2.101999NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN8e6495a7-782a-4f1a-845f-3ec50d761a1e1842NaNNaN[43.0, 56.9]30329947NaNNaNNaN-0.703110NaNHeadNaNNaNNaN[64.0, 39.1]NaNHigh Pass27.528894NaNNaNAmine HaritNaNNaNNaNNaNNaNRecoveryNaN2Regular PlayOzan Muhammed KabakRight Center Back104Schalke 04[9061cd20-513b-499f-b925-f1de5f241281, be6dfe7d-7596-4cc2-8cd9-8c17d064317e]59NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNSchalke 0400:02:59.541PassNaN
503NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN1.187459NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN86431bc7-210a-4868-8e18-26ff38becefc1854NaNNaN[65.9, 12.6]30329948NaNNaNNaN-0.730239NaNRight FootNaNNaNNaN[74.5, 4.9]NaNGround Pass11.543396NaNNaNAmine HaritNaNNaNNaNNaNNaNNaNNaN2Regular PlaySuat SerdarLeft Defensive Midfield104Schalke 04[761b4e65-8f64-464c-8153-6a98465208ba]7NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNSchalke 0400:03:07.689PassNaN
504NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN0.766628NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN6e58c713-622c-4246-8243-e4162e487a1c1858NaNNaN[79.1, 10.5]30329948NaNNaNNaN1.254940NaNRight FootNaNNaNNaN[84.1, 25.8]NaNGround Pass16.096273NaNNaNRabbi MatondoNaNNaNNaNNaNNaNNaNNaN2Regular PlayAmine HaritCenter Attacking Midfield104Schalke 04[b1960a76-d3ae-4ef3-a2cd-47eca8c25e0a, dd1575c0-a408-4177-944d-7e86d2f79181]11NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNSchalke 0400:03:11.719PassTrue

It's also possible to get distinct dataframes for each event type and/or to have distinct event attributes on their own columns

sb.events(match_id=303299, split=True, flatten_attrs=False)["dribbles"]
idindexperiodtimestampminutesecondtypepossessionpossession_teamplay_patternteamplayerpositionlocationdurationunder_pressurerelated_eventsdribblematch_id
0b190c01f-ad24-468c-8241-f955b91d996c131100:02:08.03228Dribble4Schalke 04Regular PlaySchalke 04Daniel CaligiuriRight Wing[110.2, 62.9]0.000000True[60f822df-5747-4787-b0f9-45bf5217eb8a]{'outcome': {'id': 8, 'name': 'Complete'}}303299
14d773c92-f89f-491e-b3e0-3a1d2e863148399100:08:48.623848Dribble18Schalke 04Regular PlaySchalke 04Amine HaritCenter Attacking Midfield[88.9, 22.7]0.000000True[93d829df-eea7-416b-95aa-7593828cfade]{'outcome': {'id': 8, 'name': 'Complete'}}303299
28a78dce4-998a-4e81-902c-9f3957cebc9d460100:13:30.2021330Dribble23Schalke 04Regular PlaySchalke 04Daniel CaligiuriRight Wing[99.5, 68.1]0.007309True[772c5aae-e34e-4364-8a98-7caf7636c90b]{'outcome': {'id': 9, 'name': 'Incomplete'}}303299
3e44d0122-2f2e-4771-820d-cc326a8b0379496100:14:10.1351410Dribble24Schalke 04From Throw InSchalke 04Suat SerdarLeft Defensive Midfield[41.2, 31.7]0.000000True[4de4039f-7efc-461b-b7d6-27c32ec2cd2a]{'outcome': {'id': 8, 'name': 'Complete'}}303299
49555afbd-d838-42c9-8f80-be3cd09e4c4a793100:20:18.4092018Dribble33Eintracht FrankfurtRegular PlayEintracht FrankfurtTimothy ChandlerRight Wing Back[81.8, 75.7]0.000000True[a5c88cee-6319-4c25-91cd-8a028d8dbfbf]{'outcome': {'id': 9, 'name': 'Incomplete'}}303299

Competition Events

All events from a given competition can be queried and stored on a single dataframe

events = sb.competition_events(
    country="Germany",
    division= "1. Bundesliga",
    season="2019/2020",
    gender="male"
)

grouped_events = sb.competition_events(
    country="Germany",
    division= "1. Bundesliga",
    season="2019/2020",
    split=True
)
grouped_events["dribbles"]
idindexperiodtimestampminutesecondtypepossessionpossession_teamplay_patternteamplayerpositionlocationdurationunder_pressurerelated_eventsdribblematch_id
0b190c01f-ad24-468c-8241-f955b91d996c131100:02:08.03228Dribble4Schalke 04Regular PlaySchalke 04Daniel CaligiuriRight Wing[110.2, 62.9]0.000000True[60f822df-5747-4787-b0f9-45bf5217eb8a]{'outcome': {'id': 8, 'name': 'Complete'}}303299
14d773c92-f89f-491e-b3e0-3a1d2e863148399100:08:48.623848Dribble18Schalke 04Regular PlaySchalke 04Amine HaritCenter Attacking Midfield[88.9, 22.7]0.000000True[93d829df-eea7-416b-95aa-7593828cfade]{'outcome': {'id': 8, 'name': 'Complete'}}303299
28a78dce4-998a-4e81-902c-9f3957cebc9d460100:13:30.2021330Dribble23Schalke 04Regular PlaySchalke 04Daniel CaligiuriRight Wing[99.5, 68.1]0.007309True[772c5aae-e34e-4364-8a98-7caf7636c90b]{'outcome': {'id': 9, 'name': 'Incomplete'}}303299
3e44d0122-2f2e-4771-820d-cc326a8b0379496100:14:10.1351410Dribble24Schalke 04From Throw InSchalke 04Suat SerdarLeft Defensive Midfield[41.2, 31.7]0.000000True[4de4039f-7efc-461b-b7d6-27c32ec2cd2a]{'outcome': {'id': 8, 'name': 'Complete'}}303299
49555afbd-d838-42c9-8f80-be3cd09e4c4a793100:20:18.4092018Dribble33Eintracht FrankfurtRegular PlayEintracht FrankfurtTimothy ChandlerRight Wing Back[81.8, 75.7]0.000000True[a5c88cee-6319-4c25-91cd-8a028d8dbfbf]{'outcome': {'id': 9, 'name': 'Incomplete'}}303299

360 Metrics

If you have access to 360 data for a competition, you can set include_360_metrics=True in the events() and competition_events() functions to retrieve 360 metrics such a line breaking passess together with the event data.

The open data does not include the 360 metrics. This is currently only available to customers with a data subscription.

events = sb.events(match_id=3837323, include_360_metrics=True)
comp_events = sb.competition_events(
            country="Europe",
            division="Champions League",
            season="2022/2023",
            include_360_metrics=True,
)
comp_events
50_50bad_behaviour_cardball_receipt_exceeds_distanceball_receipt_in_spaceball_receipt_outcomeball_recovery_offensiveball_recovery_recovery_failureblock_deflectionblock_offensiveblock_save_blockcarry_end_locationclearance_aerial_wonclearance_body_partclearance_headclearance_left_footclearance_otherclearance_right_footcounterpressdistance_to_nearest_defenderdribble_no_touchdribble_nutmegdribble_outcomedribble_overrunduel_outcomeduel_typedurationfoul_committed_advantagefoul_committed_cardfoul_committed_offensivefoul_committed_penaltyfoul_committed_typefoul_won_advantagefoul_won_defensivefoul_won_penaltygoalkeeper_body_partgoalkeeper_end_locationgoalkeeper_lost_in_playgoalkeeper_lost_outgoalkeeper_outcomegoalkeeper_positiongoalkeeper_punched_outgoalkeeper_shot_saved_off_targetgoalkeeper_shot_saved_to_postgoalkeeper_success_in_playgoalkeeper_techniquegoalkeeper_typehalf_start_late_video_startidindexinjury_stoppage_in_chaininterception_outcomeline_breaking_passlocationminutemiscontrol_aerial_wonnum_defenders_on_goal_side_of_actorobv_against_afterobv_against_beforeobv_against_netobv_for_afterobv_for_beforeobv_for_netobv_total_netoff_cameraoutpass_aerial_wonpass_anglepass_assisted_shot_idpass_body_partpass_crosspass_cut_backpass_deflectedpass_end_locationpass_goal_assistpass_heightpass_inswingingpass_lengthpass_miscommunicationpass_no_touchpass_outcomepass_outswingingpass_recipientpass_shot_assistpass_straightpass_switchpass_techniquepass_through_ballpass_typepass_xclaimperiodplay_patternplayerplayer_idplayer_off_permanentpositionpossessionpossession_teampossession_team_idrelated_eventssecondshot_aerial_wonshot_body_partshot_deflectedshot_end_locationshot_first_timeshot_freeze_frameshot_key_pass_idshot_one_on_oneshot_open_goalshot_outcomeshot_redirectshot_saved_off_targetshot_saved_to_postshot_statsbomb_xgshot_statsbomb_xg2shot_techniqueshot_typesubstitution_outcomesubstitution_replacementteamtimestamptypeunder_pressurevisible_opponentsvisible_teammates
0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN0.0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN3479244f-8234-43c9-a389-4ce587062b481NaNNaNNaNNaN0NaNNaNNoneNoneNoneNoneNoneNoneNoneNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN1Regular PlayNaNNaNNaNNaN1Real Madrid220NaN0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNReal Madrid00:00:00.000Starting XINaNNaNNaN
1NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN0.0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNc4f5a51b-741e-4920-ac32-02349b1f27552NaNNaNNaNNaN0NaNNaNNoneNoneNoneNoneNoneNoneNoneNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN1Regular PlayNaNNaNNaNNaN1Real Madrid220NaN0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNCeltic00:00:00.000Starting XINaNNaNNaN
2NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN0.0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN27be67e7-fdb5-4db9-92b6-8f3214cecec41NaNNaNNaNNaN0NaNNaNNoneNoneNoneNoneNoneNoneNoneNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN1Regular PlayNaNNaNNaNNaN1Juventus224NaN0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNJuventus00:00:00.000Starting XINaNNaNNaN
3NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN0.0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN819c381e-29c1-4f10-a6c3-acc3181cec142NaNNaNNaNNaN0NaNNaNNoneNoneNoneNoneNoneNoneNoneNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN1Regular PlayNaNNaNNaNNaN1Juventus224NaN0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNParis Saint-Germain00:00:00.000Starting XINaNNaNNaN
4NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN0.0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNe6d42d87-c78a-4286-94fd-4095e9f7b16f1NaNNaNNaNNaN0NaNNaNNoneNoneNoneNoneNoneNoneNoneNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN1Regular PlayNaNNaNNaNNaN1Manchester City36NaN0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNManchester City00:00:00.000Starting XINaNNaNNaN

360 Frames

The frame functions will return the raw 360 freeze frame data along with the visible area for each frame. This is returned at the player level so you have multiple rows per frame/event_id.

match_frames = sb.frames(match_id=3772072, fmt='dataframe')
comp_frames = sb.competition_frames(
    country="Germany",
    division= "1. Bundesliga",
    season="2019/2020"
)
match_frames
actordistance_from_edge_of_visible_areaevent_uuidkeeperlocationmatch_idteammatevisible_area
0False5.183739065b15cc-b550-48de-9a1e-a9608d8e6c6dFalse[79.14114105224532, 12.646560364129726]3855869False[50.8965834880119, 80.0, 55.8915648466696, 6.76382112514142, 80.0765213141343, 1.48859955554994, 113.056993108772, 80.0, 50.8965834880119, 80.0]
1False7.784551065b15cc-b550-48de-9a1e-a9608d8e6c6dFalse[80.68650097437124, 23.040779651892883]3855869True[50.8965834880119, 80.0, 55.8915648466696, 6.76382112514142, 80.0765213141343, 1.48859955554994, 113.056993108772, 80.0, 50.8965834880119, 80.0]
2False8.873694065b15cc-b550-48de-9a1e-a9608d8e6c6dFalse[80.20033992405365, 24.695673759901382]3855869False[50.8965834880119, 80.0, 55.8915648466696, 6.76382112514142, 80.0765213141343, 1.48859955554994, 113.056993108772, 80.0, 50.8965834880119, 80.0]
3False9.738309065b15cc-b550-48de-9a1e-a9608d8e6c6dFalse[82.43349155444821, 32.24426347120625]3855869False[50.8965834880119, 80.0, 55.8915648466696, 6.76382112514142, 80.0765213141343, 1.48859955554994, 113.056993108772, 80.0, 50.8965834880119, 80.0]
4False11.049633065b15cc-b550-48de-9a1e-a9608d8e6c6dFalse[81.320294294838, 32.98015558905158]3855869True[50.8965834880119, 80.0, 55.8915648466696, 6.76382112514142, 80.0765213141343, 1.48859955554994, 113.056993108772, 80.0, 50.8965834880119, 80.0]

Aggregated Stats

For customers we also provide aggregated statistics at the player-match, player-season and team-season levels.

player_match = sb.player_match_stats(3772072)
player_season = sb.player_season_stats(competition_id=9, season_id=42)
team_match = sb.team_match_stats(3772072)
team_season = sb.team_season_stats(competition_id=9, season_id=42)

player_match
player_match_pressuresplayer_match_long_ballsplayer_match_shot_touch_ratioplayer_match_passes_into_boxplayer_match_pressure_duration_avgplayer_match_crossing_ratioplayer_match_op_f3_forward_passesplayer_match_passing_ratioteam_idplayer_match_successful_passesplayer_match_op_xgbuildup_per_possessionplayer_match_op_xgchainplayer_match_op_passes_into_boxplayer_match_deep_progressionsplayer_match_turnoversplayer_match_counterpressured_action_failsplayer_match_passesplayer_match_key_passesplayer_match_dispossessionsplayer_match_penalties_wonplayer_match_through_ballsteam_nameplayer_match_op_passesplayer_match_dribblesplayer_match_clearancesplayer_match_forward_passesplayer_match_np_xg_per_shotplayer_match_counterpressuresplayer_idplayer_match_op_xaplayer_match_op_xgchain_per_possessionplayer_match_minutesplayer_match_pressured_long_ballsplayer_match_op_f3_sideways_passesplayer_match_dribbles_facedplayer_match_np_xgplayer_match_goalsplayer_match_op_key_passesplayer_match_aerial_ratioplayer_match_op_shotsplayer_match_successful_crossesplayer_match_shots_blockedplayer_match_op_f3_passesplayer_match_op_assistsplayer_match_long_ball_ratioaccount_idplayer_match_np_shotsplayer_match_challenge_ratioplayer_match_touchesplayer_match_pressure_regainsplayer_match_crosses_into_boxplayer_match_foulsplayer_match_sideways_passesplayer_match_aerialsplayer_match_touches_inside_boxplayer_match_counterpressure_duration_totalplayer_match_successful_aerialsplayer_match_box_cross_ratioplayer_match_xgbuildup_per_possessionplayer_match_dribbled_pastplayer_match_pressure_duration_totalplayer_match_op_xgbuildupplayer_match_np_shots_on_targetplayer_match_interceptionsplayer_match_counterpressure_duration_avgplayer_match_xgchain_per_possessionplayer_match_successful_long_ballsplayer_match_op_f3_backward_passesplayer_match_xgchainplayer_match_tacklesplayer_match_assistsplayer_match_sp_xaplayer_match_aggressive_actionsplayer_nameplayer_match_xamatch_idplayer_match_passes_inside_boxplayer_match_possessionplayer_match_pressured_action_failsplayer_match_crossesplayer_match_fouls_wonplayer_match_xgbuildupplayer_match_backward_passesplayer_match_unpressured_long_ballsplayer_match_np_goals
0NaN100.0000000NaNNaN00.842105870320.0031910.105292000NaN380000Arminia Bielefeld33009NaNNaN91940.0000000.00319194.216671000.00000000NaN000000.600000480NaN650002900NaN0NaN0.0031910NaN0.10529200NaN0.003191600.105292000.0000000Stefan Ortega0.000000377207200.491135NaN000.105292090
18.000.03333300.5706260.000.812500870130.0037260.1605820130.0161300Arminia Bielefeld101100.0347371.092100.0438810.00729991.900001400.034737010.28571410060NaN4811.03000010750.3275412NaN0.00372604.5650100.081964000.3275410.007299020.160582100.0000009Fabian Klos0.043881377207210.4911350.0110.081964600
27.0130.00000011.7954110.010.852941190580.0179930.7736870300.0681000Union Berlin60024NaN0.091640.0000000.01799394.216672300.000000000.666667001400.6153854801.01221025130NaN20.00.017993012.5678750.77368701NaN0.019504800.838693200.04322711Christopher Trimmel0.043227377207200.5088650.0100.77368713130
33.040.01369910.744943NaN10.777778870350.0021960.0900221110.0450100Arminia Bielefeld4001180.0194680.0243430.0000000.00219694.216671100.019468000.000000101200.750000481NaN730002211NaN00.00.00304302.2348300.09002200NaN0.003043300.124760000.0000003Jacob Laursen0.000000377207200.4911350.0010.124760540
414.060.00000000.592216NaN00.763158870290.0060480.2116690100.0380200Arminia Bielefeld36017NaN2.092040.0000000.00604894.216671130.000000000.500000000101.0000004800.06410429200.6766101NaN0.00604838.2910250.211669020.3383050.006048600.211669000.00000018Manuel Prietl0.000000377207200.4911350.0010.211669260

Raw Files

Alternatively, entities can be accessed as python dictionaries serving as an interface to raw jsons and without performing any preprocessing


sb.competitions(fmt="dict")

sb.matches(competition_id=9, season_id=42, fmt="dict")

sb.lineups(match_id=303299, fmt="dict")

sb.events(303299, fmt="dict")

sb.competition_events(
    country="Germany",
    division= "1. Bundesliga",
    season="2019/2020",
    gender="male",
    fmt="dict"
)

sb.frames(3772072, fmt="dict")

sb.competition_frames(
    country="Germany",
    division= "1. Bundesliga",
    season="2021/2022",
    gender="male",
    fmt="dict"
)

sb.player_match_stats(3772072, fmt="dict")

sb.player_season_stats(competition_id=9, season_id=42, fmt="dict")

sb.team_match_stats(3772072, fmt="dict")

sb.team_season_stats(competition_id=9, season_id=42, fmt="dict")

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc