Quickstart

This quickstart uses only the Public API and working request examples.

Prerequisites

  • Public API token (rk_live_...)
  • demo file (.dem)
  • curl + jq

Set these environment variables:

export BASE_URL="https://highlights-api.rankacy.com"
export TOKEN="rk_live_..."
export DEMO_FILE="/absolute/path/to/match.dem"

1) First API request

curl -sS "$BASE_URL/api/public/v1/demos?limit=5&offset=0" \
  -H "Authorization: Bearer $TOKEN" | jq

2) Upload demo

UPLOAD_RESPONSE=$(curl -sS -X POST "$BASE_URL/api/public/v1/demos/upload" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@$DEMO_FILE")

echo "$UPLOAD_RESPONSE" | jq
export DEMO_ID=$(echo "$UPLOAD_RESPONSE" | jq -r '.demo_id')

Notes from upload response:

  • was_already_processed_successfully=true means this content hash was already SUCCESS before this call.
  • user_demo_assignment tells whether this call newly linked the demo to your user.

3) Poll demo status

curl -sS "$BASE_URL/api/public/v1/demos/$DEMO_ID" \
  -H "Authorization: Bearer $TOKEN" | jq

Possible demo states:

  • NEW
  • PROCESSING
  • SUCCESS
  • FAILED

4) Read parsed kills

KILLS_RESPONSE=$(curl -sS -G "$BASE_URL/api/public/v1/demos/$DEMO_ID/kills" \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "limit=50" \
  --data-urlencode "offset=0")

echo "$KILLS_RESPONSE" | jq
export DEMO_KILL_ID=$(echo "$KILLS_RESPONSE" | jq -r '.items[0].demo_kill_id // empty')
export DEMO_KILL_TICK=$(echo "$KILLS_RESPONSE" | jq -r '.items[0].tick // empty')

5) Query highlight options

curl -sS "$BASE_URL/api/public/v1/highlights/resolutions" \
  -H "Authorization: Bearer $TOKEN" | jq

curl -sS "$BASE_URL/api/public/v1/highlights/fps" \
  -H "Authorization: Bearer $TOKEN" | jq

6) Queue highlight jobs

Standard:

curl -sS -X POST "$BASE_URL/api/public/v1/highlights" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"demo_id\":$DEMO_ID,\"resolution_id\":1,\"fps_id\":1,\"title\":\"Quickstart auto\"}" | jq

By ticks:

if [ -n "$DEMO_KILL_TICK" ]; then
  curl -sS -X POST "$BASE_URL/api/public/v1/highlights/by-ticks" \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d "{\"demo_id\":$DEMO_ID,\"ticks\":[{\"start_tick\":$DEMO_KILL_TICK,\"end_tick\":$DEMO_KILL_TICK}],\"resolution_id\":1,\"fps_id\":1}" | jq
fi

By kill (when kill data exists):

if [ -n "$DEMO_KILL_ID" ]; then
  curl -sS -X POST "$BASE_URL/api/public/v1/highlights/by-kill" \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d "{\"demo_id\":$DEMO_ID,\"demo_kill_ids\":[$DEMO_KILL_ID],\"resolution_id\":1,\"fps_id\":1}" | jq
fi

Primary integration example for developers

Use the local FastAPI integration app that talks to DEV: