cURL
curl --request GET \ --url https://v1.tennis.sportsapipro.com/games/current \ --header 'x-api-key: <api-key>'
{ "games": [ { "id": 123, "statusText": "<string>", "statusGroup": 123, "homeCompetitor": { "id": 123, "name": "<string>", "score": "<string>", "imageUrl": "<string>" }, "awayCompetitor": { "id": 123, "name": "<string>", "score": "<string>", "imageUrl": "<string>" }, "competition": { "id": 123, "name": "<string>", "country": { "id": 123, "name": "<string>" }, "hasStandings": true }, "startTime": "2023-11-07T05:31:56Z" } ], "lastUpdateId": 123 }
Get all currently live tennis matches
curl -X GET "https://v1.tennis.sportsapipro.com/games/current" \ -H "x-api-key: YOUR_API_KEY"
lastUpdateId
let lastUpdateId = null; async function poll() { const url = lastUpdateId ? `https://v1.tennis.sportsapipro.com/games/current?lastUpdateId=${lastUpdateId}` : 'https://v1.tennis.sportsapipro.com/games/current'; const response = await fetch(url, { headers: { 'x-api-key': 'YOUR_API_KEY' } }); const data = await response.json(); lastUpdateId = data.lastUpdateId; // Only changed data is returned after first request return data.games; } setInterval(poll, 5000);
?competitions=512
Your SportsAPI Pro API key
Filter by competition ID (e.g., 512 for Wimbledon)
512
For efficient polling - returns only updates since this ID
Live matches retrieved successfully
Show child attributes
Use for subsequent polling requests
Was this page helpful?