niesfutbol / ideas

0 stars 0 forks source link

SofaScore: shotmap #80

Open nepito opened 3 months ago

nepito commented 3 months ago

image Debería de poder reproducir con los siguientes datos:

shot = {'player': {'name': 'Aldo Rocha', 'slug': 'aldo-rocha', 'shortName': 'A. Rocha', 'position': 'M', 'jerseyNumber': '26', 'userCount': 107, 'id': 305732}, 'isHome': True, 'shotType': 'goal', 'goalType': 'regular', 'situation': 'free-kick', 'playerCoordinates': {'x': 25, 'y': 43, 'z': 0}, 'bodyPart': 'right-foot', 'goalMouthLocation': 'low-left', 'goalMouthCoordinates': {'x': 0, 'y': 54.6, 'z': 16.5}, 'id': 2609132, 'time': 81, 'timeSeconds': 4808, 'draw': {'start': {'x': 43, 'y': 25}, 'end': {'x': 45.4, 'y': 0}, 'goal': {'x': 45.4, 'y': 83.5}}, 'reversedPeriodTime': 10, 'reversedPeriodTimeSeconds': 592, 'incidentType': 'shot'}
response = requests.get('https://api.sofascore.com/api/v1/event/11911091/shotmap', headers=requests_headers)

Referencias

nepito commented 3 months ago

Otro ejemplo:

image

Con los datos:

shot = {'player': {'name': 'Jesús Gallardo', 'slug': 'jesus-gallardo', 'shortName': 'J. Gallardo', 'position': 'D', 'jerseyNumber': '17', 'userCount': 288, 'id': 770253, 'fieldTranslations': {'nameTranslation': {'ar': 'خيسوس غالاردو'}, 'shortNameTranslation': {'ar': 'خ. غالاردو'}}}, 'isHome': False, 'shotType': 'goal', 'goalType': 'regular', 'situation': 'corner', 'playerCoordinates': {'x': 5.4, 'y': 50.9, 'z': 0}, 'bodyPart': 'head', 'goalMouthLocation': 'high-centre', 'goalMouthCoordinates': {'x': 0, 'y': 48.4, 'z': 31.6}, 'id': 2609096, 'time': 57, 'timeSeconds': 3400, 'draw': {'start': {'x': 50.9, 'y': 5.4}, 'end': {'x': 51.6, 'y': 0}, 'goal': {'x': 51.6, 'y': 68.4}}, 'reversedPeriodTime': 34, 'reversedPeriodTimeSeconds': 2000, 'incidentType': 'shot'}
nepito commented 3 months ago
am |>
  group_by(teamId) |>
  summarize(
    xg = sum(expectedGoals),
    shoots = n(),
    xGoT = sum(expectedGoalsOnTarget, na.rm = T)
  ) |>
  pivot_longer(cols=2:4, names_to="metrica",values_to="values")
nepito commented 3 months ago

Aquí podemos encontrar las estadísticas del partido:

json_fotmob["props"]["pageProps"]["content"]["stats"]["Periods"]["All"]["stats"][0]["stats"]
nepito commented 3 months ago

Jornada 13

nepito commented 3 months ago

La explicación del partido Arsenal vs Crystal Palace

nepito commented 2 months ago

CONCACAF Champions Cup

SofaScore