πŸ’Ž Diamond API

SkyProvider.cc Aggregator API v2 | View Raw Markdown


Diamond API Documentation

> **SkyProvider.cc Aggregator API v2**
> **Base URL:** http://145.79.12.201:3001/api/v2/diamond/
> **Last Updated:** 2026-05-16


Table of Contents

  • [Overview](#1-overview)

  • [Authentication](#2-authentication)

  • [Endpoints Reference](#3-endpoints-reference)

  • [Data Models](#4-data-models)

  • [Full Markets Scraping](#5-full-markets-scraping)

  • [Casino System](#6-casino-system-in-depth)

  • [Odds & Calculations](#7-odds--calculations)

  • [Domain Rotation System](#8-domain-rotation-system)

  • [Implementation Guide](#9-implementation-guide-for-aggregators)

  • [External APIs for Expansion](#10-external-apis-for-expansion)

  • [Code Examples](#11-code-examples)

  • [Troubleshooting](#12-troubleshooting)

  • 1. Overview

    The **Diamond API** is a unified REST API that aggregates live sports betting data from multiple upstream exchange sources into a single, normalized interface.

    Architecture

    ``
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Diamond API v2 β”‚
    β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
    β”‚ β”‚ /sports β”‚ β”‚ /games β”‚ β”‚ /highlights β”‚ β”‚
    β”‚ β”‚ /open-bets β”‚ β”‚ /betslips β”‚ β”‚ /tokens β”‚ β”‚
    β”‚ β”‚ /tables β”‚ β”‚ /userinfo β”‚ β”‚ /status β”‚ β”‚
    β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
    β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
    β”‚ β”‚ β”‚
    β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
    β”‚ β”‚ diamondController.js β”‚ β”‚
    β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
    β”‚ β”‚ β”‚
    β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
    β”‚ β”‚ β”‚ β”‚ β”‚
    β”‚ β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β” β”‚
    β”‚ β”‚imatchoddsβ”‚ β”‚mouseexchβ”‚ β”‚allpanel β”‚ β”‚
    β”‚ β”‚ LIVE β”‚ β”‚ DISABLEDβ”‚ β”‚ DISABLEDβ”‚ β”‚
    β”‚ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
    β”‚ β”‚ β”‚
    β”‚ β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β” β”‚
    β”‚ β”‚ Playwrightβ”‚ ← Stealth browser, demo login β”‚
    β”‚ β”‚ poller β”‚ reads Vue 3 localStorage every 20s β”‚
    β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    `

    Active Upstreams


    SourceStatusGamesSportsType
    |--------|--------|-------|--------|------|



    **imatchodds** (silver247x.com)βœ… Live30-604Vue 3 localStorage scrape
    mouseexch❌ Disabled00EcoAssets v103 β€” all domains dead
    allpanel❌ Disabled00EcoAssets v103 β€” all domains dead

    Data Flow

  • **Poller** (imatchoddsPoller.js) launches a stealth Playwright browser every 20 seconds

  • Navigates to silver247x.com, clicks **Demo** login

  • Reads TreeSportWithEvent, games, OpenBets, betslips, userinfo, tokens from Vue app's localStorage

  • Normalizes data (parses summaryMarkets JSON, extracts runners with back/lay)

  • Caches to in-memory store with 60s TTL

  • **Controller** (diamondController.js) serves cached data via REST endpoints

  • 2. Authentication

    All Diamond API endpoints require password authentication.

    Methods

    Query Parameter:
    `
    GET /api/v2/diamond/sports?password=Lav@9868@
    `

    Header (preferred):
    `
    x-password: Lav@9868@
    `

    Response (unauthorized)


    `json
    {
    "success": false,
    "error": "Unauthorized"
    }
    `


    3. Endpoints Reference

    3.1 GET /sports

    List all active sports with event counts.

    Request:
    `bash
    curl -H "x-password: Lav@9868@" \
    "http://145.79.12.201:3001/api/v2/diamond/sports"
    `

    Response:
    `json
    {
    "success": true,
    "data": {
    "count": 4,
    "sports": [
    {
    "id": "3",
    "name": "Cricket",
    "eventCount": 10,
    "_source": "imatchodds"
    },
    {
    "id": "2",
    "name": "Tennis",
    "eventCount": 4,
    "_source": "imatchodds"
    },
    {
    "id": "1",
    "name": "Football",
    "eventCount": 22,
    "_source": "imatchodds"
    },
    {
    "id": "26",
    "name": "Horse Racing",
    "eventCount": 2,
    "_source": "imatchodds"
    }
    ]
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.2 GET /games

    List all games with live odds, or filter by sport.

    Query Parameters:


    ParamTypeDescription
    |-------|------|-------------|


    sport_idstringFilter by sport ID (e.g., 3 for Cricket)
    etidstringAlias for sport_id

    Request:
    `bash
    curl -H "x-password: Lav@9868@" \
    "http://145.79.12.201:3001/api/v2/diamond/games?sport_id=3"
    `

    Response:
    `json
    {
    "success": true,
    "data": {
    "count": 10,
    "games": [
    {
    "gmid": "5359254",
    "etid": 3,
    "sportName": "Cricket",
    "title": "England W v New Zealand W",
    "league": "Metro Bank Womens One Day Cup",
    "team1": "England W",
    "team2": "New Zealand W",
    "status": "IN_PLAY",
    "startTime": "2026-05-16T15:00:00",
    "matchDate": "In-Play",
    "isLive": true,
    "isFancy": true,
    "isBookMaker": true,
    "videoURL": "<iframe ... src='https://getscoredata.com/score/...'></iframe>",
    "marketName": "Match Odds",
    "runners": [
    {
    "name": "England W",
    "back": [{ "price": 90.0, "size": 1740 }],
    "lay": [{ "price": 95.0, "size": 10000 }],
    "status": "Normal",
    "marketName": "Match Odds"
    },
    {
    "name": "New Zealand W",
    "back": [{ "price": 1.01, "size": 57614540 }],
    "lay": [{ "price": 1.02, "size": 39663960 }],
    "status": "Normal",
    "marketName": "Match Odds"
    }
    ],
    "_rawMarkets": [...],
    "_source": "imatchodds"
    }
    ]
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.3 GET /highlights

    Get in-play and upcoming games grouped by status.

    Query Parameters:


    ParamTypeDescription
    |-------|------|-------------|


    sport_idstringFilter by sport ID. If omitted, returns ALL sports.
    etidstringAlias for sport_id

    Request:
    `bash
    curl -H "x-password: Lav@9868@" \
    "http://145.79.12.201:3001/api/v2/diamond/highlights?sport_id=3"
    `

    Response:
    `json
    {
    "success": true,
    "data": {
    "t1": [],
    "inplay": [
    {
    "gmid": "5359254",
    "title": "England W v New Zealand W",
    "isLive": true,
    "runners": [...],
    "_source": "imatchodds"
    }
    ],
    "upcoming": [
    {
    "gmid": "5315403",
    "title": "Test a vs test b",
    "isLive": false,
    "runners": [],
    "_source": "imatchodds"
    }
    ],
    "_sources": {
    "imatchodds": true
    }
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.4 GET /games/:gmid

    Get game snapshot (same structure as /games/:gmid/data).

    Path Parameters:


    ParamTypeDescription
    |-------|------|-------------|

    gmidstringGame/Match ID

    Query Parameters:

    ParamTypeDescription
    |-------|------|-------------|

    sport_idstringOptional sport filter for faster lookup


    3.5 GET /games/:gmid/data

    Get full game data with market runners.

    Response:
    `json
    {
    "success": true,
    "data": {
    "game": { /* full game object */ },
    "_source": "imatchodds"
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.6 GET /games/:gmid/detail

    Get game detail (same as data endpoint, for backward compatibility).

    Query Parameters:


    ParameterTypeDescription
    |-----------|------|-------------|

    fullstringSet to 1 to scrape ALL markets (Match Odds, BookMaker, Fancy) on-demand

    Response (with
    ?full=1):
    `json
    {
    "success": true,
    "data": {
    "game": { /* ... game object ... */ },
    "fullMarkets": [
    {
    "name": "MatchOdds",
    "minStake": 100,
    "maxStake": 50000,
    "runners": [
    {
    "name": "Bangladesh",
    "back": [{ "price": "6.40", "size": "42k" }],
    "lay": [{ "price": "6.20", "size": "30k" }],
    "status": "ACTIVE"
    }
    ]
    },
    {
    "name": "BookMaker",
    "minStake": 100,
    "maxStake": 500000,
    "runners": [ /* ... */ ]
    },
    {
    "name": "Fancy",
    "minStake": 100,
    "maxStake": 200000,
    "runners": [ /* ... */ ]
    }
    ],
    "_source": "imatchodds",
    "_marketSource": "scraped"
    }
    }
    `


    3.7 GET /games/:gmid/markets

    **On-demand full market scrape** β€” navigates to the match detail page and extracts ALL markets (Match Odds, BookMaker, Fancy) from the rendered DOM.

    > ⚠️ This endpoint is **slower** (~6-10s) than cached endpoints because it launches a page navigation. Results are cached for 15 seconds.

    Response:
    `json
    {
    "success": true,
    "data": {
    "gmid": "5358824",
    "title": "Bangladesh v Pakistan",
    "teams": { "team1": "Bangladesh", "team2": "Pakistan" },
    "status": "IN_PLAY",
    "isFancy": true,
    "isBookMaker": true,
    "markets": [
    {
    "name": "MatchOdds",
    "minStake": 100,
    "maxStake": 50000,
    "runners": [
    {
    "name": "Bangladesh",
    "back": [{ "price": "6.40", "size": "42k" }],
    "lay": [{ "price": "6.20", "size": "30k" }],
    "status": "ACTIVE"
    }
    ]
    }
    ],
    "_source": "imatchodds",
    "_marketSource": "scraped"
    }
    }
    `


    3.8 GET /games/:gmid/scorecard

    Get live scorecard iframe URL.

    Response:
    `json
    {
    "success": true,
    "data": {
    "event_id": "5359254",
    "score_iframe": "<iframe style='height: 230px; width: 100%;' src='https://getscoredata.com/score/...'></iframe>",
    "title": "England W v New Zealand W",
    "teams": {
    "team1": "England W",
    "team2": "New Zealand W"
    },
    "status": "IN_PLAY",
    "_source": "imatchodds"
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.8 GET /games/:gmid/live-tv

    Get live TV/stream availability.

    Response:
    `json
    {
    "success": true,
    "data": {
    "event_id": "5359254",
    "source": "imatchodds",
    "tv_available": true,
    "stream_url": "<iframe ...>",
    "note": "Direct stream URL from upstream"
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.9 GET /tables

    Get casino game categories.

    Response:
    `json
    {
    "success": true,
    "data": {
    "count": {
    "tables": 0,
    "casino": 12
    },
    "tables": [],
    "casino": [
    {
    "category": "Lobby",
    "categoryIcon": "https://cdn.tesla108.com/images/casino/category/Lobby.png",
    "games": [
    {
    "name": "Aviator",
    "provider": "intl",
    "gameCode": "spribe_aviator",
    "gameId": 201206,
    "imageURL": "https://cd.tesla108.com/images/casino/intl/game/sbe_aviator.png",
    "_source": "imatchodds"
    }
    ]
    }
    ],
    "_sources": {
    "imatchodds": true
    }
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.10 GET /status

    Get health status from all sources.

    Response:
    `json
    {
    "success": true,
    "data": {
    "sources": [
    {
    "source": "mouseexch",
    "sportsPolled": 1,
    "gamesCount": 0,
    "perSport": [{ "sportId": "4", "gameCount": 0, "highlightsAvailable": false }]
    },
    {
    "source": "allpanel",
    "sportsPolled": 1,
    "gamesCount": 0,
    "perSport": [{ "sportId": "4", "gameCount": 0, "highlightsAvailable": false }]
    },
    {
    "source": "imatchodds",
    "sportsPolled": 4,
    "gamesCount": 38,
    "perSport": [
    { "etid": 3, "name": "Cricket", "eventCount": 10 },
    { "etid": 2, "name": "Tennis", "eventCount": 4 },
    { "etid": 1, "name": "Football", "eventCount": 22 },
    { "etid": 26, "name": "Horse Racing", "eventCount": 2 }
    ]
    }
    ],
    "totalGames": 38,
    "totalSports": 6,
    "defaultEtid": "4"
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.11 GET /open-bets

    Get user's open bets from demo account.

    Response:
    `json
    {
    "success": true,
    "data": {
    "openBets": {
    "balance": 0,
    "exposure": 8217,
    "openBets": [
    {
    "betId": "30710139",
    "betTitle": "Indian Premier League",
    "sportId": 3,
    "eventId": 4659043,
    "marketId": 21299330,
    "marketName": "Winner",
    "betType": "Lay",
    "betRate": 7,
    "stake": 3417,
    "expectedProfit": 3417,
    "expectedLoss": 20502,
    "placeTime": "2026-03-30 14:16:40",
    "eventStartTime": "2026-05-19 19:30:00"
    }
    ]
    }
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.12 GET /betslips

    Get betslip stake configurations.

    Response:
    `json
    {
    "success": true,
    "data": {
    "betslips": [
    {
    "title": "10",
    "value": 200,
    "index": 0,
    "creationTime": "2026-05-15T09:10:55.2421071",
    "id": 420398
    },
    {
    "title": "600",
    "value": 600,
    "index": 0,
    "creationTime": "2026-05-15T09:10:55.2421104",
    "id": 420399
    }
    ]
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.13 GET /userinfo

    Get demo user info and preferences.

    Response:
    `json
    {
    "success": true,
    "data": {
    "userinfo": {
    "football": true,
    "tennis": true,
    "cricket": true,
    "election": true,
    "horseRacing": false,
    "kabaddi": false,
    "trade": true,
    "aura": true,
    "international": true,
    "mac": true,
    "king": true,
    "casinoToken": "eyJhbGci...",
    "balance": 0,
    "exposure": 8217,
    "stakes": [
    { "title": "10", "value": 200, "id": 420398 },
    { "title": "600", "value": 600, "id": 420399 }
    ]
    }
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    3.14 GET /tokens

    Get auth tokens and base URLs.

    Response:
    `json
    {
    "success": true,
    "data": {
    "casinoToken": "eyJhbGci...",
    "accessToken": "eyJhbGci...",
    "baseUrl": "https://api.imatchodds.com",
    "domainSetting": { /* domain config */ }
    },
    "timestamp": "2026-05-16T18:00:00.000Z"
    }
    `


    4. Data Models

    Sport


    `typescript
    interface Sport {
    id: string; // Sport ID (e.g., "3" for Cricket)
    name: string; // Display name
    eventCount: number; // Number of events
    _source: string; // Upstream source name
    }
    `

    Game


    `typescript
    interface Game {
    gmid: string; // Game/Match ID
    etid: number; // Sport ID
    sportName: string; // Sport name
    title: string; // Match title
    league: string; // League/Tournament name
    team1: string; // Team A name
    team2: string; // Team B name
    status: string; // "IN_PLAY" | "OPEN" | etc.
    startTime: string; // ISO 8601 start time
    matchDate: string; // Display date
    isLive: boolean; // Currently in play
    isFancy: boolean; // Fancy markets available
    isBookMaker: boolean; // Bookmaker available
    videoURL: string; // Score iframe HTML
    marketName: string; // Primary market name
    runners: Runner[]; // Market runners with odds
    _rawMarkets: any[]; // Raw upstream market data
    _source: string; // "imatchodds"
    }
    `

    Runner


    `typescript
    interface Runner {
    name: string; // Runner/team name
    back: PriceLevel[]; // Back (buy) odds
    lay: PriceLevel[]; // Lay (sell) odds
    status: string; // "Normal" | "Closed" | etc.
    marketName: string; // Parent market name
    }

    interface PriceLevel {
    price: number; // Odds price (e.g., 1.85)
    size: number; // Available liquidity
    }
    `

    OpenBet


    `typescript
    interface OpenBet {
    betId: string;
    betTitle: string;
    sportId: number;
    eventId: number;
    marketId: number;
    marketName: string;
    betType: "Back" | "Lay";
    betRate: number; // Odds at placement
    stake: number;
    expectedProfit: number;
    expectedLoss: number;
    placeTime: string;
    eventStartTime: string;
    }
    `


    5. Full Markets Scraping

    Problem

    The Vue 3 app on silver247x.com stores only **summaryMarkets** (1 market per event β€” typically Match Odds) in localStorage. Events are tagged with isFancy: true and isBookMaker: true, but the actual Fancy and BookMaker market data is loaded on-demand when navigating to the match detail page.

    Solution

    The API now supports **on-demand DOM scraping** via two methods:

  • **GET /games/:gmid/markets** β€” Dedicated endpoint that navigates to the match page and scrapes all markets

  • **GET /games/:gmid/detail?full=1** β€” Existing detail endpoint with full=1 query param
  • Market Types Returned


    Market TypeKey in ResponseDescription
    |-------------|-----------------|-------------|



    **Match Odds**MatchOddsStandard 1X2 or win/lose market
    **BookMaker**BookMakerAsian-style bookmaker odds
    **Fancy**FancySession-based bets (runs, wickets, boundaries, etc.)

    Market Object Structure

    `typescript
    interface Market {
    name: string; // "MatchOdds", "BookMaker", or "Fancy"
    minStake: number; // Minimum bet amount
    maxStake: number; // Maximum bet amount
    runners: Runner[];
    }

    interface Runner {
    name: string; // Team name or fancy runner name
    back: PriceLevel[]; // Back/Yes odds
    lay: PriceLevel[]; // Lay/No odds
    status: "ACTIVE" | "SUSPENDED";
    }

    interface PriceLevel {
    price: string; // Odds value (e.g., "6.40", "541")
    size: string; // Liquidity (e.g., "42k", "2m")
    }
    `

    Performance Notes


    Example: Scraping Flow

    `javascript
    // 1. Get game list (fast, cached)
    const games = await fetch('/api/v2/diamond/games?password=Lav@9868@');

    // 2. When user clicks a game, fetch full markets (slower, on-demand)
    const markets = await fetch('/api/v2/diamond/games/5358824/markets?password=Lav@9868@');
    `


    6. Casino System In-Depth

    Structure

    Casino data is organized as **categories** containing **games**:

    `
    Casino
    β”œβ”€β”€ Lobby (2 games)
    β”‚ β”œβ”€β”€ Aviator (provider: intl, gameCode: spribe_aviator)
    β”‚ └── Aura Casino (provider: lotus)
    β”œβ”€β”€ Landing (15 games)
    β”‚ β”œβ”€β”€ Ezugi (provider: intl)
    β”‚ └── Royal Gaming (provider: intl)
    β”œβ”€β”€ TopSlider (6 games)
    β”œβ”€β”€ NewSlider (5 games)
    β”œβ”€β”€ YoFooter (8 games)
    └── ... (12 categories total)
    `

    Providers


    ProviderTypeLaunch Method
    |----------|------|---------------|




    intlInternational casinogameCode + gameId
    lotusAura/Aura CasinoToken-based URL
    macMac gamesgameCode
    internalInternal pagesPage path

    Launching a Casino Game

  • Get casinoToken from /tokens endpoint

  • Get game details from /tables endpoint

  • For **intl** games: Use gameCode to launch via provider iframe

  • For **lotus** games: Replace {token} in URL with casinoToken
  • **Example:** Aura Casino launch URL:
    `
    https://aura.fawk.app/{token}/82501
    β†’ https://aura.fawk.app/eyJhbGci.../82501
    `


    7. Odds & Calculations

    Back vs Lay


    TypeYouProfit FormulaLoss Formula
    |------|-----|----------------|--------------|


    **Back**Bet FOR outcomestake Γ— (price - 1)stake
    **Lay**Bet AGAINST outcomestakestake Γ— (price - 1)

    Example: Back Bet


    Example: Lay Bet


    Exposure Calculation

    Exposure = Sum of all potential losses across open bets.

    `javascript
    function calculateExposure(openBets) {
    return openBets.reduce((total, bet) => {
    if (bet.betType === 'Back') {
    return total + bet.stake; // Max loss = stake
    } else {
    return total + bet.expectedLoss; // Max loss = stake Γ— (price - 1)
    }
    }, 0);
    }
    `

    Liability on Lay

    `javascript
    function layLiability(stake, price) {
    return stake * (price - 1);
    }

    // Example: Lay β‚Ή5000 @ 1.50
    // Liability = 5000 * (1.50 - 1) = β‚Ή2500
    `


    8. Domain Rotation System

    How It Works

    The exchangeDomainPool.js manages domain health across 176+ exchange domains.

    Health Scoring

    `
    Score = successRate Γ— healthBonus Γ— recencyBonus

    Where:

    `

    Cooldown Escalation


    Consecutive FailuresCooldown Duration
    |---------------------|-------------------|





    130 seconds
    22 minutes
    35 minutes
    410 minutes
    5+30 minutes

    Rotation Logic

  • Score all domains

  • Pick highest-scoring **healthy** domain

  • If all domains in cooldown, pick the one with **earliest cooldown expiry**

  • On success: reset consecutive failures, clear cooldown

  • On failure: increment consecutive failures, apply cooldown
  • Current Pools


    PoolDomainsStatus
    |------|---------|--------|



    mouseexch15All dead (DNS/Cloudflare)
    allpanel176+All dead (DNS/Cloudflare)
    imatchodds1 (silver247x.com)βœ… Active

    Adding Domains at Runtime

    `javascript
    const domainPool = require('./src/services/exchangeDomainPool');
    domainPool.addDomain('imatchodds', 'https://probet777.com');
    `


    9. Implementation Guide for Aggregators

    Polling Strategy


    EndpointRecommended IntervalWhy
    |----------|---------------------|-----|







    /sports60 secondsSports list rarely changes
    /games15-20 secondsOdds change frequently
    /highlights15-20 secondsLive status changes
    /games/:gmid/data3-5 secondsPer-game odds for trading
    /open-bets30 secondsBet status updates
    /tables60 secondsCasino catalog rarely changes
    /status60 secondsHealth monitoring

    Rate Limiting


    Error Handling

    `javascript
    async function fetchWithRetry(endpoint, retries = 3) {
    for (let i = 0; i < retries; i++) {
    try {
    const res = await fetch(
    http://145.79.12.201:3001/api/v2/diamond${endpoint}, {
    headers: { 'x-password': 'Lav@9868@' }
    });
    const data = await res.json();
    if (data.success) return data.data;
    throw new Error(data.error);
    } catch (err) {
    if (i === retries - 1) throw err;
    await sleep(1000 * (i + 1));
    }
    }
    }
    `

    WebSocket Alternative

    Currently Diamond API is REST-only. For real-time updates, poll the /highlights or /games/:gmid/data endpoints. Future versions may add WebSocket support.


    10. External APIs for Expansion

    The following APIs were researched and can be integrated as additional upstreams:

    9.1 Betfair Exchange API


    |---|---|








    **Base URL**https://api.betfair.com/exchange/
    **Auth**App Key + Session Token (OAuth 2.0)
    **Free Tier**βœ… Delayed App Key (1s delay, no bet placement)
    **Live Key**βœ… Available after account verification
    **WebSocket**βœ… Stream API for real-time market data
    **Cricket**βœ… Full coverage
    **Docs**https://developer.betfair.com/

    Key Endpoints:

    **Node.js Library:**
    felixmccuaig/betfair-node (TypeScript, Stream API support)

    9.2 BetInAsia BLACK API


    |---|---|







    **Type**WebSocket Push API
    **Auth**API Key (contact sales)
    **Free Tier**❌ No free tier
    **Coverage**10+ Asian bookmakers + 6 exchanges
    **Exchanges**Betfair, Betdaq, MollyBet, SMarkets, Matchbook, Betdex
    **Docs**https://betinasia.com/sports-betting-api/

    Features:

    9.3 The Odds API


    |---|---|








    **Base URL**https://api.the-odds-api.com/v4/
    **Auth**API Key
    **Free Tier**βœ… 25 requests/day
    **Paid Tier**$29-299/month
    **Coverage**30+ bookmakers, 20+ sports
    **Cricket**βœ…
    **Docs**https://the-odds-api.com/

    Key Endpoints:

    **Best for:** Odds comparison, arbitrage detection

    9.4 API-FOOTBALL


    |---|---|







    **Base URL**https://v3.football.api-sports.io/
    **Auth**x-apisports-key header
    **Free Tier**βœ… 100 requests/day
    **Coverage**1,200+ leagues, live scores, lineups, odds
    **Cricket**❌ Football only
    **Docs**https://www.api-football.com/

    Key Endpoints:

    9.5 Cricbuzz (via RapidAPI)


    |---|---|







    **Base URL**https://cricbuzz-cricket.p.rapidapi.com/
    **Auth**RapidAPI Key (x-rapidapi-key)
    **Free Tier**βœ… $0 tier (limited calls)
    **Coverage**IPL, international, domestic cricket
    **Data**Scores, commentary, stats, schedules
    **Docs**https://rapidapi.com/apidojo/api/cricbuzz-cricket

    Key Endpoints:

    Comparison Table


    APIFree TierBettingLive OddsWebSocketCricketEase
    |-----|-----------|---------|-----------|-----------|---------|------|





    **Betfair**βœ… Delayedβœ…βœ…βœ… Streamβœ…Medium
    **BetInAsia**βŒβœ…βœ…βœ… Pushβœ…Hard
    **The Odds API**βœ… 25/dayβŒβœ…βŒβœ…Easy
    **API-FOOTBALL**βœ… 100/dayβŒβœ…βŒβŒEasy
    **Cricbuzz**βœ…βŒβŒβŒβœ…Easy


    11. Code Examples

    JavaScript / Node.js

    `javascript
    const BASE_URL = 'http://145.79.12.201:3001/api/v2/diamond';
    const PASSWORD = 'Lav@9868@';

    async function getLiveGames() {
    const res = await fetch(
    ${BASE_URL}/highlights, {
    headers: { 'x-password': PASSWORD }
    });
    const data = await res.json();
    return data.data.inplay; // Array of live games
    }

    async function getGameOdds(gmid) {
    const res = await fetch(
    ${BASE_URL}/games/${gmid}/data, {
    headers: { 'x-password': PASSWORD }
    });
    const data = await res.json();
    return data.data.game.runners;
    }

    // Usage
    const games = await getLiveGames();
    for (const game of games) {
    console.log(
    ${game.title}: ${game.status});
    for (const runner of game.runners) {
    const back = runner.back[0]?.price || '-';
    const lay = runner.lay[0]?.price || '-';
    console.log(
    ${runner.name}: Back ${back} / Lay ${lay});
    }
    }
    `

    Python

    `python
    import requests

    BASE_URL = 'http://145.79.12.201:3001/api/v2/diamond'
    HEADERS = {'x-password': 'Lav@9868@'}

    def get_live_games():
    r = requests.get(f'{BASE_URL}/highlights', headers=HEADERS)
    return r.json()['data']['inplay']

    def get_game_odds(gmid):
    r = requests.get(f'{BASE_URL}/games/{gmid}/data', headers=HEADERS)
    return r.json()['data']['game']['runners']

    def calculate_lay_liability(stake, price):
    return stake * (price - 1)

    Usage


    games = get_live_games()
    for game in games:
    print(f"{game['title']}: {game['status']}")
    for runner in game['runners']:
    back = runner['back'][0]['price'] if runner['back'] else '-'
    lay = runner['lay'][0]['price'] if runner['lay'] else '-'
    print(f" {runner['name']}: Back {back} / Lay {lay}")
    `

    cURL

    `bash

    Get all sports


    curl -H "x-password: Lav@9868@" \
    "http://145.79.12.201:3001/api/v2/diamond/sports"

    Get cricket games


    curl -H "x-password: Lav@9868@" \
    "http://145.79.12.201:3001/api/v2/diamond/games?sport_id=3"

    Get game odds


    curl -H "x-password: Lav@9868@" \
    "http://145.79.12.201:3001/api/v2/diamond/games/5359254/data"

    Get open bets


    curl -H "x-password: Lav@9868@" \
    "http://145.79.12.201:3001/api/v2/diamond/open-bets"

    Get casino


    curl -H "x-password: Lav@9868@" \
    "http://145.79.12.201:3001/api/v2/diamond/tables"
    `


    12. Troubleshooting

    "Unauthorized" Response



    Empty Games List



    "Game not found" Error



    Stale Odds



    Scorecard Not Available



    Casino Games Not Loading



    Domain Pool All Dead




    Appendix A: Sport IDs


    IDName
    |----|------|




    1Football
    2Tennis
    3Cricket
    26Horse Racing


    Appendix B: Upstream Sources

    imatchodds (silver247x.com)



    mouseexch / allpanel (Disabled)




    Appendix C: Roadmap β€” Legacy API Parity

    The legacy skyprovider aggregator (/api/v2/events, /api/v2/bets, /api/v2/settlements) used **mouseexch + allpanel + skyprovider (uni247)** with smart domain rotation. Those upstreams are now dead.

    **Diamond API is the replacement**, using **imatchodds** (silver247x.com) as the sole live upstream.

    What Exists in Diamond βœ…


    FeatureLegacy EndpointDiamond Endpoint
    |---------|-----------------|-----------------|








    Sports listGET /sportsβœ… GET /diamond/sports
    Events listGET /eventsβœ… GET /diamond/games
    Event detailGET /events/:idβœ… GET /diamond/games/:gmid/detail
    Live oddsGET /events/:id/oddsβœ… GET /diamond/games/:gmid/markets
    Fancy oddsGET /events/:id/fancyβœ… GET /diamond/games/:gmid/markets
    ScorecardGET /events/:id/scorecardβœ… GET /diamond/games/:gmid/scorecard
    Live TVGET /events/:id/live-tvβœ… GET /diamond/games/:gmid/live-tv
    HighlightsGET /highlightsβœ… GET /diamond/highlights

    What's Missing ❌ (Priority Order)


    PriorityFeatureLegacy EndpointStatus
    |----------|---------|-----------------|--------|










    πŸ”΄**Search games**GET /events/searchNot implemented
    πŸ”΄**Dedicated odds endpoint**GET /events/:id/oddsPartial (use /markets)
    πŸ”΄**Bet placement**POST /betsNot implemented
    πŸ”΄**Settlement preview**POST /settlements/previewNot implemented
    🟑**Odds history**GET /events/:id/odds/historyNot implemented
    🟑**Bet listing**GET /betsNot implemented
    🟑**Auto-settlement**POST /settlements/autoNot implemented
    🟑**Bulk settlement**POST /settlements/bulkNot implemented
    🟑**Bet trace**GET /trace/*Not implemented
    🟒**Real-time streaming**WebSocketNot implemented (20s poll)

    Why mouseexch/allpanel Are Dead

    The **smart login rotation** system (exchangeDomainPool.js) tracked 15 mouseexch + ~200 allpanel domains with health scoring and cooldown logic. All domains now fail with:


    The domain rotation code still exists but has **zero healthy domains** to rotate to.

    Full Comparison Document

    See LEGACY_VS_DIAMOND.md` for a complete side-by-side endpoint mapping.


    *End of Diamond API Documentation*


    SkyProvider.cc © 2026 | Diamond API v2.0.0