Overview

The MatchAttacks endpoint returns the classified attacking sequences for a specific match. The endpoint analyzes match events and groups them into attack sequences based on configurable attack-classification parameters. Each returned attack includes:
  • Attack type/category
  • Match and team identifiers
  • Start and end time
  • Half
  • Ball touches and passes
  • xG and xT values
  • Attack value
  • Start and end pitch locations
  • Completion status
  • Full list of events included in the attack
The response is returned in two structures:
  • All: flat list of all filtered attacks
  • Categories: attacks grouped by attack type
This endpoint is typically used for:
  • Match attacking analysis
  • Tactical dashboards
  • Video clipping workflows
  • Scouting reports
  • Team performance reports
  • Attack pattern discovery
  • Event-based video navigation
GET /api.php

Parameters

offset
object
Video offset settings used when generating attack timing. Includes before as seconds before attack start and after as seconds after attack end.
start_events
array
Optional list of event filters used to match attack-start events. Each item may include id for event ID, result for event result ID, and extra for event extra ID.
end_events
array
Optional list of event filters used to match attack-end events. Each item may include id for event ID, result for event result ID, and extra for event extra ID.
areaFrom
object
Optional pitch area filter for where the attack starts. Coordinates use a 120 x 80 pitch scale and include x, y, x2, and y2.
areaTo
object
Optional pitch area filter for where the attack ends. Coordinates use a 120 x 80 pitch scale and include x, y, x2, and y2.
team_id
integer
Unique identifier of the team. Use -1 to avoid applying a team filter.

Attack Classification Parameters

The param object controls how attacks are clustered and classified.
{
  "cluster_max_consecutive_opponent_events": 2,
  "cluster_max_time_between_consecutive_events": 7,
  "attack_min_passes": 2,
  "organized_min_passes": 5,
  "organized_min_x": 67,
  "transition_max_passes": 4,
  "transition_max_time": 10,
  "transition_max_back_passes": 3,
  "set_piece_max_events_before_special": 3,
  "important_throwin_min_x": 75
}

Payload Example

{
  "match_id": 25997,
  "team_id": 101,
  "offset": {
    "before": 5,
    "after": 5
  },
  "param": {
    "cluster_max_consecutive_opponent_events": 2,
    "cluster_max_time_between_consecutive_events": 7,
    "attack_min_passes": 2,
    "organized_min_passes": 5,
    "organized_min_x": 67,
    "transition_max_passes": 4,
    "transition_max_time": 10,
    "transition_max_back_passes": 3,
    "set_piece_max_events_before_special": 3,
    "important_throwin_min_x": 75
  },
  "start_players": [],
  "inner_players": [],
  "end_players": [],
  "start_events": [],
  "end_events": [],
  "areaFrom": null,
  "areaTo": null
}

Example Request

curl --request GET \
--url "https://korastats.pro/pro/api.php?module=api&api=MatchAttacks&version=V2&response=json&lang=en&key=YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "match_id": 25997,
  "team_id": 101,
  "offset": {
    "before": 5,
    "after": 5
  },
  "param": {
    "cluster_max_consecutive_opponent_events": 2,
    "cluster_max_time_between_consecutive_events": 7,
    "attack_min_passes": 2,
    "organized_min_passes": 5,
    "organized_min_x": 67,
    "transition_max_passes": 4,
    "transition_max_time": 10,
    "transition_max_back_passes": 3,
    "set_piece_max_events_before_special": 3,
    "important_throwin_min_x": 75
  }
}'
{
  "result": "success",
  "message": "Attacks successfully retireived",
  "data": {
    "All": [
      {
        "strSort": "1 00:12:35",
        "strType": "Organized Attack",
        "intMatchID": 25997,
        "intTeamID": 101,
        "intBallTouches": 8,
        "intPasses": 5,
        "decXG": 0.12,
        "decXT": 0.34,
        "decAttackValue": 0.46,
        "strFromTime": "00:12:35",
        "strToTime": "00:12:52",
        "intHalf": 1,
        "decFromSec": 755,
        "decToSec": 772,
        "ptStart": {
          "x": 35,
          "y": 48
        },
        "ptEnd": {
          "x": 88,
          "y": 42
        },
        "boolIsCompleted": true,
        "arrEvents": [
          {
            "intMatchEventID": 100001,
            "objEventType": {
              "intID": 1,
              "strEventEn": "Pass"
            },
            "objEventResult": {
              "intID": 1,
              "strEventResultEn": "Successful"
            },
            "objEventExtra": null,
            "objTeam": {
              "intID": 101,
              "strTeamNameEn": "Team Name"
            },
            "objPlayer": {
              "intID": 9001,
              "strNickNameEn": "Player Name",
              "intShirtNumber": 10
            },
            "ptLocation": {
              "x": 35,
              "y": 48
            },
            "strTime": "00:12:35",
            "decSecond": 755
          }
        ]
      }
    ],
    "Categories": {
      "Organized Attack": [
        {
          "strSort": "1 00:12:35",
          "strType": "Organized Attack",
          "intMatchID": 25997,
          "intTeamID": 101,
          "intBallTouches": 8,
          "intPasses": 5,
          "decXG": 0.12,
          "decXT": 0.34,
          "decAttackValue": 0.46,
          "strFromTime": "00:12:35",
          "strToTime": "00:12:52",
          "intHalf": 1,
          "decFromSec": 755,
          "decToSec": 772,
          "ptStart": {
            "x": 35,
            "y": 48
          },
          "ptEnd": {
            "x": 88,
            "y": 42
          },
          "boolIsCompleted": true,
          "arrEvents": []
        }
      ]
    }
  }
}

Empty Result

If no attacks match the selected filters, the endpoint returns an error response:
{
  "result": "error",
  "message": "No attacks found, refine your search"
}