Skip to content

AI-powered gaming analytics API that boosts player retention 40% with personalized coaching and smart monetization ($750-7500/month SaaS)

License

Notifications You must be signed in to change notification settings

ConWan30/qortrola-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qortrola Gaming Analytics API

AI-Powered Gaming Analytics with Survey Revenue Generation, Real AI Agents, Player Compensation, and Decentralized Communication.

Overview

Qortrola is an advanced gaming analytics platform that integrates AI agents, survey-based revenue generation, player compensation systems, and decentralized features via DePIN. It supports biometric BYOD (Bring Your Own Device) for wellness monitoring, using wearables like Fitbit for real-time health insights (e.g., stress, sleep loss). The platform is built with FastAPI and leverages xAI's Grok API for intelligent analytics, ensuring gamer data control and synergistic alignment with IoTeX features (w3bstream, ioID, Quicksilver, Realms).

Key Features:

  • AI Agents: Gaming coach, wellness enhancement, churn prediction, biometric validation, user agency preservation, real-time gaming trend analysis, with multimodal processing (images/video/audio) and native tool calling for chained operations.
  • Survey Revenue: Auto-generated surveys for engagement, monetization, hardware, and wellness, with player compensation tiers (bronze to platinum).
  • Player Analytics: Track sessions, events, playtime, and multimodal insights.
  • DePIN Integration: Enhanced communication with IoTeX for data verification (w3bstream), device identity (ioID), real-time AI (Quicksilver), and knowledge bases (Realms).
  • Privacy Controls: Consent logging and audit reports for data types like biometrics.

Setup and Deployment

  1. Environment Variables:

    • XAI_API_KEY: Your xAI Grok API key (required for AI features).
    • DATABASE_URL: PostgreSQL connection string (e.g., postgresql://user:pass@host/db).
    • Set in Railway or your deployment platform.
  2. Installation:

    pip install -r requirements.txt
    
  3. Run Locally:

    uvicorn main:app --reload
    
  4. Deployment on Railway:

    • Connect your GitHub repository.
    • Add environment variables.
    • Deploy and monitor via the dashboard.

API Endpoints

  • Root: GET / - Health check and welcome message.
  • Developers:
    • POST /api/v1/developers/register - Register a developer.
    • GET /api/v1/test/activate-subscription?email={email} - Activate test subscription.
  • Players:
    • POST /api/v1/players?api_key={key} - Create a player.
    • GET /api/v1/players/{player_id}/wallet - Get player wallet details.
    • POST /api/v1/players/{player_id}/withdraw - Request withdrawal.
    • GET /api/v1/players/{player_id}/tier-progress - Get tier progress.
  • Events:
    • POST /api/v1/events?api_key={key} - Track an event (may auto-generate surveys).
  • Surveys:
    • GET /api/v1/surveys/mine?api_key={key} - Get developer's surveys.
    • POST /api/v1/surveys/create?api_key={key}&survey_type={type}&target_audience={audience}&player_id={id} - Create manual survey.
    • POST /api/v1/surveys/respond - Submit survey response.
  • AI Agents:
    • POST /api/v1/ai-agents/coach?api_key={key}&player_id={id} - Gaming coach advice.
    • POST /api/v1/ai-agents/wellness-enhanced?api_key={key}&player_id={id} - Enhanced wellness analysis (now supports multimodal inputs like image URLs for wearable graphs).
    • POST /api/v1/ai-agents/churn-prediction?api_key={key}&player_id={id} - Churn risk prediction.
    • POST /api/v1/ai-agents/biometric-validator?api_key={key}&player_id={id} - Biometric validation (enhanced with multimodal processing for images).
    • POST /api/v1/ai-agents/user-agency?api_key={key}&player_id={id} - User data privacy management.
    • POST /api/v1/ai-agents/trend-analyzer?api_key={key}&player_id={id} - Real-time gaming trend analysis.
  • Analytics:
    • GET /api/v1/analytics/player/{player_id}?api_key={key} - Player analytics.
    • GET /api/v1/analytics/developer?api_key={key} - Developer analytics.
    • GET /api/v1/analytics/platform/compensation - Platform compensation stats.
    • POST /api/v1/analytics/predictive?api_key={key}&player_id={id} - Predictive analytics.
  • Privacy:
    • POST /api/v1/privacy/consent?api_key={key} - Manage consent.
    • GET /api/v1/privacy/audit?player_id={id}&api_key={key} - Generate audit report.
  • System:
    • GET /api/v1/health - Health check.
    • GET /api/v1/integration/status - Integration status.
    • GET /download/sdk/{platform} - Download SDK.
    • POST /api/v1/depin/communicate - DePIN communication (enhanced with IoTeX simulations for w3bstream, ioID, Quicksilver, Realms).
  • Admin:
    • POST /api/v1/admin/players/bulk-tier-update?admin_key={key} - Bulk tier update.

Novel AI Features

  • Real-Time Gaming Trend Analyzer: Fetches live trends from X and web sources via Grok 4, integrating with player data for dynamic insights (e.g., correlating biometrics with global gaming patterns).
  • Multimodal Processing: Supports images (e.g., Fitbit graphs) in wellness and validation agents for comprehensive outputs.
  • Native Tool Calling: Enables chained AI operations (e.g., trend analysis with DePIN verification) for automated survey generation and compensation.

Dependencies

See requirements.txt for full list, including openai for xAI Grok API compatibility.

License

MIT License.