Skip to main content
GET
/
athletes
/
chartEvents
Athlete Chart Events
curl --request GET \
  --url https://v1.football.sportsapipro.com/athletes/chartEvents \
  --header 'x-api-key: <api-key>'
{
  "chartEvents": [
    {
      "athleteId": 123,
      "mostCommonGoalZone": [
        "<string>"
      ],
      "penaltyGoals": "<string>",
      "penaltyConversions": "<string>",
      "events": [
        {
          "xg": "<string>",
          "xgot": "<string>",
          "bodyPart": "<string>",
          "goalDescription": "<string>",
          "time": "<string>",
          "gameId": 123,
          "line": 123,
          "side": 123,
          "outcome": {
            "id": 123,
            "name": "<string>",
            "y": 123,
            "z": 123
          }
        }
      ]
    }
  ],
  "athletes": "<array>",
  "games": "<array>",
  "competitions": "<array>"
}

Endpoint

GET https://v1.football.sportsapipro.com/athletes/chartEvents

Overview

Retrieves comprehensive shot and goal event data for a specific athlete, including expected goals (xG), shot positions, goal zones, and penalty conversion statistics. This endpoint is ideal for building player performance visualizations, shot maps, and detailed attacking analytics.

Query Parameters

ParameterTypeRequiredDescription
athletesintegerYesAthlete ID to fetch chart events for
appTypeIdintegerNoApplication type (auto-resolved)
langIdintegerNoLanguage ID (auto-resolved)
timezoneNamestringNoTimezone for date/time values (auto-resolved or specify e.g., America/New_York)
userCountryIdintegerNoUser country ID (auto-resolved)
Parameters like appTypeId, langId, timezoneName, and userCountryId are auto-resolved based on request context.

Request Examples

curl -X GET "https://v1.football.sportsapipro.com/athletes/chartEvents?athletes=874" \
  -H "x-api-key: YOUR_API_KEY"

Response Structure

{
  "chartEvents": [
    {
      "athleteId": 874,
      "mostCommonGoalZone": ["Low Left"],
      "penaltyGoals": "3/4",
      "penaltyConversions": "75 %",
      "events": [
        {
          "xg": "0.79",
          "xgot": "0.98",
          "bodyPart": "Left foot",
          "goalDescription": "High Centre",
          "key": "34318756",
          "competitorNum": 2,
          "time": "32'",
          "status": 6,
          "playerId": 77832,
          "line": 50.0,
          "side": 88.5,
          "type": 0,
          "subType": 9,
          "gameId": 4318756,
          "outcome": {
            "y": 51.3,
            "z": 28.5,
            "id": 2,
            "name": "Saved"
          }
        }
      ],
      "eventTypes": [
        {
          "id": 8,
          "value": 0,
          "name": "Regular Play"
        }
      ],
      "statuses": [
        {
          "id": 6,
          "name": "1st Half",
          "symbolName": "1st",
          "isActive": true
        }
      ],
      "eventSubTypes": [
        {
          "id": 81,
          "value": 9,
          "name": "Penalty"
        }
      ]
    }
  ],
  "athletes": [
    {
      "id": 874,
      "name": "Lionel Messi",
      "shortName": "Messi",
      "nameForURL": "lionel-messi",
      "sportId": 1,
      "clubId": 54729,
      "nationalityId": 10,
      "imageVersion": 53,
      "clubName": "Inter Miami"
    }
  ],
  "sports": [...],
  "countries": [...],
  "competitions": [...],
  "games": [...]
}

Response Fields

Chart Events Object

FieldTypeDescription
athleteIdintegerID of the athlete these events belong to
mostCommonGoalZonestring[]Array of goal zones the player most frequently targets
penaltyGoalsstringPenalty goals ratio (e.g., “3/4”)
penaltyConversionsstringPenalty conversion percentage (e.g., “75 %“)
eventsarrayArray of shot/goal event objects
eventTypesarrayTypes of events (Regular Play, Set Piece, etc.)
statusesarrayMatch period statuses (1st Half, 2nd Half, etc.)
eventSubTypesarraySub-types of events (Penalty, Free Kick, etc.)

Event Object

FieldTypeDescription
xgstringExpected goals value for the shot (0-1 scale)
xgotstringExpected goals on target value
bodyPartstringBody part used (“Left foot”, “Right Foot”, “Header”)
goalDescriptionstringGoal zone description (“Low Left”, “High Centre”, etc.)
keystringUnique event identifier
competitorNumintegerTeam number (1 = home, 2 = away)
timestringMinute of the event (e.g., “32’“)
statusintegerMatch period status ID
playerIdintegerPlayer ID who took the shot
linenumberVertical position on pitch (0-100)
sidenumberHorizontal position on pitch (0-100)
typeintegerEvent type ID
subTypeintegerEvent sub-type ID
gameIdintegerID of the match where event occurred
outcomeobjectShot outcome with goal position and result

Outcome Object

FieldTypeDescription
ynumberHorizontal goal position (0-100)
znumberVertical goal position (0-100, 0 = ground level)
idintegerOutcome ID (0 = Goal, 1 = Blocked, 2 = Saved, 3 = Off Target)
namestringOutcome name

Outcome Types

IDNameDescription
0GoalShot resulted in a goal
1BlockedShot was blocked
2SavedShot was saved by the goalkeeper
3Off TargetShot went off target

Goal Zones

Common goal zone descriptions:
  • Low Left - Bottom left corner
  • Low Right - Bottom right corner
  • Low Centre - Low center of goal
  • High Left - Top left corner
  • High Right - Top right corner
  • High Centre - Top center of goal

Use Cases

  1. Shot Maps: Use line and side coordinates to plot shots on a pitch visualization
  2. Goal Zone Heatmaps: Use goalDescription and outcome to show where players aim
  3. xG Analysis: Calculate total xG vs actual goals for finishing analysis
  4. Penalty Statistics: Display penalty conversion rates
  5. Body Part Analysis: Show which foot/header the player favors
  6. Match Context: Link events to specific games for detailed breakdowns

Example: Calculate Player xG Performance

const response = await fetch(
  "https://v1.football.sportsapipro.com/athletes/chartEvents?athletes=874",
  { headers: { "x-api-key": "YOUR_API_KEY" } }
);
const data = await response.json();

const events = data.chartEvents?.[0]?.events || [];
const goals = events.filter(e => e.outcome?.id === 0).length;
const totalXg = events.reduce((sum, e) => sum + parseFloat(e.xg || 0), 0);
const xgDiff = goals - totalXg;

console.log(`Goals: ${goals}`);
console.log(`Total xG: ${totalXg.toFixed(2)}`);
console.log(`xG Difference: ${xgDiff > 0 ? '+' : ''}${xgDiff.toFixed(2)}`);
// Positive = overperforming, Negative = underperforming

Authorizations

x-api-key
string
header
required

Your SportsAPI Pro API key

Query Parameters

athletes
integer
required

Athlete ID to fetch chart events for

Example:

874

Response

Athlete chart events retrieved successfully

chartEvents
object[]

Chart events data for the athlete

athletes
array

Athlete information

games
array

Referenced games

competitions
array

Referenced competitions