⚽ Kenya Football Data API

Complete developer manual – fetch tournament data, live scores, teams, players, and statistics

Version 1.0

1. Overview

This REST API provides programmatic access to football tournament data. You can retrieve teams, groups, fixtures, scores, players, goal scorers, and tournament statistics. All responses are in JSON format.

The API requires a valid API key and a tournament ID. Keys are issued per tournament and must be kept secret.

2. Authentication

Every request must include your API key. You can send it in two ways:

🔑 Example API key: 73c26a920a0552181c2bc20b15237713
Replace with your own key. Keys are tournament‑specific – a key for uftn0001 will not work for uftn0002.

3. API Endpoint

Base URL: https://www.kenyafootballdata.com/api.php
(For local testing: http://localhost:3000/api.php)

All requests are HTTP GET. Three parameters are required:

ParameterRequiredDescriptionExample
tYesTournament IDuftn0001
typeYesData type (see table below)teams
api_keyYesYour secret API key73c26a920a0552181c2bc20b15237713

4. Available Data Types (type)

TypeReturns
teamsAll teams participating: ID, name, logo, district, group, status.
groupsGroup names, description, venue, qualification/relegation spots, team count.
fixturesAll scheduled matches (past & future) with home/away, date, time, location, result if played.
scoresOnly finished matches: final score, result, points, attendance, gate collections.
statsOverall tournament totals: matches played, total goals, average goals, biggest win, best team.
playersRegistered players: name, position, shirt number, photo, team, licence status.
scorersTop 20 goal scorers: player name, goals, team.
statisticsDiscipline (yellow/red cards), assists (total + top assisters), injury count.

5. Example Requests & Responses

5.1 Get all teams in tournament uftn0001

Request URL:

https://www.kenyafootballdata.com/api.php?t=uftn0001&type=teams&api_key=YOUR_KEY

Response (truncated):

{
  "success": true,
  "data": [
    {
      "team_id": "uftm00001",
      "team_name": "Team 1",
      "team_logo": null,
      "district": "Mombasa",
      "group": "Group 1",
      "status": null
    },
    ...
  ]
}

5.2 Get top goal scorers

https://www.kenyafootballdata.com/api.php?t=uftn0001&type=scorers&api_key=YOUR_KEY
{
  "success": true,
  "data": [
    {"player_id": "ufp0000003", "player_name": "Player 3 Lovence", "goals": 4, "team_id": "uftm00001", "team_name": "Team 1"}
  ]
}

5.3 Get tournament statistics (cards, assists, injuries)

https://www.kenyafootballdata.com/api.php?t=uftn0001&type=statistics&api_key=YOUR_KEY
{
  "success": true,
  "data": {
    "disciplinary": { "yellow_cards": 4, "red_cards": 1 },
    "assists": { "total_assists": 8, "top_assists": [...] },
    "injuries": { "total_injuries": 2 },
    "top_card_recipients": [...]
  }
}

5.4 Get fixtures (schedule)

https://www.kenyafootballdata.com/api.php?t=uftn0001&type=fixtures&api_key=YOUR_KEY

5.5 Get finished scores

https://www.kenyafootballdata.com/api.php?t=uftn0001&type=scores&api_key=YOUR_KEY

6. Integration Examples

JavaScript (with fetch)

fetch('https://www.kenyafootballdata.com/api.php?t=uftn0001&type=teams&api_key=YOUR_KEY')
  .then(response => response.json())
  .then(data => {
    if (data.success) {
      console.log(data.data);
    } else {
      console.error(data.error);
    }
  });

PHP (using cURL)

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.kenyafootballdata.com/api.php?t=uftn0001&type=scorers&api_key=YOUR_KEY');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
if ($data['success']) {
    foreach ($data['data'] as $scorer) {
        echo $scorer['player_name'] . ' - ' . $scorer['goals'] . ' goals<br>';
    }
}
?>

Python (requests)

import requests
params = {'t': 'uftn0001', 'type': 'players', 'api_key': 'YOUR_KEY'}
resp = requests.get('https://www.kenyafootballdata.com/api.php', params=params)
data = resp.json()
if data['success']:
    for player in data['data']:
        print(player['name'], player['team']['name'])

cURL (command line)

curl "https://www.kenyafootballdata.com/api.php?t=uftn0001&type=stats&api_key=YOUR_KEY"

7. Error Handling & Status Codes

All errors return a JSON object with "success": false and an "error" field explaining the problem.

HTTP CodeMeaningError message example
200Success (even if no data, success=true)-
400Missing or invalid parameterMissing tournament id (t)
401Invalid/expired API key or missing keyInvalid or expired API key for this tournament.
404Tournament not foundTournament not found.
⚠️ Important: If you receive "Invalid type", check the spelling of the type parameter. Allowed values: teams, groups, fixtures, scores, stats, players, scorers, statistics.

8. Best Practices & Security

9. Frequently Asked Questions

❓ How do I get an API key?
Click the "Request API Key" button below or contact support.
❓ Why do I get a 401 error when my key is correct?
The key might be expired or revoked. Also ensure you are using the correct tournament ID – keys are per tournament.
❓ Can I use this API for a mobile app?
Yes, but do not embed the key in the app. Create a simple backend proxy that holds the key and forwards requests to our API.
❓ Is there a limit on requests?
Your administrator may set daily or hourly limits. Contact them for details.
❓ The data seems old. How often is it updated?
Data is updated in real time when scores, players, or fixtures are entered in the admin panel. There is no artificial delay.

10. Support & Contact

Request an API Key Test API (Explorer)
✅ Ready to integrate! Use the buttons above to request a key, get support, or test live API calls.