Search by

forcescripts / live-football-api-php

gaffarkorkmaz

Official PHP client for the Live Football API (live-football-api.com) — real-time scores, lineups, standings, H2H, injuries and webhook goal alerts.

Package info

github.com/gaffarkorkmaz/live-football-api-php

Homepage

Issues

pkg:composer/forcescripts/live-football-api-php

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 1

v1.0.1 2026-09-10 09:16 UTC

This package is auto-updated.

Last update: 2026-09-10 09:18:22 UTC


README

Official PHP client library for Live Football API — real-time football scores, lineups, standings, head-to-head stats, injuries, referee data, and goal webhooks. Compatible with PHP 7.4 and all newer versions (8.0, 8.1, 8.2, 8.3, 8.4+).

Installation

Install via Composer:

composer require forcescripts/live-football-api-php

Getting an API key

Sign up for free at live-football-api.com — new accounts get 500 free credits instantly, no card required.

Usage

require 'vendor/autoload.php';

use Forcescripts\LiveFootballApi\Client;
use Forcescripts\LiveFootballApi\ApiException;

$client = new Client('YOUR_API_KEY');

try {
    $matches = $client->matches('2026-07-03', 'en');
    print_r($matches);
} catch (ApiException $e) {
    echo 'Error ' . $e->getStatusCode() . ': ' . $e->getMessage();
}

Examples

The examples/ folder has one runnable file per endpoint — every single one tested against the live API using a real match (Sporting CP vs Galatasaray, UEFA Champions League) and a real player (Victor Osimhen). Clone the repo, run composer install, drop your API key into a file, and run it with php examples/<file>.php.

File Endpoint
examples/matches.php matches()
examples/live_match_details.php liveMatchDetails()
examples/lineups.php lineups()
examples/h2h.php h2h()
examples/injuries.php injuries()
examples/officials.php officials()
examples/leagues.php leagues()
examples/league_standings.php leagueStandings()
examples/league_fixtures.php leagueFixtures()
examples/team_matches.php teamMatches()
examples/team_squad.php teamSquad()
examples/team_standings.php teamStandings()
examples/team_search.php teamSearch()
examples/player.php player()
examples/player_matches.php playerMatches()
examples/player_search.php playerSearch()
examples/webhook_register.php registerWebhook()
examples/webhook_list.php listWebhooks()
examples/webhook_delete.php deleteWebhook()

Output of examples/live_match_details.php:

Sporting CP 3 - 1 Galatasaray
Status: FT
5' own_goal - Gonçalo Inácio
22' yellow_card - Sergi Altimira
27' goal - Geny Catamo

Available methods

Method Description
matches($date, $lang) Daily fixtures and results
liveMatchDetails($matchId, $lang) Live score, stats, events
lineups($matchId, $lang) Starting lineups and substitutes
h2h($matchId, $lang) Head-to-head history for the two teams in a match
injuries($matchId, $lang) Injury list for both teams in a match
officials($matchId, $lang) Referee and assistants, including average cards
leagues($lang) Full league coverage, grouped by country
leagueStandings($leagueId, $season, $lang) League table
leagueFixtures($leagueId, $season, $week, $lang) Full season fixture list, optionally filtered by season/week
teamMatches($teamId, $season, $lang) A team's matches
teamSquad($teamId, $season, $lang) A team's squad
teamStandings($teamId, $season, $lang) A team's league position
teamSearch($query, $lang) Search teams by name
player($playerId, $lang) Player profile
playerMatches($playerId, $teamId, $season, $lang) A player's match history
playerSearch($query, $lang) Search players by name
registerWebhook($webhookUrl, $label) Register a goal-alert webhook (free)
listWebhooks() List registered webhooks (free)
deleteWebhook($id) Remove a webhook by its numeric id (free)

Full parameter and response reference: live-football-api.com/docs

Requirements

  • PHP >= 7.4
  • ext-curl
  • ext-json

License

MIT © FORCESCRIPTS LTD