JaseZiv / worldfootballR

A wrapper for extracting world football (soccer) data from FBref, Transfermark, Understat
https://jaseziv.github.io/worldfootballR/
444 stars 60 forks source link

No data from fotmob_get_match_details #121

Closed ghost closed 2 years ago

ghost commented 2 years ago

Trying to get shot-event data from fotmob matches.

R-CODE:

library(worldfootballR) library(dplyr) library(tidyr)

fotmob_matches <- c(3609994, 3610132) match_details <- fotmob_get_match_details(fotmob_matches)

dplyr::glimpse(match_details) match_shots <- match_details %>% dplyr::select( match_id, shots ) %>% tidyr::unnest(shots) dplyr::glimpse(match_shots)

match_shots

OUTPUT:

fotmob_matches <- c(3609994, 3610132) match_details <- fotmob_get_match_details(fotmob_matches)

dplyr::glimpse(match_details) Rows: 0 Columns: 1 $ match_id match_shots <- match_details %>% dplyr::select( match_id, shots ) %>% tidyr::unnest(shots) Error in dplyr::select(): ! Can't subset columns that don't exist. x Column shots doesn't exist. Run rlang::last_error() to see where the error occurred. dplyr::glimpse(match_shots) Error in dplyr::glimpse(match_shots) : object 'match_shots' not found

match_shots Error: object 'match_shots' not found

JaseZiv commented 2 years ago

@tonyelhabr any idea what’s happening here?

tonyelhabr commented 2 years ago

Looks like they added "api" to their match urls. So, https://www.fotmob.com/matchDetails?matchId=3609994 is now https://www.fotmob.com/api/matchDetails?matchId=3609994