Public API Guide

All documented endpoints below are under:

/api/public/v1

Examples in this docs set assume:

export BASE_URL="https://highlights-api.rankacy.com"
export TOKEN="rk_live_..."

Authentication

Use bearer token authentication for every request:

Authorization: Bearer <token>

Public API surface

Demos:

  • POST /demos/upload
  • GET /demos
  • GET /demos/{demo_id}
  • GET /demos/{demo_id}/kills

Highlights:

  • GET /highlights
  • GET /highlights/resolutions
  • GET /highlights/fps
  • POST /highlights
  • POST /highlights/by-ticks
  • POST /highlights/by-kill

Webhooks:

  • processing terminal events:
  • demo.processed.success
  • demo.processed.failed
  • highlight.processed.success
  • highlight.processed.failed

Fast first call

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

Upload -> options -> generate flow

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

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

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

Upload response now includes:

  • was_already_processed_successfully
  • user_demo_assignment (newly_assigned or already_assigned)

Python snippet (httpx)

import httpx

base_url = "https://highlights-api.rankacy.com"
token = "rk_live_..."

with httpx.Client(timeout=30) as client:
    resp = client.get(
        f"{base_url}/api/public/v1/demos",
        headers={"Authorization": f"Bearer {token}"},
    )
    resp.raise_for_status()
    print(resp.json())

Continue reading