AltSportsData

OpenAPI Specification

Download and reference the AltSportsData OpenAPI 3.0 specification

OpenAPI Specification

The AltSportsData API is fully described using the OpenAPI 3.0 standard. You can use the spec to generate client libraries, import into API tools, or build automations.

Specification URLs

Quick Download

# Download the OpenAPI spec
curl -o openapi.json https://api.altsportsdata.com/public/docs/swagger-json

# Pretty-print it
cat openapi.json | python3 -m json.tool > openapi-formatted.json

# List all endpoints
cat openapi.json | python3 -c "
import json, sys
spec = json.load(sys.stdin)
for path, methods in sorted(spec['paths'].items()):
    for method in methods:
        print(f'{method.upper():6s} {path}')
"
import requests
import json

# Download the spec
response = requests.get("https://api.altsportsdata.com/public/docs/swagger-json")
spec = response.json()

# Save locally
with open("openapi.json", "w") as f:
    json.dump(spec, f, indent=2)

# List all endpoints
for path, methods in sorted(spec["paths"].items()):
    for method, details in methods.items():
        print(f"{method.upper():6s} {path}{details.get('summary', '')}")

# List all schemas
schemas = spec.get("components", {}).get("schemas", {})
print(f"\n{len(schemas)} schemas available:")
for name in sorted(schemas.keys()):
    print(f"  - {name}")
// Download and inspect the OpenAPI spec
const response = await fetch(
  "https://api.altsportsdata.com/public/docs/swagger-json"
);
const spec = await response.json();

// List all endpoints
for (const [path, methods] of Object.entries(spec.paths)) {
  for (const [method, details] of Object.entries(methods)) {
    console.log(`${method.toUpperCase().padEnd(6)} ${path} — ${details.summary || ""}`);
  }
}

// Save locally
const fs = await import("fs");
fs.writeFileSync("openapi.json", JSON.stringify(spec, null, 2));
// Use with openapi-typescript to generate types
// npm install openapi-typescript

import fs from "fs";

const response = await fetch(
  "https://api.altsportsdata.com/public/docs/swagger-json"
);
const spec = await response.json();

// Save the spec
fs.writeFileSync("openapi.json", JSON.stringify(spec, null, 2));

// Generate TypeScript types (CLI)
// npx openapi-typescript openapi.json -o src/api-types.ts
console.log(`Spec: ${spec.info.title} v${spec.info.version}`);
console.log(`Endpoints: ${Object.keys(spec.paths).length}`);
console.log(`Schemas: ${Object.keys(spec.components?.schemas || {}).length}`);
require 'net/http'
require 'json'

uri = URI('https://api.altsportsdata.com/public/docs/swagger-json')
response = Net::HTTP.get(uri)
spec = JSON.parse(response)

# Save locally
File.write('openapi.json', JSON.pretty_generate(spec))

# List endpoints
spec['paths'].sort.each do |path, methods|
  methods.each do |method, details|
    puts "#{method.upcase.ljust(6)} #{path}#{details['summary']}"
  end
end
package main

import (
    "encoding/json"
    "fmt"
    "io"
    "net/http"
    "os"
    "sort"
)

func main() {
    resp, _ := http.Get("https://api.altsportsdata.com/public/docs/swagger-json")
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)

    // Save locally
    os.WriteFile("openapi.json", body, 0644)

    // Parse and list endpoints
    var spec map[string]interface{}
    json.Unmarshal(body, &spec)

    paths := spec["paths"].(map[string]interface{})
    keys := make([]string, 0, len(paths))
    for k := range paths {
        keys = append(keys, k)
    }
    sort.Strings(keys)

    for _, path := range keys {
        methods := paths[path].(map[string]interface{})
        for method, details := range methods {
            d := details.(map[string]interface{})
            fmt.Printf("%-6s %s%s\n", method, path, d["summary"])
        }
    }
}
using System.Text.Json;

var client = new HttpClient();
var json = await client.GetStringAsync(
    "https://api.altsportsdata.com/public/docs/swagger-json"
);

// Save locally
await File.WriteAllTextAsync("openapi.json", json);

// Parse
var spec = JsonSerializer.Deserialize<JsonElement>(json);
var paths = spec.GetProperty("paths");

Console.WriteLine("AltSportsData API Endpoints:");
foreach (var path in paths.EnumerateObject())
{
    foreach (var method in path.Value.EnumerateObject())
    {
        var summary = method.Value.TryGetProperty("summary", out var s)
            ? s.GetString() : "";
        Console.WriteLine($"  {method.Name.ToUpper(),-6} {path.Name}{summary}");
    }
}
import java.net.http.*;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
import org.json.JSONObject;

public class FetchSpec {
    public static void main(String[] args) throws Exception {
        var client = HttpClient.newHttpClient();
        var request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.altsportsdata.com/public/docs/swagger-json"))
            .build();
        var response = client.send(request, HttpResponse.BodyHandlers.ofString());

        // Save locally
        Files.writeString(Path.of("openapi.json"), response.body());

        // Parse and list endpoints
        var spec = new JSONObject(response.body());
        var paths = spec.getJSONObject("paths");
        for (String path : paths.keySet()) {
            var methods = paths.getJSONObject(path);
            for (String method : methods.keySet()) {
                var details = methods.getJSONObject(method);
                System.out.printf("%-6s %s — %s%n",
                    method.toUpperCase(), path,
                    details.optString("summary", ""));
            }
        }
    }
}

Spec Overview

The AltSportsData Public API spec includes:

  • 11 endpoints across Events, Futures, and Sports
  • 52 response schemas with full field descriptions
  • 31 supported sport types (F1, PBR, WSL, Power Slap, DGPT, and more)
  • 16 odds market types (eventWinner, headToHead, podiums, exacta, etc.)

Endpoints Summary

Events

MethodPathDescription
GET/api/v1/public/eventsFetch all events with filtering
GET/api/v1/public/events/{eventId}Fetch single event
GET/api/v1/public/events/{eventId}/participantsFetch event participants
GET/api/v1/public/events/{eventId}/heats/{heatId}Get heat scores / lap times
GET/api/v1/public/events/{eventId}/{oddType}Get event odds by market type
GET/api/v1/public/events/jaialai/{id}Jai Alai event details
GET/api/v1/public/events/jaialai/{id}/oddsJai Alai event odds
POST/api/v1/public/events/{eventId}/sgpCalculate Same Game Parlay

Futures

MethodPathDescription
GET/api/v1/public/futuresFetch all futures
GET/api/v1/public/futures/{sportType}/tour/{tourId}/odds/{futureType}Get futures odds

Sports

MethodPathDescription
GET/api/v1/public/sportsFetch all sports with supported markets

Supported Sport Types

CodeSportCodeSport
f1Formula 1pbrPBR Bull Riding
wslWorld Surf LeaguebkfcBare Knuckle FC
slsStreet League SkateboardingpowerslapPower Slap
nrxNitrocrossdgptDisc Golf Pro Tour
motogpMotoGPnhraNHRA Drag Racing
motocrsMotocrossjaialaiJai Alai
sprmtcrsSuperMotocrossmaslMajor Arena Soccer
mxgpMXGPnllNational Lacrosse League
fdriftFormula DriftgsocGolden Curling
motoamericaMotoAmericabybBYB Extreme Fighting
usacUSAC RacinghlrsHot Laps Racing
worldoutlawsWorld of OutlawsxgameX Games
sprSupercrossathletesunlimitedAthletes Unlimited
cdcCDCluxLUX
rafRAFmlttMLTT
spectationSpectation

Odds Market Types

CodeDescription
eventWinnerOutright event winner
secondPlaceSecond place finish
podiumsPodium finish (top 3)
raceTop5Top 5 finish
raceTop10Top 10 finish
raceTop3Top 3 finish
headToHeadHead-to-head matchup
heatWinnerHeat/round winner
fastestLapFastest lap
overUnderOver/under markets
multiOverUnderMulti over/under
propBetsProposition bets
showsShow bets
dreamTeamDream team
eventExactaExacta (1st + 2nd in order)
heatExactaHeat exacta

Generate Client Libraries

Use the spec to auto-generate typed clients:

# Generate TypeScript types
npx openapi-typescript https://api.altsportsdata.com/public/docs/swagger-json \
  -o src/api-types.ts

# Or generate a full client with openapi-fetch
npm install openapi-fetch
npx openapi-typescript https://api.altsportsdata.com/public/docs/swagger-json \
  -o src/api-types.ts
# Generate Python client
pip install openapi-python-client
openapi-python-client generate \
  --url https://api.altsportsdata.com/public/docs/swagger-json \
  --output-path ./altsportsdata-client
# Generate Go client with oapi-codegen
go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest
oapi-codegen -generate types,client \
  -package altsportsdata \
  https://api.altsportsdata.com/public/docs/swagger-json > client.go
# Generate Java client with OpenAPI Generator
npx @openapitools/openapi-generator-cli generate \
  -i https://api.altsportsdata.com/public/docs/swagger-json \
  -g java \
  -o ./altsportsdata-java-client \
  --additional-properties=library=native

Import Into API Tools

The spec works with all major API development tools:

  • Postman: Import → Link → paste the Swagger JSON URL
  • Insomnia: Design → Import → from URL
  • Swagger UI: Already available at /public/docs/swagger
  • Redocly: npx @redocly/cli preview-docs openapi.json
  • Stoplight Studio: Import from URL

Versioning

The API uses URL-based versioning:

  • Current: /api/v1/public/...
  • Breaking changes will create new version paths (/api/v2/...)
  • Deprecated fields are marked in the spec and via response headers before removal

On this page