Description
Get all teams and their complete squads participating in World Cup 2026. Includes all registered players for each team with their positions and jersey numbers.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
key |
string | Yes | Your API key for authentication |
team_id |
integer | Yes | The unique identifier of the team |
lang |
string | No | Language code (es, fr, de, etc.) - defaults to English |
Example Request
GET /squads?key=YOUR_API_KEY
Example Response
[
{
"id": "2170",
"name": "Lionel Messi",
"shirt_number": "10",
"position": "FW"
},
{
"id": "9563",
"name": "Gonzalo Higuain",
"shirt_number": "9",
"position": "FW"
}
]
Code Examples
JavaScript (Fetch)
const response = await fetch('https://api.worldcupapi.com/squads?key=YOUR_API_KEY');
const data = await response.json();
console.log(data);
Python (Requests)
import requests
url = 'https://api.worldcupapi.com/squads'
params = {'key': 'YOUR_API_KEY'}
response = requests.get(url, params=params)
data = response.json()
print(data)
PHP (cURL)
$url = 'https://api.worldcupapi.com/squads?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/squads?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/squads?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/squads?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/squads?key=YOUR_API_KEY')
response = Net::HTTP.get_response(uri)
data = JSON.parse(response.body)