Skip to content
On this page

Architecture

Scottfree Sports is a data pipeline, API, web app, CLI, and MCP tool surface for sports model research.

High-Level Flow

text
Odds/results sources
  -> game-score files in GCS
  -> product and model pipelines
  -> prediction/result/summary artifacts in GCS
  -> FastAPI on Cloud Run
  -> web app, REST API, CLI, MCP

Core Components

ComponentLocationPurpose
Odds and game data pipelinecode/Updates canonical game-score files and repairs provider gaps
Model pipelinecode/, sflow/Generates prediction, result, summary, rolling, density, and team-form artifacts
Product pipelineProducts/, code/pipeline_product_daily.pyGenerates customer CSV snapshots and product release packages
API backendapi/FastAPI service, auth, rate limits, customer account, Sports Data refresh
Web appsflow-app/React app for Predictions, Results, Summary, Account
CLI/MCPsflow-cli/Premium terminal and assistant tool access
Documentationdocs/VitePress docs site

Data Storage

Primary storage is Google Cloud Storage bucket alphapy-sports.

Important object groups:

GroupPurpose
{SPORT}/{sport}_game_scores_1g.csvCanonical source game-score tape per sport
Prediction artifactsCurrent slate model probabilities
Live result artifactsRecent graded model results
Summary artifactsModel performance summaries
Rolling/density artifactsResults and Summary page visualization payloads
products/{sport}/...Sports Data refresh CSVs and coverage sidecars

Firestore stores customers, API keys, subscription state, Sports Data ownership, usage counters, and operational audit records.

API Backend

Production API:

text
https://sports-api.scottfreellc.com

Main route groups:

Path familyPurpose
/api/v1/predictions/{sport}/{model_type}Current slate predictions
/api/v1/public/ml-picks/{sport}/{market}Free website ML table feed
/api/v1/odds/{sport}Current odds
/api/v1/results/{sport}/{model_type}Recent graded results
/api/v1/results/{sport}/{model_type}/rollingRolling results visualization payload
/api/v1/results/{sport}/{model_type}/densityResult distribution payload
/api/v1/results/{sport}/{model_type}/team-formCurrent-season team form
/api/v1/summary/{sport}/{model_type}Model summary
/api/v1/customers/meAccount
/api/v1/scottfree-sports-data/*Historical dataset refreshes

Legacy /picks/* and /edge-picks/* endpoints return empty compatibility payloads because no validated betting selector is active.

Customer Products

ProductBackend behavior
Sports DataAccount plus historical dataset refresh endpoints. Prediction API quota is zero unless the same customer also has Basic/Premium.
Sports BasicWeb app and REST API with 50,000 monthly requests.
Sports PremiumBasic plus CLI/MCP with 200,000 monthly requests.

CLI And MCP

The Premium package is scottfree-sports-cli.

Entrypoints:

CommandPurpose
sfsCLI
sfs-mcpMCP server

The MCP server exposes 16 public customer data tools for Premium assistant workflows.

Scheduled Jobs

JobPurpose
pipeline-game-oddsRefresh game files and repair recent source gaps
pipeline-modelsGenerate predictions/results/summary artifacts
pipeline-product-dailyGenerate product CSV snapshots
pipeline-orders-pollPoll SquareSpace orders and reconcile customers

Auth And Rate Limits

API keys can be sent by:

  • X-API-Key
  • Authorization: Bearer
  • api_key query parameter for quick tests

Monthly API quotas:

PlanLimit
Basic50,000
Premium200,000

Sports Data refresh quota is separate: 8 refreshes per calendar month.

Current Product Stance

Scottfree Sports exposes model research, market-implied probabilities, line fields, current odds, results, summaries, and contextual data. It does not currently market or activate a validated betting selector, line-movement pick system, Kelly sizing system, or guaranteed profitable pick feed.

Sports model data and research tools