PHPackages                             dcro/simple-betfair-php-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. dcro/simple-betfair-php-api

ActiveLibrary[API Development](/categories/api)

dcro/simple-betfair-php-api
===========================

A simple PHP implementation for Betfair's API (API-NG)

91804PHP

Since Sep 17Pushed 11y ago2 watchersCompare

[ Source](https://github.com/dcro/simple-betfair-php-api)[ Packagist](https://packagist.org/packages/dcro/simple-betfair-php-api)[ RSS](/packages/dcro-simple-betfair-php-api/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Simple Betfair PHP API
======================

[](#simple-betfair-php-api)

This is a simple PHP implementation for [Betfair's API (API-NG)](https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/API-NG+Overview). It handles both authentication against the SSO endpoint &amp; requests against the JSON-RPC endpoint.

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

[](#installation)

You can either get the files from GIT or you can install the library via [Composer](getcomposer.org). To use Composer, simply add the following to your `composer.json` file.

```
{
    "require": {
        "dcro/simple-betfair-php-api": "dev-master"
    }
}
```

How to use it?
--------------

[](#how-to-use-it)

To initialize the API, you'll need to pass an array with your application key (`appKey`), `username`, `password` and certificate file (`cert`). Check out the Betfair API documentation for details on how to get these.

```
// Set the API configuration
$configuration = array(
    'appKey'   => '',
    'username' => '',
    'password' => '',
    'cert'     => '/path/to/your/certificate.pem',
)

$api = new Betfair\SimpleAPI($configuration);
```

To make a request against the API endpoint, call the `request()` method like this:

```
try {
    // List event types
    $response = $api->request('listEventTypes', '{"filter":{}}');

} catch (Exception $ex) {
    // handle the exception
}
```

A more complex request example, to get the market catalogue for a specific event type (``) from Great Britain and for the `WIN` market.

```
try {
    // Define the parameters
    $params = '{
                   "filter" : {
                       "eventTypeIds" : [""],
                       "marketCountries" : ["GB"],
                       "marketTypeCodes" : ["WIN"],
                       "marketStartTime" : {"from":"' . date('c') . '"}
                   },
                   "sort" : "FIRST_TO_START",
                   "maxResults" : "1000",
                   "marketProjection" : ["EVENT","MARKET_START_TIME","RUNNER_DESCRIPTION","MARKET_DESCRIPTION"]
              }';

    // Get the market catalogue
    $response = $api->request('listMarketCatalogue', $params);

} catch (Exception $ex) {
    // handle the exception
}
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1079773?v=4)[Dan Cotora](/maintainers/dcro)[@dcro](https://github.com/dcro)

---

Top Contributors

[![dcro](https://avatars.githubusercontent.com/u/1079773?v=4)](https://github.com/dcro "dcro (13 commits)")

### Embed Badge

![Health badge](/badges/dcro-simple-betfair-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/dcro-simple-betfair-php-api/health.svg)](https://phpackages.com/packages/dcro-simple-betfair-php-api)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k12](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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