Documentation

linkapi API Guide

Integration guide · Generated 2026-08-28 · Same style as the Diamond Result PDF (request + response).

Base URL

https://api.linkapi.tech

Authentication

Send one of:

X-Api-Key: YOUR_KEY
X-Aggregator-Key: YOUR_KEY
Authorization: Bearer YOUR_KEY

Diamond /api/v1 prefer X-Api-Key · Sports / casino prefer X-Aggregator-Key · embed/WS also accept ?key=

Upstream status

Request

curl -sS "https://api.linkapi.tech/health"
curl -sS -H "X-Api-Key: YOUR_KEY" "https://api.linkapi.tech/api/v1/health"
curl -sS -H "X-Api-Key: YOUR_KEY" "https://api.linkapi.tech/api/v1/me"

Response

{
  "ok": true,
  "product": "allapi",
  "version": "5.0.0",
  "sportsReady": true,
  "casinoReady": true,
  "livetvReady": true,
  "mediaReady": true,
  "diamondResult": {
    "ok": true,
    "enabled": true,
    "client": "motherpanel",
    "scope": "sports-settlement-only"
  },
  "scorecard": {
    "connected": true,
    "upstream": "https://dimclscore.external247services.com"
  }
}

Live TV

Request

curl -sS -H "X-Aggregator-Key: YOUR_KEY" \
  "https://api.linkapi.tech/api/sports/4/{gmid}/livetv"

# Casino table stream
curl -sS -H "X-Aggregator-Key: YOUR_KEY" \
  "https://api.linkapi.tech/api/casino/teen20/livetv"

# Ready player
# GET /api/sports/4/{gmid}/embed?key=YOUR_KEY

Sports streams are Alibaba RTS (artc://, ~200–800 ms) inside the playg3 Aliplayer page — not HLS. Prefer embedUrl so the viewer IP is correct. JSON also returns artc for native ApsaraVideo / Aliplayer SDKs. Casino/virtual often use FYI iframes when gettv is locked. See docs/LIVETV-EDGE.md.

Scorecard

Request

curl -sS -H "X-Aggregator-Key: YOUR_KEY" \
  "https://api.linkapi.tech/api/sports/4/{gmid}/scorecard"

curl -sS -H "X-Api-Key: YOUR_KEY" \
  "https://api.linkapi.tech/api/v1/score/cricket/{gmid}"

# Live ticks
# wss://api.linkapi.tech/ws/scorecard?key=YOUR_KEY&eventId=EVENT_ID

Response

{
  "ok": true,
  "etid": "4",
  "gmid": "591156359",
  "scoreEventId": "591156359",
  "source": "detail",
  "scorecard": {
    "event": "scorecard",
    "kind": "derived",
    "data": {
      "spnnation1": "Kashi Rudras",
      "spnnation2": "Noida Kings"
    }
  }
}

If the ball-by-ball feed is quiet, you still get a derived scorecard from match detail (reason: feed_unavailable). The scorecard hub stays connected for live updates when the provider publishes them.

Sports settlement (Result API)

Wired to Diamond Result as client motherpanel. Sports settlement only — never for odds, events, score, livetv, or casino.

MethodPath
GET/api/v1/result/match-odd/:sport/:gmid
POST/api/v1/result/match-odd/:sport/batch (max 25)
GET/api/v1/result/bookmaker/:sport/:eventId
POST/api/v1/result/bookmaker/:sport/batch
GET/api/v1/result/fancy/:sport/:eventId
GET/api/v1/result/fancy/:sport/:eventId/:marketKey

Request

# Single match-odd
curl -sS -H "X-Api-Key: YOUR_KEY" \
  "https://api.linkapi.tech/api/v1/result/match-odd/cricket/465281532"

# Batch
curl -sS -X POST -H "X-Api-Key: YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"items":[{"gmid":"465281532","marketId":4852936121997}]}' \
  "https://api.linkapi.tech/api/v1/result/match-odd/cricket/batch"

Response — settled

{
  "ok": true,
  "sport": "cricket",
  "sport_id": "4",
  "gmid": "465281532",
  "data": {
    "type": "match_odds_result",
    "result": "Ireland Women won",
    "wonDimondSid": 53290,
    "eventId": 465281532,
    "marketId": 4852936121997,
    "sportId": 4,
    "updatedAt": { "date": "2026-06-09", "time": "12:39:22" }
  }
}

Response — not found (live / unknown gmid)

{
  "ok": false,
  "error": "not_found",
  "sport": "cricket",
  "gmid": "591156359"
}

HTTP 404 + not_found is correct until the market is settled upstream.

Casino results

Request

curl -sS -H "X-Aggregator-Key: YOUR_KEY" \
  "https://api.linkapi.tech/api/casino/teen20/results"

curl -sS -H "X-Aggregator-Key: YOUR_KEY" \
  "https://api.linkapi.tech/api/casino/teen20/rules"

curl -sS -H "X-Aggregator-Key: YOUR_KEY" \
  "https://api.linkapi.tech/api/casino/teen20/overlay"

Response — results

{
  "ok": true,
  "gtype": "teen20",
  "source": "/api/front/casino/lastresults2",
  "data": {
    "res": [
      { "mid": 102260828102713, "win": "1" },
      { "mid": 102260828102625, "win": "2" }
    ]
  }
}

Settle flow

  1. GET /health / GET /api/v1/me
  2. Live odds via /api/v1/odds/… (not Result API)
  3. After close: /api/v1/result/match-odd/… (+ bookmaker / fancy)
  4. Casino: /api/casino/{gtype}/results

linkapi · API integration guide · Use Save as PDF above (Destination: Save as PDF).