andreskrip/sstats-api-client

Laravel client for the SStats.net Football API — matches, live odds, statistics, Glicko-2

Maintainers

Package info

github.com/andreskrip/sstats-api-client

pkg:composer/andreskrip/sstats-api-client

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-08-20 10:18 UTC

This package is auto-updated.

Last update: 2026-08-20 10:25:16 UTC


README

Tests Latest Version on Packagist PHP Version License

A Laravel package for the SStats.net Football API — match data, pre-match and live odds, statistics, profits, and Glicko-2 ratings.

The API is free to use with rate limiting: 300 req/min shared (no key) or 30 req/min per IP. A personal API key raises those limits.

Requirements

Package version PHP Laravel
1.x ^8.3 11, 12, 13

Installation

composer require andreskrip/sstats-api-client

Publish the config file:

php artisan vendor:publish --tag=sstats-config

Configuration

Add to your .env:

SSTATS_API_KEY=your_api_key_here
SSTATS_BASE_URL=https://api.sstats.net
SSTATS_TIMEOUT=30

config/sstats.php:

return [
    'api_key'  => env('SSTATS_API_KEY', ''),
    'base_url' => env('SSTATS_BASE_URL', 'https://api.sstats.net'),
    'timeout'  => env('SSTATS_TIMEOUT', 30),
];

The API key is optional — omit it to use the shared rate limit.

Usage

Via Facade

use Andreskrip\SstatsApiClient\Facades\Sstats;

$leagues = Sstats::leagues()->all();
$game    = Sstats::games()->find(12345);
$odds    = Sstats::odds()->forGame(12345);

Via Dependency Injection

use Andreskrip\SstatsApiClient\SstatsClient;

class FootballController extends Controller
{
    public function __construct(private SstatsClient $sstats) {}

    public function index()
    {
        return $this->sstats->games()->list(['Today' => true, 'Limit' => 20]);
    }
}

Resources

Account

// Authenticated user info
Sstats::account()->info();

Games

// List games with filters
Sstats::games()->list([
    'Today'    => true,
    'Live'     => true,
    'LeagueId' => 1,
    'Limit'    => 50,
    'Offset'   => 0,
    // From, To, Date, Status, HomeTeam, AwayTeam, Team,
    // BothTeams, Ended, Upcoming, Year, SeasonUid, Order, TimeZone
]);

// Get game by ID
Sstats::games()->find(12345);

// Glicko-2 rating for a game
Sstats::games()->glicko(12345);

// Advanced query (POST) — SQL-like condition string
Sstats::games()->query([
    'condition' => 'LeagueId = 41 AND Year = 2023',
    'fields'    => ['Id', 'HomeTeamName', 'AwayTeamName', 'Date'],
    'format'    => 'json',
    'timezone'  => 3,
    'order'     => 'Date',
    'offset'    => 0,
    'limit'     => 100,
]);

// Season standings table
Sstats::games()->seasonTable([
    'league'     => 1,
    'year'       => 2024,
    'limit'      => 20,
    'format'     => 'json',
    'fields'     => 'team,points,wins',
    'orderField' => 'points',
]);

// Last N games stats for both teams in a fixture
Sstats::games()->lastGamesStats(gameId: 12345, params: [
    'limit'      => 10,
    'sameLeague' => true,
    'homeAway'   => true,
]);

// Text summary of recent results
Sstats::games()->textSummary(id: 12345, params: [
    'limit'      => 5,
    'sameLeague' => true,
    'homeAway'   => true,
]);

// Bookmaker profit stats for a game
Sstats::games()->profits(gameId: 12345, params: [
    'bookieId'  => 1,
    'thisLeague' => true,
    'homeAway'  => true,
    'limit'     => 20,
]);

// Team injury report for a game
Sstats::games()->injuries(12345);

Leagues

// All leagues
Sstats::leagues()->all();

Odds

// List bookmakers
Sstats::odds()->bookmakers();

// Pre-match odds for a game
Sstats::odds()->forGame(gameId: 12345, params: [
    'bookmakerId' => 1,
    'opening'     => false,
]);

// Live odds for a game
Sstats::odds()->liveForGame(12345);

// Live odds changes — only updated values since last poll
Sstats::odds()->liveChangesUpdatesOnly(12345);

// Full live odds change history
Sstats::odds()->liveChanges(gameId: 12345, params: [
    'markets'  => '1x2,ou',
    'outcomes' => 'home,draw',
]);

// Available pre-match market types
Sstats::odds()->prematchMarkets();

// Available live market types
Sstats::odds()->liveMarkets();

Players

// Search players by name
Sstats::players()->find('Messi');

// Get player by ID
Sstats::players()->show(42);

// List players with filters
Sstats::players()->list([
    'teamId' => 5,
    'offset' => 0,
    'limit'  => 50,
]);

// Player match events (goals, cards, assists)
Sstats::players()->events(id: 42, params: [
    'includeAssists' => true,
    'offset'         => 0,
    'limit'          => 100,
]);

Teams

// List teams
Sstats::teams()->list([
    'Name'    => 'Arsenal',
    'Country' => 'England',
    'Offset'  => 0,
    'Limit'   => 20,
]);

// Get team by ID
Sstats::teams()->find(7);

Seasons

// League standings for a season
Sstats::seasons()->standings([
    'leagueId' => 1,
    'year'     => 2024,
]);

Ls (LiveScore)

// List matches
Sstats::ls()->list([
    'Live'     => true,
    'Upcoming' => true,
    'LeagueId' => 1,
    'Limit'    => 50,
]);

// Teams
Sstats::ls()->teams(['name' => 'Chelsea']);

// Leagues
Sstats::ls()->leagues(['name' => 'Premier']);

// Seasons for a league
Sstats::ls()->seasons(['leagueId' => 1]);

// Detailed game info
Sstats::ls()->gameInfo(12345);

Pari

// Countries
Sstats::pari()->countries();

// Leagues
Sstats::pari()->leagues(['countryId' => 1, 'limit' => 50]);

// Single league
Sstats::pari()->league(10);

// Matches
Sstats::pari()->matches([
    'leagueId'    => 1,
    'live'        => true,
    'includeOdds' => true,
    'limit'       => 50,
]);

// Single match
Sstats::pari()->match(777);

// Odds change history
Sstats::pari()->oddsHistory(eventId: 777, params: ['oddsType' => '1x2']);

// Match events (goals, cards)
Sstats::pari()->events(555);

// Teams
Sstats::pari()->teams(['countryId' => 1]);

// Market types
Sstats::pari()->oddsMarketTypes();

// Event types
Sstats::pari()->eventTypes();

Excel

Endpoints designed for use in Excel spreadsheets (DeluX).

Sstats::excel()->delux(gameId: 12345, dayOffset: 0, timeZone: 3);
Sstats::excel()->footballCalc(gameId: 12345, dayOffset: 0, timeZone: 3);
Sstats::excel()->results(ids: '1,2,3,4,5', header: true);

Testing

composer test

Changelog

See CHANGELOG.md.

License

MIT. See LICENSE.