API Reference

KhelaDekho. API

Technical reference for KhelaDekho proxy aggregation, live scores, match telemetry, stream proxying, and API endpoints.

Lobby Lounge

Edge API

FastAPI + Worker

Same routes, two runtimes

Score Provider

V1 Scores

Live scores & match data

X-Key

Authentication

Single shared key

Proxied

V2 / V4 / V5

Channel & match streams

Authentication

Single Shared Key

Every API endpoint expects the shared xkey header. The same key is used across the FastAPI app and the Cloudflare Worker. Proxy routes are exempt.

Header:
  • xkey: <your-shared-key>

Request Format

Requests use a standard REST format returning the shared JSON envelope.

system.out
$
GET /api/v1/scores?date=2026-07-06

Header: xkey: <your-shared-key>

Endpoints Spec
system_manifest
Method & PathDescriptionAccess Auth
GET /api/v1/healthHealth checkX-Key
GET /api/v1/scoresScores + telemetry. Filters: ?status=live|result|fixture, ?competition=, ?date=X-Key
GET /api/v1/competitionsCompetition list with match countsX-Key
GET /api/v1/matches/:id?slug=Match details, lineups, stats, commentaryX-Key
GET /api/v1/player/:idPlayer profile, stats, nationalityX-Key
GET /api/v1/team/:idTeam info, recent matchesX-Key
GET /api/v2/matchesLive matches; then /matches/:slug/channels and /matches/:slug/streamX-Key
GET /api/v4/channelsV4 channel list, stream, statsX-Key
GET /api/v5/matches?sport=Match list (12 sports: football, cricket, motorsports, basketball, fight, rugby, tennis, golf, american-football, afl, volleyball, 24/7-streams; defaults to football)X-Key
GET /api/v5/matches/:slug/channels?sport=Channels & substreams for a matchX-Key
GET /api/v5/matches/:slug/stream?ch=&sport=Resolve one channel/substream + proxyX-Key
GET /api/v5/tv/channelsDLHD 24/7 TV channel list (878+ channels)X-Key
GET /api/v5/tv/channel/:id/streamResolve a DLHD channel + proxyX-Key
Response Examples by Version
V1

GET /api/v1/scores

system.out
$
{
  "success": true,
  "data": {
    "competitions": [{
      "id": "premier-league",
      "name": "Premier League",
      "area": "England",
      "image_url": "https://cdn.provider.example/competition/badge/abc.png",
      "matches": [{
        "id": "match-123",
        "start_date": "2026-07-06T20:00:00Z",
        "status": "LIVE",
        "score_team_a": 2,
        "score_team_b": 1,
        "team_a": { "id": "team-a", "name": "Arsenal", "code": "ARS", "image_url": "https://cdn.provider.example/team/arsenal.png" },
        "team_b": { "id": "team-b", "name": "Chelsea", "code": "CHE", "image_url": "https://cdn.provider.example/team/chelsea.png" }
      }]
    }],
    "total_matches": 1
  },
  "error": null
}
V2

GET /api/v2/matches

system.out
$
{
  "success": true,
  "data": {
    "matches": [{
      "id": "match-slug-1",
      "slug": "match-slug-1",
      "name": "Arsenal vs. Chelsea",
      "sport": "football",
      "status": "live",
      "is_live": true,
      "start_date": "2026-07-06T20:00:00+06:00",
      "end_date": "2026-07-06T22:00:00+06:00",
      "poster": "https://cdn.provider.example/poster.jpg",
      "team_a": { "name": "Arsenal", "logo": "https://cdn.provider.example/arsenal.png" },
      "team_b": { "name": "Chelsea", "logo": "https://cdn.provider.example/chelsea.png" }
    }]
  },
  "error": null
}
V2 / V5

GET .../matches/:slug/channels

system.out
$
{
  "success": true,
  "data": {
    "slug": "match-slug-1",
    "channels": [{
      "id": "channel-1",
      "name": "Sports HD",
      "server": "TV"
    }]
  },
  "error": null
}
V5

GET /api/v5/matches

system.out
$
{
  "success": true,
  "data": {
    "matches": [{
      "id": "arsenal-vs-chelsea",
      "slug": "arsenal-vs-chelsea",
      "name": "Arsenal vs. Chelsea",
      "sport": "football",
      "status": "upcoming",
      "is_live": false,
      "start_date": 1783364400000,
      "poster": "https://cdn.provider.example/poster.jpg",
      "team_a": { "name": "Arsenal", "logo": "https://cdn.provider.example/arsenal.png" },
      "team_b": { "name": "Chelsea", "logo": "https://cdn.provider.example/chelsea.png" }
    }]
  },
  "error": null
}
V5

GET .../matches/:slug/stream?ch=

system.out
$
{
  "success": true,
  "data": {
    "name": "Sports 4K",
    "stream_url": "/api/v5/proxy?t=1",
    "stream_type": "hls",
    "drm_kid": null,
    "drm_key": null
  },
  "error": null
}
V5 TV

GET /api/v5/tv/channels

system.out
$
{
  "success": true,
  "data": {
    "channels": [{
      "id": "dlhd-521",
      "name": "Sports Channel HD",
      "image": "https://cdn.provider.example/logo.png",
      "country": "us",
      "category": "Sports"
    }],
    "total": 878,
    "cached_at": "2026-07-06T17:13:07Z"
  },
  "error": null
}
V5 TV

GET /api/v5/tv/channel/:id/stream

system.out
$
{
  "success": true,
  "data": {
    "id": "dlhd-521",
    "stream_url": "/api/v5/proxy?t=1",
    "stream_type": "hls"
  },
  "error": null
}
V4

GET /api/v4/channels

system.out
$
{
  "success": true,
  "data": {
    "channels": [{
      "id": "sport1",
      "name": "Sports Channel HD",
      "stream_url": "https://cdn.provider.example/hls/sky-sports.m3u8",
      "stream_type": "hls",
      "drm_kid": null,
      "drm_key": null,
      "cached_at": "2026-07-06T17:13:07Z"
    }],
    "total": 120,
    "cached_at": "2026-07-06T17:13:07Z"
  },
  "error": null
}
Error

Standard Error Shape

system.out
$
{
  "success": false,
  "data": null,
  "error": {
    "code": "HTTP_401",
    "message": "Invalid or missing xkey."
  }
}
Client Code Integrations

V1 Live Scores Integration

KhelaDekho V1 API exposes live scores and match statistics sourced directly from the configured provider. The response envelope formats teams, current live scores, match period/telemetry, and referee logs.

system.out
$
// V1 serves live scores from the configured provider
const scores = await getGoalScores();          // GET /api/v1/scores
// competitions[].matches[] -> teams, score, status, period

Python Integration

system.out
$
import requests

base_url = "http://localhost:8000"
headers = {"xkey": "your-shared-key"}

response = requests.get(f"{base_url}/api/v1/scores", headers=headers)
print(response.json())

Node.js Integration

system.out
$
const axios = require('axios');

const baseUrl = "http://localhost:8000";

axios.get(`${baseUrl}/api/v1/scores`, { headers: { xkey: "your-shared-key" } })
  .then(res => console.log("Scores:", res.data))
  .catch(err => console.error("Error:", err.message));