Description
Get real-time scores and updates for all ongoing World Cup matches. This endpoint provides live match data including current scores, match status, time elapsed, and basic match information.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
key |
string | Yes | Your API key for authentication |
lang |
string | No | Language code (es, fr, de, etc.) - defaults to English |
Example Request
GET /livescores?key=YOUR_API_KEY
Example Response
[
{
"last_changed": "2023-12-18 08:42:53",
"home": {
"id": 211,
"logo": "https:\/\/cdn.worldcupapi.com\/teams\/b9d463b08c43de617618f7ec65a54cc3.png",
"name": "Croatia"
},
"status": "IN PLAY",
"location": "Stadion Maksimir",
"scheduled": "08:00",
"id": 483252,
"time": "43",
"fixture_id": 1657338,
"odds": {
"live": {
"1": 5.60,
"2": 1.61,
"X": 3.55
},
"pre": {
"1": 2,
"2": 3.45,
"X": 3.85
}
},
"away": {
"id": 208,
"logo": "https:\/\/cdn.worldcupapi.com\/teams\/004d52954bd4936cc14e30b4511073ab.png",
"name": "Switzerland"
},
"outcomes": {
"half_time": null,
"full_time": null,
"extra_time": null,
"penalty_shootout": null
},
"scores": {
"score": "0 - 1",
"ht_score": "",
"ft_score": "",
"et_score": "",
"ps_score": ""
}
},
{
"last_changed": "2023-12-18 08:42:52",
"home": {
"id": 1448,
"logo": "https:\/\/cdn.worldcupapi.com\/teams\/004d52954bd4936cc14e30b4511073ab.png",
"name": "Brazil"
},
"status": "IN PLAY",
"location": "Maracana",
"scheduled": "08:00",
"id": 483253,
"time": "43",
"fixture_id": 1624810,
"odds": {
"live": {
"1": 2.38,
"2": 3.60,
"X": 2.43
},
"pre": {
"1": 1.98,
"2": 3.30,
"X": 3.15
}
},
"away": {
"id": 1456,
"logo": "https:\/\/cdn.worldcupapi.com\/teams\/004d52954bd4936cc14e30b4511073ab.png",
"name": "England"
},
"outcomes": {
"half_time": null,
"full_time": null,
"extra_time": null,
"penalty_shootout": null
},
"scores": {
"score": "0 - 0",
"ht_score": "",
"ft_score": "",
"et_score": "",
"ps_score": ""
}
}
]
Code Examples
JavaScript (Fetch)
const response = await fetch('https://api.worldcupapi.com/livescores?key=YOUR_API_KEY');
const data = await response.json();
console.log(data);
Python (Requests)
import requests
url = 'https://api.worldcupapi.com/livescores'
params = {'key': 'YOUR_API_KEY'}
response = requests.get(url, params=params)
data = response.json()
print(data)
PHP (cURL)
$url = 'https://api.worldcupapi.com/livescores?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/livescores?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/livescores?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/livescores?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/livescores?key=YOUR_API_KEY')
response = Net::HTTP.get_response(uri)
data = JSON.parse(response.body)