PHPackages                             fpicosm/sportmonks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. fpicosm/sportmonks

ActiveLibrary[API Development](/categories/api)

fpicosm/sportmonks
==================

Laravel wrapper for using all Sportmonks APIs within a single library

1.0.0(1y ago)5143MITPHPPHP ^8.3

Since Mar 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/fpicosm/sportmonks)[ Packagist](https://packagist.org/packages/fpicosm/sportmonks)[ RSS](/packages/fpicosm-sportmonks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Sportmonks
==========

[](#sportmonks)

With this package, you're allowed to use all Sportmonks APIs in a single project.

```
Sportmonks::football()
Sportmonks::core()
Sportmonks::my()
Sportmonks::odds()
Sportmonks::cricket()
Sportmonks::f1()
```

Installation
------------

[](#installation)

1. Require the package via composer

```
composer require fpicosm/sportmonks
```

2. Update your `.env` file adding the variables:

```
SPORTMONKS_TOKEN=# YOUR_API_TOKEN (required)
SPORTMONKS_TIMEZONE=# Optional. A valid timezone from /v3/core/timezones endpoint (UTC by default)
SPORTMONKS_PER_PAGE=# Optional. Default page size in paginated responses (50 by default)
```

3. Publish the config file

```
php artisan vendor:publish --provider="Sportmonks\SportmonksServiceProvider"
```

APIs 3.0
--------

[](#apis-30)

### Basic usage

[](#basic-usage)

#### The `setInclude` option

[](#the-setinclude-option)

This option allows to enrich your responses by including related resources in the request, passing them as an array of strings, or a semicolon-separated string:

```
Sportmonks::football()
    ->leagues()
    ->setInclude('country', 'sport')
    ->find(8);
```

or

```
Sportmonks::football()
    ->leagues()
    ->setInclude('country;sport')
    ->find(8);
```

or an array too

```
Sportmonks::football()
    ->leagues()
    ->setInclude(['country', 'sport'])
    ->find(8);
```

Produces the response:

```
{
    "data": {
        "id": 8,
        "sport_id": 1,
        "country_id": 462,
        "name": "Premier League",
        "active": true,
        "short_code": "UK PL",
        "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/8/8.png",
        "type": "league",
        "sub_type": "domestic",
        "last_played_at": "2025-03-10 20:00:00",
        "category": 1,
        "has_jerseys": false,
        "country": {
            "id": 462,
            "continent_id": 1,
            "name": "England",
            "official_name": "England",
            "fifa_name": "ENG",
            "iso2": "EN",
            "iso3": "ENG",
            "latitude": "54.56088638305664",
            "longitude": "-2.2125117778778076",
            "borders": [
                "IRL"
            ],
            "image_path": "https://cdn.sportmonks.com/images/countries/png/short/en.png"
        },
        "sport": {
            "id": 1,
            "name": "Football",
            "code": "football"
        }
    }
}
```

You can also get nested relations by using dot notation:

```
Sportmonks::football()
    ->leagues()
    ->setInclude('country.continent', 'sport')
    ->find(8);
```

```
{
    "data": {
        "id": 8,
        "sport_id": 1,
        "country_id": 462,
        "name": "Premier League",
        "active": true,
        "short_code": "UK PL",
        "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/8/8.png",
        "type": "league",
        "sub_type": "domestic",
        "last_played_at": "2025-03-10 20:00:00",
        "category": 1,
        "has_jerseys": false,
        "country": {
            "id": 462,
            "continent_id": 1,
            "name": "England",
            "official_name": "England",
            "fifa_name": "ENG",
            "iso2": "EN",
            "iso3": "ENG",
            "latitude": "54.56088638305664",
            "longitude": "-2.2125117778778076",
            "borders": [
                "IRL"
            ],
            "image_path": "https://cdn.sportmonks.com/images/countries/png/short/en.png",
            "continent": {
                "id": 1,
                "name": "Europe",
                "code": "EU"
            }
        },
        "sport": {
            "id": 1,
            "name": "Football",
            "code": "football"
        }
    }
}
```

#### The `setSelect` option

[](#the-setselect-option)

This option allows you to reduce the speed and response size, getting only the specified fields on the given entities, passing an array of strings or a comma separated string (fields that have relations are always included).

```
Sportmonks::football()
    ->leagues()
    ->setSelect('name', 'short_code')
    ->find(8);
```

Produces the response:

```
{
    "data": {
        "name": "Premier League",
        "short_code": "UK PL",
        "id": 8,
        "sport_id": 1,
        "country_id": 462
    }
}
```

You can combine both `setSelect` and `setInclude` options. If you want to select specified fields within relations, you should use the `relation:field,another_field,...` notation:

```
Sportmonks::football()
    ->leagues()
    ->setInclude('country:name,iso2', 'country.continent:name', 'sport:code')
    ->select('name')
    ->find(8);
```

```
{
    "data": {
        "name": "Premier League",
        "id": 8,
        "sport_id": 1,
        "country_id": 462,
        "country": {
            "id": 462,
            "continent_id": 1,
            "name": "England",
            "iso2": "EN",
            "continent": {
                "id": 1,
                "name": "Europe"
            }
        },
        "sport": {
            "id": 1,
            "code": "football"
        }
    }
}
```

If you need extra info, you can check the [documentation](https://docs.sportmonks.com/football/tutorials-and-guides/tutorials/filter-and-select-fields/selecting-fields)

#### The `setFilters` option

[](#the-setfilters-option)

This option allows you to filters the results. If you don't know how to use filters in Sportmonks, please see the [tutorial](https://docs.sportmonks.com/football/tutorials-and-guides/tutorials/filter-and-select-fields/filtering).

You can use both static/dynamic filters:

```
Sportmonks::football()
    ->fixtures()
    ->setFilters([
        'fixtureLeagues' => [564, 8],
        'todayDate',
        'participantSearch' => 'barcelona'
    ])
    ->all();
```

#### The `sortBy` option

[](#the-sortby-option)

By default, all endpoints return the results ordered by id, in ascending direction. With this option, you can sort the results by the given field, and the given order:

```
Sportmonks::football()
    ->leagues()
    ->sortBy('name') # ascending by default
    ->all();
```

```
Sportmonks::football()
    ->leagues()
    ->sortBy('name', 'desc')
    ->all();
```

#### The `getPage` option

[](#the-getpage-option)

Some endpoints return paginated responses. With this option, you can set the page number and the number of items you want to get:

```
Sportmonks::core()
    ->countries()
    ->getPage(2) # by default, the value in env('SPORTMONKS_PER_PAGE'), or 50 if not given
    ->all()
```

```
Sportmonks::core()
    ->countries()
    ->getPage(2, 20) # get only 20 items per page
    ->all()
```

There's also an optional third argument `orderBy` to say if you want the results ordered by id `asc` (by default) or `desc`.

```
Sportmonks::core()
    ->countries()
    ->getPage(2, 20, 'desc') # get the second page, 20 items per page, starting from the end
    ->all();
```

You can combine both `sortBy` and `getPage` options. In this case, the third argument in the `getPage` does not have any effect, as you are sorting the results by the given field:

```
Sportmonks::core()
    ->countries()
    ->getPage(2, 10, 'desc') // this `desc` has no effect
    ->sortBy('name', 'asc')
    ->all();
```

### Endpoints

[](#endpoints)

#### Core API

[](#core-api)

##### Cities

[](#cities)

```
// get all cities
Sportmonks::core()->cities()->all();
```

```
// get city by id
Sportmonks::core()->cities()->find($cityId);
```

```
// get cities by search
Sportmonks::core()->cities()->search($name);
```

##### Continents

[](#continents)

```
// get all continents
Sportmonks::core()->continents()->all();
```

```
// get continent by id
Sportmonks::core()->continents()->find($countryId);
```

##### Countries

[](#countries)

```
// get all countries
Sportmonks::core()->countries()->all();
```

```
// get country by id
Sportmonks::core()->countries()->find($countryId);
```

```
// get countries by search
Sportmonks::core()->countries()->search($name);
```

##### Regions

[](#regions)

```
// get all regions
Sportmonks::core()->regions()->all();
```

```
// get region by id
Sportmonks::core()->regions()->find($regionId);
```

```
// get regions by search
Sportmonks::core()->regions()->search($name);
```

##### Timezones

[](#timezones)

```
// get all supported timezones
Sportmonks::core()->timezones()->all();
```

##### Types

[](#types)

```
// get all types
Sportmonks::core()->types()->all();
```

```
// get type by id
Sportmonks::core()->types()->find($typeId);
```

```
// get types by entity
Sportmonks::core()->types()->byEntities();
```

#### Football API

[](#football-api)

##### Coaches

[](#coaches)

```
// get all coaches
Sportmonks::football()->coaches()->all();
```

```
// get coach by id
Sportmonks::football()->coaches()->find($coachId);
```

```
// get coaches by country id
Sportmonks::football()->coaches()->byCountry($countryId);
```

```
// get coaches by search by name
Sportmonks::football()->coaches()->search($name);
```

```
// get last updated coaches
Sportmonks::football()->coaches()->lastUpdated();
```

##### Commentaries

[](#commentaries)

```
// get all commentaries
Sportmonks::football()->commentaries()->all();
```

```
// get commentaries by fixture id
Sportmonks::football()->commentaries()->byFixture($fixtureId);
```

##### Expected (xG)

[](#expected-xg)

```
// get expected by team
Sportmonks::football()->expected()->byTeam();
```

```
// get expected by player
Sportmonks::football()->expected()->byPlayer();
```

##### Fixtures

[](#fixtures)

```
// get all fixtures
Sportmonks::football()->fixtures()->all();
```

```
// get fixture by id
Sportmonks::football()->fixtures()->find($fixtureId);
```

```
// get fixtures by multiple ids
Sportmonks::football()->fixtures()->multiple($fixtureIds);
```

```
// get fixtures by date
Sportmonks::football()->fixtures()->byDate($date);
```

```
// get fixtures by date range
Sportmonks::football()->fixtures()->byDateRange($from, $to);
```

```
// get fixtures by date range for team
Sportmonks::football()->fixtures()->byDateRangeForTeam($from, $to, $teamId);
```

```
// get fixtures by head to head
Sportmonks::football()->fixtures()->h2h($teamId, $rivalId);
```

```
// get fixtures by search by name
Sportmonks::football()->fixtures()->search($name);
```

```
// get upcoming fixtures by market id
Sportmonks::football()->fixtures()->upcomingByMarket($marketId);
```

```
// get upcoming fixtures by tv station id
Sportmonks::football()->fixtures()->upcomingByTvStation($tvStationId);
```

```
// get past fixtures by tv station id
Sportmonks::football()->fixtures()->pastByTvStation($tvStationId);
```

```
// get latest updated fixtures
Sportmonks::football()->fixtures()->lastUpdated();
```

##### Leagues

[](#leagues)

```
// get all leagues
Sportmonks::football()->leagues()->all();
```

```
// get league by id
Sportmonks::football()->leagues()->find($leagueId);
```

```
// get leagues by live
Sportmonks::football()->leagues()->live();
```

```
// get leagues by fixture date
Sportmonks::football()->leagues()->byFixtureDate($date);
```

```
// get leagues by country id
Sportmonks::football()->leagues()->byCountry($countryId);
```

```
// get leagues search by name
Sportmonks::football()->leagues()->search($name);
```

```
// get all leagues by team id
Sportmonks::football()->leagues()->allByTeam($teamId);
```

```
// get current leagues by team id
Sportmonks::football()->leagues()->currentByTeam($teamId);
```

##### Livescores

[](#livescores)

```
// get inplay livescores
Sportmonks::football()->livescores()->inplay();
```

```
// get all livescores
Sportmonks::football()->livescores()->all();
```

```
// get latest updated livescores
Sportmonks::football()->livescores()->lastUpdated();
```

##### News

[](#news)

```
// get pre-match news
Sportmonks::football()->news()->preMatch()->all();
```

```
// get pre-match news by season id
Sportmonks::football()->news()->preMatch()->bySeason($seasonId);
```

```
// get pre-match news for upcoming fixtures
Sportmonks::football()->news()->preMatch()->upcoming();
```

```
// get post-match news
Sportmonks::football()->news()->postMatch();
```

```
// get post-match news by season id
Sportmonks::football()->news()->postMatch()->bySeason($seasonId);
```

##### Players

[](#players)

```
// get all players
Sportmonks::football()->players()->all();
```

```
// get player by id
Sportmonks::football()->players()->find($playerId);
```

```
// get players by country id
Sportmonks::football()->players()->byCountry($countryId);
```

```
// get players by search by name
Sportmonks::football()->players()->search($name);
```

```
// get last updated players
Sportmonks::football()->players()->lastUpdated();
```

##### Predictions

[](#predictions)

```
// get probabilities
Sportmonks::football()->predictions()->all();
```

```
// get predictability by league id
Sportmonks::football()->predictions()->byLeague($leagueId);
```

```
// get probabilities by fixture id
Sportmonks::football()->predictions()->byFixture($fixtureId);
```

```
// get value bets
Sportmonks::football()->predictions()->valueBets()->all();
```

```
// get value bets by fixture id
Sportmonks::football()->predictions()->valueBets()->byFixture($fixtureId);
```

##### Referees

[](#referees)

```
// get all referees
Sportmonks::football()->referees()->all();
```

```
// get referee by id
Sportmonks::football()->referees()->find($refereeId);
```

```
// get referees by country id
Sportmonks::football()->referees()->byCountry($countryId);
```

```
// get referees by season id
Sportmonks::football()->referees()->bySeason($seasonId);
```

```
// get referees by search by name
Sportmonks::football()->referees()->search($name);
```

##### Rivals

[](#rivals)

```
// get all rivals
Sportmonks::football()->rivals()->all();
```

```
// get rivals by team id
Sportmonks::football()->rivals()->byTeam($teamId);
```

##### Rounds

[](#rounds)

```
// get all rounds
Sportmonks::football()->rounds()->all();
```

```
// get round by id
Sportmonks::football()->rounds()->find($roundId);
```

```
// get rounds by season id
Sportmonks::football()->rounds()->bySeason($seasonId);
```

```
// get rounds by search by name
Sportmonks::football()->rounds()->search($name);
```

##### Schedules

[](#schedules)

```
// get schedules by season id
Sportmonks::football()->schedules()->bySeason($seasonId);
```

```
// get schedules by team id
Sportmonks::football()->schedules()->byTeam($teamId);
```

```
// get schedules by season id and team id
Sportmonks::football()->schedules()->bySeasonAndTeam($seasonId, $teamId);
```

##### Seasons

[](#seasons)

```
// get all seasons
Sportmonks::football()->seasons()->all();
```

```
// get season by id
Sportmonks::football()->seasons()->find($seasonId);
```

```
// get seasons by team id
Sportmonks::football()->seasons()->byTeam($teamId);
```

```
// get seasons by search by name
Sportmonks::football()->seasons()->search($name);
```

##### Squads

[](#squads)

```
// get squad by team id
Sportmonks::football()->squads()->currentByTeam($teamId);
```

```
// get extended squad by team id
Sportmonks::football()->squads()->extendedByTeam($teamId);
```

```
// get squad by team and season id
Sportmonks::football()->squads()->bySeasonAndTeam($seasonId, $teamId);
```

##### Stages

[](#stages)

```
// get all stages
Sportmonks::football()->stages()->all();
```

```
// get stage by id
Sportmonks::football()->stages()->find($stageId);
```

```
// get stages by season id
Sportmonks::football()->stages()->bySeason($seasonId);
```

```
// get stages by search by name
Sportmonks::football()->stages()->search($name);
```

##### Standings

[](#standings)

```
// get all standings
Sportmonks::football()->standings()->all();
```

```
// get standings by season id
Sportmonks::football()->standings()->bySeason($seasonId);
```

```
// get standing correction by season id
Sportmonks::football()->standings()->correctionBySeason($seasonId);
```

```
// get standings by round id
Sportmonks::football()->standings()->byRound($roundId);
```

```
// get live standings by league id
Sportmonks::football()->standings()->liveByLeague($leagueId);
```

##### States

[](#states)

```
// get all states
Sportmonks::football()->states()->all();
```

```
// get state by id
Sportmonks::football()->states()->find($stateId);
```

##### Statistics

[](#statistics)

```
// get season statistics by participant
Sportmonks::football()->statistics()->byPlayer($playerId);
Sportmonks::football()->statistics()->byTeam($teamId);
Sportmonks::football()->statistics()->byCoach($coachId);
Sportmonks::football()->statistics()->byReferee($refereeId);
```

```
// get stage statistics by id
Sportmonks::football()->statistics()->byStage($stageId);
```

```
// get round statistics by id
Sportmonks::football()->statistics()->byRound($roundId);
```

##### Teams

[](#teams)

```
// get all teams
Sportmonks::football()->teams()->all();
```

```
// get team by id
Sportmonks::football()->teams()->find($teamId);
```

```
// get teams by country id
Sportmonks::football()->teams()->byCountry($countryId);
```

```
// get teams by season id
Sportmonks::football()->teams()->bySeason($seasonId);
```

```
// get teams by search by name
Sportmonks::football()->teams()->search($name);
```

##### Top Scorers

[](#top-scorers)

```
// get top scorers by season id
Sportmonks::football()->topScorers()->bySeason($seasonId);
```

```
// get top scorers by stage id
Sportmonks::football()->topScorers()->byStage($stageId);
```

##### Transfers

[](#transfers)

```
// get all transfers
Sportmonks::football()->transfers()->all();
```

```
// get transfer by id
Sportmonks::football()->transfers()->find($transferId);
```

```
// get latest transfers
Sportmonks::football()->transfers()->latest();
```

```
// get transfers between date range
Sportmonks::football()->transfers()->byDateRange($from, $to);
```

```
// get transfers by team id
Sportmonks::football()->transfers()->byTeam($teamId);
```

```
// get transfers by player id
Sportmonks::football()->transfers()->byPlayer($playerId);
```

##### Tv Stations

[](#tv-stations)

```
// get all tv stations
Sportmonks::football()->tvStations()->all();
```

```
// get tv station by id
Sportmonks::football()->tvStations()->find($tvStationId);
```

```
// get tv stations by fixture id
Sportmonks::football()->tvStations()->byFixture($fixtureId);
```

##### Venues

[](#venues)

```
// get all venues
Sportmonks::football()->venues()->all();
```

```
// get venue by id
Sportmonks::football()->venues()->find($venueId);
```

```
// get venues by season id
Sportmonks::football()->venues()->bySeason($seasonId);
```

```
// get venues by search by name
Sportmonks::football()->venues()->search($name);
```

#### Odds API

[](#odds-api)

##### Bookmakers

[](#bookmakers)

```
// get all bookmakers
Sportmonks::odds()->bookmakers()->all();
```

```
// get premium bookmakers
Sportmonks::odds()->bookmakers()->premium();
```

```
// get bookmaker by id
Sportmonks::odds()->bookmakers()->find($bookmakerId);
```

```
// get bookmakers by search
Sportmonks::odds()->bookmakers()->search($name);
```

```
// get bookmakers by fixture id
Sportmonks::odds()->bookmakers()->byFixture($fixtureId);
```

```
// get bookmaker event id's by fixture id
Sportmonks::odds()->bookmakers()->eventsByFixture($fixtureId);
```

##### Markets

[](#markets)

```
// get all markets
Sportmonks::odds()->markets()->all();
```

```
// get premium markets
Sportmonks::odds()->markets()->premium();
```

```
// get market by id
Sportmonks::odds()->markets()->find($marketId);
```

```
// get markets by search
Sportmonks::odds()->markets()->search($name);
```

#### My Api

[](#my-api)

```
// get all entity filters
Sportmonks::my()->filters();
```

```
// get my enrichments
Sportmonks::my()->enrichments();
```

```
// get my resources
Sportmonks::my()->resources();
```

```
// get my leagues
Sportmonks::my()->leagues();
```

```
// get my usage
Sportmonks::my()->usage();
```

Cricket API
-----------

[](#cricket-api)

### Basic usage

[](#basic-usage-1)

#### The `setInclude` option

[](#the-setinclude-option-1)

```
Sportmonks::cricket()
    ->leagues()
    ->setInclude('seasons', 'country')
    ->all();
```

```
Sportmonks::cricket()
    ->leagues()
    ->setInclude(['seasons', 'country'])
    ->all();
```

```
Sportmonks::cricket()
    ->leagues()
    ->setInclude('seasons,country')
    ->all();
```

#### The `setFields` option

[](#the-setfields-option)

```
Sportmonks::cricket()
    ->leagues()
    ->setFields('name', 'code')
    ->all();
```

```
Sportmonks::cricket()
    ->leagues()
    ->setFields(['name', 'code'])
    ->all();
```

```
Sportmonks::cricket()
    ->leagues()
    ->setFields('name,code')
    ->all();
```

#### The `setFilters` option

[](#the-setfilters-option-1)

```
Sportmonks::cricket()
    ->countries()
    ->setFilters(['continent_id' => 1])
    ->all();
```

```
Sportmonks::cricket()
    ->countries()
    ->setFilters(['continent_id' => 1, 'name' => 'Spain'])
    ->all();
```

#### The `sortBy` option

[](#the-sortby-option-1)

```
Sportmonks::cricket()
    ->countries()
    ->sortBy('name')
    ->all();
```

```
Sportmonks::cricket()
    ->countries()
    ->sortBy('continent_id', 'name')
    ->all();
```

```
Sportmonks::cricket()
    ->countries()
    ->sortBy(['continent_id', 'name'])
    ->all();
```

```
Sportmonks::cricket()
    ->countries()
    ->sortBy('continent_id,name')
    ->all();
```

### Endpoints

[](#endpoints-1)

#### Continents

[](#continents-1)

```
// get all continents
Sportmonks::cricket()->continents()->all();
```

```
// get continent by id
Sportmonks::cricket()->continents()->all();
```

#### Countries

[](#countries-1)

```
// get all
Sportmonks::cricket()->countries()->all();
```

```
// get by id
Sportmonks::cricket()->countries()->find($countryId);
```

#### Leagues

[](#leagues-1)

```
// get all
Sportmonks::cricket()->leagues()->all();
```

```
// get by id
Sportmonks::cricket()->leagues()->find($leagueId);
```

#### Seasons

[](#seasons-1)

```
// get all
Sportmonks::cricket()->seasons()->all();
```

```
// get by id
Sportmonks::cricket()->seasons()->find($seasonId);
```

#### Fixtures

[](#fixtures-1)

```
// get all
Sportmonks::cricket()->fixtures()->all();
```

```
// get by id
Sportmonks::cricket()->fixtures()->find($fixtureId);
```

#### Livescores

[](#livescores-1)

```
// get all
Sportmonks::cricket()->livescores()->all();
```

#### Teams

[](#teams-1)

```
// get all
Sportmonks::cricket()->teams()->all();
```

```
// get by id
Sportmonks::cricket()->teams()->find($teamId);
```

```
// get squad by team and season id
Sportmonks::cricket()->teams()->squadBySeason($teamId, $seasonId);
```

#### Players

[](#players-1)

```
// get all
Sportmonks::cricket()->players()->all();
```

```
// get by id
Sportmonks::cricket()->players()->find($playerId);
```

#### Officials

[](#officials)

```
// get all
Sportmonks::cricket()->officials()->all();
```

```
// get by id
Sportmonks::cricket()->officials()->find($officialId);
```

#### Venues

[](#venues-1)

```
// get all
Sportmonks::cricket()->venues()->all();
```

```
// get by id
Sportmonks::cricket()->venues()->find($venueId);
```

#### Positions

[](#positions)

```
// get all
Sportmonks::cricket()->positions()->all();
```

```
// get by id
Sportmonks::cricket()->positions()->find($positionId);
```

#### Stages

[](#stages-1)

```
// get all
Sportmonks::cricket()->stages()->all();
```

```
// get by id
Sportmonks::cricket()->stages()->find($stageId);
```

#### Team Rankings

[](#team-rankings)

```
// get all
Sportmonks::cricket()->teamRankings()->global();
```

#### Standings

[](#standings-1)

```
// get standings by season id
Sportmonks::cricket()->standings()->bySeason();
```

```
// get standings by stage id
Sportmonks::cricket()->standings()->byStage();
```

#### Scores

[](#scores)

```
// get all scores
Sportmonks::cricket()->scores()->all();
```

```
// get by id
Sportmonks::cricket()->scores()->find($scoreId);
```

Formula One API
---------------

[](#formula-one-api)

### Basic usage

[](#basic-usage-2)

#### The `setInclude` option

[](#the-setinclude-option-2)

```
Sportmonks::f1()
    ->tracks()
    ->setInclude('seasons', 'currentStage')
    ->all();
```

```
Sportmonks::f1()
    ->tracks()
    ->setInclude(['seasons', 'currentStage'])
    ->all();
```

```
Sportmonks::f1()
    ->tracks()
    ->setInclude('seasons,currentStage')
    ->all();
```

#### The `setFilters` option

[](#the-setfilters-option-2)

```
Sportmonks::f1()
    ->seasons()
    ->setFilters(['name' => 2022])
    ->all();
```

#### The `sortBy` option

[](#the-sortby-option-2)

```
Sportmonks::f1()
    ->seasons()
    ->sortBy('name')
    ->all();
```

### Endpoints

[](#endpoints-2)

#### Livescores

[](#livescores-2)

```
// get livescores
Sportmonks::f1()->livescores()->all();
```

#### Seasons

[](#seasons-2)

```
// get all seasons
Sportmonks::f1()->seasons()->all();
```

```
// get season by id
Sportmonks::f1()->seasons()->find($seasonId);
```

#### Tracks

[](#tracks)

```
// get all tracks
Sportmonks::f1()->tracks()->all();
```

```
// get track by id
Sportmonks::f1()->tracks()->find($trackId);
```

```
// get tracks by season id
Sportmonks::f1()->tracks()->bySeason($seasonId);
```

```
// get track winners by season id
Sportmonks::f1()->tracks()->winnersBySeason($seasonId);
```

#### Stages

[](#stages-2)

```
// get all stages
Sportmonks::f1()->stages()->all();
```

```
// get stage by id
Sportmonks::f1()->stages()->find($stageId);
```

```
// get stages by season id
Sportmonks::f1()->stages()->bySeason($seasonId);
```

#### Teams

[](#teams-2)

```
// get team by id
Sportmonks::f1()->teams()->find($teamId);
```

```
// get teams by season id
Sportmonks::f1()->teams()->bySeason($seasonId);
```

```
// get team results by season id
Sportmonks::f1()->teams()->resultsBySeason($teamId, $seasonId);
```

#### Drivers

[](#drivers)

```
// get driver by id
Sportmonks::f1()->drivers()->find($driverId);
```

```
// get drivers by season id
Sportmonks::f1()->drivers()->bySeason($seasonId);
```

```
// get driver results by season id
Sportmonks::f1()->drivers()->resultsBySeason($driverId, $seasonId);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance46

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

422d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/829a1404fd11f6e7a8b4eccb99c80e745695b364f4407bea9f87696e3cdb3af8?d=identicon)[fpicosm](/maintainers/fpicosm)

---

Top Contributors

[![fpicosm](https://avatars.githubusercontent.com/u/19833846?v=4)](https://github.com/fpicosm "fpicosm (18 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fpicosm-sportmonks/health.svg)

```
[![Health](https://phpackages.com/badges/fpicosm-sportmonks/health.svg)](https://phpackages.com/packages/fpicosm-sportmonks)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
