API Reference

Programmatic access to Africa's smartest sports prediction AI.

Base URL

https://api.tbet.ng/api/v1

Authentication

Pass your API key in the Authorization header.

Authorization: Bearer tbet_live_xxxxxxxxxxxxxxxxxxxxxxxx

Response Envelope

All successful JSON responses share a standard envelope.

{
  "success": true,
  "data": { ... },
  "meta": { "timestamp": "2026-05-14T10:00:00Z", "request_id": "req_16840584_a1b", "rate_limit": { "limit": 60, "remaining": 59, "reset": 168405846 } }
}

Error Responses

401 Unauthorized
403 Forbidden
429 Rate Limited
{ "success": false, "error": "Invalid API key" }

Interactive API Playground

GET /health

Tier: All | Check API health and version.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/health \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": {
    "status": "ok",
    "uptime": 3600
  }
}

GET /markets

Tier: All | List supported betting markets.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/markets \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": [
    {
      "code": "O15",
      "name": "Over 1.5 Goals",
      "emoji": "\u26bd"
    }
  ]
}

GET /free-pick

Tier: All | Get today's free Bet of the Day (stripped reasoning).

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/free-pick \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": {
    "fixture_id": 101,
    "market": "O15",
    "odds": 1.45,
    "date": "2026-05-14"
  }
}

GET /accuracy

Tier: All | Get overall system win rate.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/accuracy \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": {
    "win_rate": 76.5,
    "total_predictions": 1045
  }
}

GET /combos/today

Tier: Pro | Get today's premium combo with AI reasoning.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/combos/today \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": {
    "id": 45,
    "date": "2026-05-14",
    "total_odds": 5.4,
    "status": "pending",
    "picks": [
      {
        "market": "O15",
        "odds": 1.25,
        "confidence": 0.88,
        "reasoning": "Arsenal scores often."
      }
    ]
  }
}

GET /combos/history

Tier: Pro | Get past premium combos.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/combos/history \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": [
    {
      "id": 44,
      "date": "2026-05-13",
      "total_odds": 3.2,
      "status": "won"
    }
  ]
}

GET /combos/:date

Tier: Pro | Get combo for a specific date (YYYY-MM-DD).

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/combos/:date \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": {
    "id": 44,
    "date": "2026-05-13",
    "total_odds": 3.2,
    "status": "won",
    "picks": []
  }
}

GET /predictions/today

Tier: Pro | List all predictions for today.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/predictions/today \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": [
    {
      "id": 1001,
      "match": "Arsenal vs Chelsea",
      "market": "O15",
      "odds": 1.25
    }
  ]
}

GET /predictions/:id

Tier: Pro | Get specific prediction details.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/predictions/:id \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": {
    "id": 1001,
    "match": "Arsenal vs Chelsea",
    "market": "O15",
    "odds": 1.25,
    "status": "won"
  }
}

GET /accuracy/markets

Tier: Pro | Get accuracy broken down by market.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/accuracy/markets \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": {
    "O15": {
      "win_rate": 82.5,
      "total": 400
    },
    "BTS": {
      "win_rate": 65.0,
      "total": 200
    }
  }
}

GET /accuracy/leagues

Tier: Pro | Get accuracy broken down by league.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/accuracy/leagues \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": {
    "Premier League": {
      "win_rate": 75.0,
      "total": 150
    }
  }
}

GET /live/status

Tier: Pro | Get today's pending picks currently live.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/live/status \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": [
    {
      "fixture_id": 1001,
      "elapsed": 45,
      "actual_score": "1-0",
      "status": "HT"
    }
  ]
}

POST /webhooks

Tier: Pro | Register a new webhook URL.

cURL
Node.js
Python
curl -X POST https://api.tbet.ng/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" -d '{
  "url": "https://your-server.com/webhook",
  "events": [
    "combo.created",
    "match.goal"
  ],
  "secret": "your_secure_random_string_here"
}'
Example Response
{
  "success": true,
  "data": {
    "id": 1,
    "url": "https://...",
    "events": [
      "combo.created"
    ],
    "status": "active"
  }
}

GET /webhooks

Tier: Pro | List your registered webhooks.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": [
    {
      "id": 1,
      "url": "https://...",
      "events": [
        "combo.created"
      ],
      "status": "active"
    }
  ]
}

DELETE /webhooks/:id

Tier: Pro | Delete a webhook.

cURL
Node.js
Python
curl -X DELETE https://api.tbet.ng/api/v1/webhooks/:id \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" -d ''
Example Response
{
  "success": true,
  "message": "Webhook deleted successfully."
}

GET /webhooks/:id/deliveries

Tier: Pro | View delivery history for a webhook.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/webhooks/:id/deliveries \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": [
    {
      "id": 10,
      "event": "combo.created",
      "status": 200,
      "timestamp": "2026-05-14T10:00:00Z"
    }
  ]
}

POST /webhooks/test

Tier: Pro | Trigger a test payload to a webhook.

cURL
Node.js
Python
curl -X POST https://api.tbet.ng/api/v1/webhooks/test \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" -d '{
  "webhook_id": 1
}'
Example Response
{
  "success": true,
  "message": "Test payload dispatched."
}

GET /me

Tier: All | Get information about your API key.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/me \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": {
    "tier": "pro",
    "daily_calls_used": 15,
    "daily_limit": 2000
  }
}

GET /me/usage

Tier: All | Get 30-day usage analytics.

cURL
Node.js
Python
curl -X GET https://api.tbet.ng/api/v1/me/usage \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
  "success": true,
  "data": [
    {
      "date": "2026-05-14",
      "calls": 15
    }
  ]
}

POST /keys/rotate

Tier: All | Rotate your API key (invalidates current key).

cURL
Node.js
Python
curl -X POST https://api.tbet.ng/api/v1/keys/rotate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" -d '{}'
Example Response
{
  "success": true,
  "data": {
    "new_key": "tbet_live_a1b2c3d4..."
  }
}

Webhook Events

EventDescription
combo.createdFired when a new premium combo is finalized.
combo.settledFired when all predictions in a combo are settled.
prediction.enteredFired during a match when an early-settle market wins.
prediction.settledFired when a prediction result is final.
match.kickoffFired when a match begins.
match.goalFired when the score changes during a match.
match.halftimeFired when a match reaches halftime.
match.fulltimeFired when a match finishes.
free_pick.createdFired when the free Bet of the Day is finalized.

Webhook Verification

Verify the x-tbet-signature header using your secret.

const signature = req.headers['x-tbet-signature'];
const expected = 'sha256=' + crypto.createHmac('sha256', process.env.WEBHOOK_SECRET).update(JSON.stringify(req.body)).digest('hex');
if (crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
  // Valid
}