Analytics

Retrieve contest performance metrics

Analytics

Pull performance metrics and statistics for your contests.


Get Contest Analytics

GET/api/v1/contests/:contestId/analytics
Public or Private API Key

Returns aggregated analytics for a specific contest, including entry counts, views, bonus action completions, and point statistics.

Path Parameters

contestIdstring required

The unique contest identifier

Request

curl -X GET https://blitzrocket.com/api/v1/contests/clx1abc123/analytics \
  -H "x-api-key: your_api_key_here"
const contestId = "clx1abc123";
const response = await fetch(
  `https://blitzrocket.com/api/v1/contests/${contestId}/analytics`,
  {
    headers: { "x-api-key": "your_api_key_here" },
  }
);

const { data } = await response.json();
console.log(`Total entries: ${data.totalEntries}`);
console.log(`Total views: ${data.totalViews}`);
console.log(`Conversion rate: ${((data.totalEntries / data.totalViews) * 100).toFixed(1)}%`);
import requests

contest_id = "clx1abc123"
response = requests.get(
    f"https://blitzrocket.com/api/v1/contests/{contest_id}/analytics",
    headers={"x-api-key": "your_api_key_here"}
)

data = response.json()["data"]
print(f"Total entries: {data['totalEntries']}")
print(f"Total views: {data['totalViews']}")
conversion = (data["totalEntries"] / data["totalViews"]) * 100 if data["totalViews"] > 0 else 0
print(f"Conversion rate: {conversion:.1f}%")

Response

{
  "success": true,
  "data": {
    "totalEntries": 1523,
    "confirmedEntries": 1489,
    "disqualifiedEntries": 12,
    "totalViews": 28450,
    "totalBonusCompletions": 4567,
    "points": {
      "total": 45890,
      "average": 30.1,
      "highest": 890
    }
  }
}

Response Fields

totalEntriesnumber

Total number of entries in the contest

confirmedEntriesnumber

Entries with confirmed email addresses

disqualifiedEntriesnumber

Number of disqualified entries

totalViewsnumber

Total contest page views

totalBonusCompletionsnumber

Total bonus action completions across all entries

points.totalnumber

Sum of all points across all entries

points.averagenumber

Average points per entry

points.highestnumber

Highest point total for a single entry

Usage Notes

  • Analytics are computed in real-time from the contest data
  • Use these metrics to track contest performance and engagement
  • Combine with the leaderboard endpoint for comprehensive dashboards

Example: Analytics Dashboard

async function getContestDashboard(contestId, apiKey) {
  const [analyticsRes, leaderboardRes, contestRes] = await Promise.all([
    fetch(`https://blitzrocket.com/api/v1/contests/${contestId}/analytics`, {
      headers: { "x-api-key": apiKey },
    }),
    fetch(`https://blitzrocket.com/api/v1/contests/${contestId}/leaderboard?limit=5`, {
      headers: { "x-api-key": apiKey },
    }),
    fetch(`https://blitzrocket.com/api/v1/contests/${contestId}`, {
      headers: { "x-api-key": apiKey },
    }),
  ]);

  const [analytics, leaderboard, contest] = await Promise.all([
    analyticsRes.json(),
    leaderboardRes.json(),
    contestRes.json(),
  ]);

  return {
    contest: contest.data,
    analytics: analytics.data,
    topParticipants: leaderboard.data,
    conversionRate:
      analytics.data.totalViews > 0
        ? ((analytics.data.totalEntries / analytics.data.totalViews) * 100).toFixed(1)
        : "0",
  };
}
import requests
from concurrent.futures import ThreadPoolExecutor

def get_contest_dashboard(contest_id, api_key):
    headers = {"x-api-key": api_key}
    base = "https://blitzrocket.com/api/v1"

    def fetch(endpoint):
        return requests.get(f"{base}{endpoint}", headers=headers).json()

    with ThreadPoolExecutor(max_workers=3) as pool:
        analytics_future = pool.submit(fetch, f"/contests/{contest_id}/analytics")
        leaderboard_future = pool.submit(fetch, f"/contests/{contest_id}/leaderboard?limit=5")
        contest_future = pool.submit(fetch, f"/contests/{contest_id}")

    analytics = analytics_future.result()["data"]
    leaderboard = leaderboard_future.result()["data"]
    contest = contest_future.result()["data"]

    views = analytics["totalViews"]
    entries = analytics["totalEntries"]
    conversion = f"{(entries / views * 100):.1f}" if views > 0 else "0"

    return {
        "contest": contest,
        "analytics": analytics,
        "top_participants": leaderboard,
        "conversion_rate": conversion
    }

Error Responses

StatusErrorDescription
400Missing contestIdThe contestId path parameter is required
401Invalid API keyAPI key is missing or invalid
404Contest not foundNo contest exists with the given ID