📖 Browse API Endpoints ▼

WicketByte API Reference

Welcome to the official developer documentation for the WicketByte Real-Time Cricket Data Platform. Connect your fantasy app, sports news site, or analytics engine to ultra-low latency cricket feeds.

Authentication

All REST endpoints require an active API Key. You can generate a free 5,000-request developer key from your Client Dashboard.

Pass your API Key via Query Parameter or HTTP Header:

Method 1: Query Parameter (Recommended)
GET https://api.wicketbyte.in/api/matches?status=live&api_key=YOUR_API_KEY
Method 2: X-API-Key Header
curl -H "X-API-Key: YOUR_API_KEY" https://api.wicketbyte.in/api/matches?status=live

Rate Limits & Quota Errors

Every account has an allocated request quota (e.g. Free Starter: 5,000 requests; Developer Pro: 250,000 requests). When your quota runs out, the API returns an explicit HTTP 429 error response:

HTTP 429 Quota Finished Payload
{
  "success": false,
  "code": 429,
  "error": "Your API request limit is finished! You have used all (5000 / 5000) allocated API requests. Please upgrade or recharge your key at https://wicketbyte.in/user-dashboard",
  "limit_finished": true,
  "quota_used": 5000,
  "quota_limit": 5000,
  "dashboard_url": "https://wicketbyte.in/user-dashboard"
}

GET Live & Upcoming Matches

/api/matches

Returns the list of active live matches, upcoming fixtures, and recent results along with scores and run rates.

⇄ Scroll table horizontally to view all parameters
Parameter Type Description
status string Filter by: live, upcoming, completed, or all. (Default: live)
limit integer Number of records to return (1-50). Default: 20.
api_key string Your active WicketByte API Key (Required).
Example Response
{
  "success": true,
  "total": 1,
  "data": [
    {
      "id": "14HO",
      "title": "Chitwan Rhinos vs Karnali Yaks",
      "team1": "Chitwan Rhinos",
      "team1_short": "CWR",
      "team2": "Karnali Yaks",
      "team2_short": "KNY",
      "status": "live",
      "active_team_score": "55/3 (7.1)",
      "current_overs": "7.1",
      "crr": "7.67",
      "series_name": "Nepal Premier League 2026"
    }
  ]
}

GET Single Match Detailed Scorecard

/api/match_detail?id={MATCH_ID}

Returns deep live score details: currently active striker and non-striker batters, bowler figures, partnership details, over summaries, and live win probability.

⇄ Scroll table horizontally to view all parameters
Parameter Type Description
id string Match ID (e.g. 14HO). Required.
api_key string Your active WicketByte API Key. Required.

GET Ball-by-Ball Commentary & AI Feeds

/api/commentary?id={MATCH_ID}

Retrieves chronological ball-by-ball commentary, runs, wicket indicators, and AI live narrative enhancements.

Sample Commentary Response
{
  "success": true,
  "match_id": "14HO",
  "count": 2,
  "data": [
    {
      "over_num": "6.5",
      "runs": "6",
      "title": "Usama Mir to Pawan Sarraf",
      "commentary_text": "SIX! Clean strike right over the long-on boundary for a maximum!",
      "ai_commentary": "Pawan Sarraf skips down the track and unleashes a thunderous lofted drive into the crowd!",
      "is_wicket": 0,
      "is_boundary": 1
    }
  ]
}

GET Gemini AI Ball-by-Ball Commentary Engine GEMINI 2.5 / 3 PRO

/api/ai_commentary?id={MATCH_ID}&tone={TONE}&lang={LANG}

Generates context-aware, stadium-grade synthetic ball-by-ball commentary dynamically via Google Gemini AI models. Commentary unlocks tiered uniqueness and custom style prompts based on your subscribed plan.

Plan-Based AI Capabilities:
  • Free Tier: Shared baseline AI commentary across standard public matches.
  • Basic Tier: 100% Unique per-subscriber AI commentary cache. Every ball yields distinct phrasing exclusively tied to your API Key.
  • Advance Plan: Full AI Studio unlocked — choose from 6 commentator personalities, 8 broadcast languages, or inject custom brand persona and sponsor mentions (e.g. "Powered by YourBrand").
⇄ Swipe table horizontally to see all columns
⇄ Scroll table horizontally to view all parameters
Parameter Type Plan Description
id string All Match ID (e.g. 14HO, 13XD). Required.
tone string Advance Commentary style: broadcast (Harsha Bhogle style), hype (High-octane stadium energy), analytical (Tactical & strike rates), humor (Witty banter), radio (Vintage radio storytelling), gully (Desi gully cricket swag). Default: broadcast.
lang string Advance Broadcast language: en (English), hi (Hindi), hg (Hinglish), ta (Tamil), te (Telugu), bn (Bengali), mr (Marathi), ur (Urdu). Default: en.
limit integer All Number of recent balls to retrieve (1 to 100). Default: 30.
custom_instructions string Advance Custom prompt rules, sponsor mentions, or commentary persona (e.g. "Always mention 'Dream11 Super Six' on boundaries and keep lines under 20 words").
api_key string All Your active WicketByte API Key. Required via query param or X-API-Key header.
Sample Response (Advance Plan — Hindi Hype Tone)
{
  "success": true,
  "match_id": "14zw",
  "commentary_tier": "advance",
  "mode": "advance_custom",
  "tone": "hype",
  "language": "hi",
  "count": 30,
  "ai_generated": 1,
  "model": "wicketbyte-ai-v3",
  "data": [
    {
      "id": 104,
      "match_id": "14zw",
      "over_num": "19.4",
      "runs": "6",
      "title": "Usama Mir to Pawan Sarraf",
      "commentary_text": "SIX! Clean strike right over the long-on boundary for a maximum!",
      "ai_commentary": "गज़ब का सिक्स! पावन सर्राफ ने गेंद को सीधे स्टेडियम के पार पहुंचा दिया! दर्शकों में जबरदस्त रोमांच!",
      "ai_status": "custom_generated",
      "is_wicket": 0,
      "is_boundary": 1
    }
  ]
}

GET Legal Procedural Vector Avatars

/api/avatar?name={NAME}&role={ROLE}

Dynamically renders a 100% legal, copyright-free SVG athlete avatar with deterministic sports gradients, initials, and role badges ( Batsman, 🔴 Bowler, 🧤 Wicketkeeper).

Zero DMCA Risk: You are 100% legally covered to display these vector player avatars in your commercial apps and fantasy products without licensing third-party photo libraries.

WS Real-Time WebSocket Protocol

wss://api.wicketbyte.in/ws

For sub-second live scoreboards (<100ms push), establish a persistent WebSocket connection directly with our cluster.

JavaScript WebSocket Example
const ws = new WebSocket('wss://api.wicketbyte.in/ws');

ws.onopen = () => {
    console.log('Connected to WicketByte Stream');
    // Subscribe to a specific match
    ws.send(JSON.stringify({ type: 'GET_MATCH', match_id: '14HO' }));
};

ws.onmessage = (event) => {
    const payload = JSON.parse(event.data);
    if (payload.type === 'LIVE_UPDATE') {
        console.log('⚡ Scoreboard Updated:', payload.live);
    }
};

// Keep-alive ping every 30 seconds
setInterval(() => ws.send(JSON.stringify({ type: 'PING' })), 30000);