← Back to Documentation

Match Statistics

GET https://api.worldcupapi.com/statistics

Description

Get comprehensive statistics for a specific World Cup match. Includes possession, shots, passes, fouls, corners, and other detailed match statistics for both teams.

Parameters

Name Type Required Description
key string Yes Your API key for authentication
match_id integer Yes The unique identifier of the match

Example Request

GET /statistics?key=YOUR_API_KEY

Example Response

{
    "yellow_cards": "3:1",
    "red_cards": "0:0",
    "substitutions": "4:4",
    "possesion": "54:46",
    "free_kicks": "16:11",
    "goal_kicks": "1:11",
    "throw_ins": "27:8",
    "offsides": "0:3",
    "corners": "7:3",
    "shots_on_target": "4:3",
    "shots_off_target": "6:0",
    "attempts_on_goal": "10:3",
    "saves": "2:4",
    "fauls": "11:13",
    "treatments": "2:1",
    "penalties": "0:2",
    "shots_blocked": "4:0",
    "dangerous_attacks": "94:29",
    "attacks": "136:89"
}

Code Examples

JavaScript (Fetch)

const response = await fetch('https://api.worldcupapi.com/statistics?key=YOUR_API_KEY');
const data = await response.json();
console.log(data);

Python (Requests)

import requests

url = 'https://api.worldcupapi.com/statistics'
params = {'key': 'YOUR_API_KEY'}
response = requests.get(url, params=params)
data = response.json()
print(data)
			

PHP (cURL)

$url = 'https://api.worldcupapi.com/statistics?key=YOUR_API_KEY';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
			

Java (HttpURLConnection)

URL url = new URL("https://api.worldcupapi.com/statistics?key=YOUR_API_KEY");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String response = in.readLine();
			

C# (HttpClient)

using (var client = new HttpClient())
{
	var response = await client.GetAsync("https://api.worldcupapi.com/statistics?key=YOUR_API_KEY");
	var content = await response.Content.ReadAsStringAsync();
	var data = JsonSerializer.Deserialize<object>(content);
}
			

Go

import (
	"encoding/json"
	"net/http"
)

resp, err := http.Get("https://api.worldcupapi.com/statistics?key=YOUR_API_KEY")
if err != nil {
	log.Fatal(err)
}
defer resp.Body.Close()

var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)
			

Ruby

require 'net/http'
require 'json'

uri = URI('https://api.worldcupapi.com/statistics?key=YOUR_API_KEY')
response = Net::HTTP.get_response(uri)
data = JSON.parse(response.body)