API Documentation

Integrate bet code conversion into your application with the BetRelay REST API.

Contents
Authentication Base URL Endpoints Rate Limits Error Handling Code Examples

Authentication

All API requests (except GET /bookmakers) require an API key in the X-API-Key header.

Get your API key from the Dashboard → API Keys page.

curl -H "X-API-Key: br_live_xxxxx" https://betrelay.com.ng/api/v1/usage

Keys are prefixed with br_test_ (development) or br_live_ (production).

Domain Whitelisting

Each API key can be restricted to specific domains. When set, the API checks the Origin or Referer header against the allowed list. Requests from unauthorized domains return 403 Forbidden.

Base URL

https://betrelay.com.ng/api/v1

Endpoints

Convert Bet Code

POST /api/v1/convert Requires API key

Convert a bet code from one bookmaker to another.

ParameterTypeDescription
codestringrequiredThe bet code to convert
fromstringrequiredSource bookmaker name
tostringrequiredTarget bookmaker name
countrystringoptionalCountry code (default: ng)

Request:

{
  "code": "58CFLYL",
  "from": "bet9ja",
  "to": "betking",
  "country": "ng"
}

Success response (200):

{
  "message": "success",
  "data": {
    "shareCode": "FJ1A2U",
    "shareURL": "https://m.betking.com/en-ng/sports/book-bet/FJ1A2U",
    "selections": [
      {
        "home": "Freiburg",
        "away": "Celta Vigo",
        "market": "1X2",
        "pick": "Away",
        "sourceOdds": "3.1",
        "targetOdds": "3.1"
      }
    ]
  },
  "usage": {
    "plan": "starter",
    "daily_remaining": 199,
    "monthly_remaining": 4999
  }
}

List Bookmakers

GET /api/v1/bookmakers Public — no key needed

Returns all supported bookmakers grouped by name with available countries.

{
  "message": "success",
  "data": [
    {
      "name": "sportybet",
      "countries": [
        { "country": "Nigeria", "code": "ng" },
        { "country": "Ghana", "code": "gh" }
      ]
    }
  ]
}

Check Usage

GET /api/v1/usage Requires API key

Returns current usage and limits for your API key.

{
  "message": "success",
  "data": {
    "plan": "starter",
    "daily_limit": 200,
    "daily_used": 1,
    "daily_remaining": 199,
    "monthly_limit": 5000,
    "monthly_used": 1,
    "monthly_remaining": 4999,
    "expires_at": null
  }
}

Rate Limits

Limits are enforced per API key. Every response includes rate limit headers:

10 / 100
Free — daily / monthly
200 / 5,000
Starter — daily / monthly
1,000 / 25,000
Pro — daily / monthly
10,000 / 200,000
Enterprise — daily / monthly

When limits are exceeded, the API returns 429 Too Many Requests.

Error Handling

All errors return a JSON object with message and error fields:

{
  "message": "error",
  "error": "Unknown bookmaker. Use: sportybet, bet9ja, msport, football, bangbet, betking"
}
StatusMeaning
200Success
400Bad request — invalid bookmaker or missing params
401Unauthorized — missing or invalid API key
422Conversion failed — code not found or events unavailable
429Rate limit exceeded
500Server error

Code Examples

cURL

curl -X POST https://betrelay.com.ng/api/v1/convert \
  -H "Content-Type: application/json" \
  -H "X-API-Key: br_live_xxxxx" \
  -d '{"code":"58CFLYL","from":"bet9ja","to":"sportybet","country":"ng"}'

JavaScript (fetch)

const res = await fetch('https://betrelay.com.ng/api/v1/convert', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'br_live_xxxxx',
  },
  body: JSON.stringify({
    code: '58CFLYL',
    from: 'bet9ja',
    to: 'sportybet',
    country: 'ng',
  }),
});
const data = await res.json();

Python (requests)

import requests

res = requests.post(
    'https://betrelay.com.ng/api/v1/convert',
    headers={'X-API-Key': 'br_live_xxxxx'},
    json={
        'code': '58CFLYL',
        'from': 'bet9ja',
        'to': 'sportybet',
        'country': 'ng',
    }
)
data = res.json()

PHP (Laravel Http)

$response = Http::withHeaders([
    'X-API-Key' => 'br_live_xxxxx',
])->post('https://betrelay.com.ng/api/v1/convert', [
    'code'    => '58CFLYL',
    'from'    => 'bet9ja',
    'to'      => 'sportybet',
    'country' => 'ng',
]);
$data = $response->json();

Need help? WhatsApp · Email