PHPackages                             andonovn/laravel-bets-api - 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. andonovn/laravel-bets-api

ActiveLibrary[API Development](/categories/api)

andonovn/laravel-bets-api
=========================

Consume the betsapi.com service

3.0.0(3y ago)9590↓100%10MITPHPPHP &gt;=7.1.3CI failing

Since Jun 12Pushed 3y ago2 watchersCompare

[ Source](https://github.com/andonovn/laravel-bets-api)[ Packagist](https://packagist.org/packages/andonovn/laravel-bets-api)[ RSS](/packages/andonovn-laravel-bets-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (14)Used By (0)

Laravel Bets Api
================

[](#laravel-bets-api)

Description
-----------

[](#description)

A package which helps you use the API of BetsApi. BetsApi is a paid service which provides sports data. You can find more about them at [](https://betsapi.com).

Laravel Bets Api is an unofficial package and not all of the endpoints are covered. I am just a client of theirs which happens to use their services on few projects and that motivated me to extract the code into an open-source package.

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

[](#installation)

```
composer require andonovn/laravel-bets-api
```

```
php artisan vendor:publish --provider="Andonovn\LaravelBetsApi\ServiceProvider"
```

Add the `BETS_API_TOKEN` env variable to your `.env` file. As you may already guessed, that's the BetsApi token that you can obtain by registering in their website, and then subscribing to a plan of your choice.

You can also optionally add the `BETS_API_ENDPOINT` env variable. By default it is set to `https://api.b365api.com/v1/`

The package utilize the Laravel's package auto-discovery feature. If you use an old version of Laravel that does not support that, then you can manually add `Andonovn\LaravelBetsApi\ServiceProvider` to the list of your service providers which are located in the `/config/app.php`'s `providers` array

Usage
-----

[](#usage)

Resolve the `Andonovn\LaravelBetsApi\BetsApi` class from the container and use one of the public methods. Here is an example:

```
public function index(\Andonovn\LaravelBetsApi\BetsApi $betsApi)
{
    $leagues = $betsApi->soccerLeagues();

    // $leagues will now be an array of all the supported leagues in soccer, use it as per your needs

    dd($leagues); // take a look at the structure
}
```

Error handling
--------------

[](#error-handling)

An `Andonovn\LaravelBetsApi\Exceptions\CallFailedException` will be raised when an API call fails. Also, there are few more exceptions which are less likely to occur but you can be safe by handling all of them by just catching the abstract `Andonovn\LaravelBetsApi\Exceptions\BetsApiException`. In case you want to learn more about the exceptions, they are all located in the `Andonovn\LaravelBetsApi\Exceptions` namespace.

Events
------

[](#events)

An `Andonovn\LaravelBetsApi\Events\RequestFailed` will be dispatched when a request fails. The package will try to retry the request until it hits the max allowed retries specified in the config. Note that the event will be raised for every retry that was made. When it hits the attempts limit, it will throw the `Andonovn\LaravelBetsApi\Exceptions\CallFailedException` exception as described above.

There is one more event that the package raise and that's the `Andonovn\LaravelBetsApi\Events\ResponseReceived`which you may use to track how many requests you have left, and other similar info that's available in each response.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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

Every ~136 days

Recently: every ~377 days

Total

13

Last Release

1250d ago

Major Versions

1.1.0 → 2.0.02021-04-02

2.0.0 → 3.0.02022-12-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf853cb1c1c106fc3c8263bf9809deb42e96507938f7f33a6c671ce28273d0fd?d=identicon)[andonovn](/maintainers/andonovn)

---

Top Contributors

[![andonovn](https://avatars.githubusercontent.com/u/10074115?v=4)](https://github.com/andonovn "andonovn (6 commits)")

---

Tags

laravelbetsapi.com

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/andonovn-laravel-bets-api/health.svg)

```
[![Health](https://phpackages.com/badges/andonovn-laravel-bets-api/health.svg)](https://phpackages.com/packages/andonovn-laravel-bets-api)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[api-ecosystem-for-laravel/dingo-api

A RESTful API package for the Laravel and Lumen frameworks.

3121.5M10](/packages/api-ecosystem-for-laravel-dingo-api)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[kirschbaum-development/laravel-openapi-validator

Automatic OpenAPI validation for Laravel HTTP tests

581.1M5](/packages/kirschbaum-development-laravel-openapi-validator)

PHPackages © 2026

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