STAT-API

Client SDKs

Official stat-api client libraries in five languages. Each one wraps the same REST surface with a typed, zero-config client: read your key from STAT_API_KEY, call client.<league>.<table>.list(…), and page through results with a built-in auto-paging iterator. Same key, same data, same metering as the REST, GraphQL, and MCP APIs.

All libraries version in lockstep (currently v0.1.0). Source lives under github.com/stat-api.

TypeScript

@stat-api/client
npm install @stat-api/client
Quickstart
// Hello, NBA
// Generated from schema/api/examples/hello-stat-api.yml — do not edit.

import { StatApi } from '@stat-api/client'

const api = new StatApi() // reads STAT_API_KEY from the environment

// List a few teams
const teams = (await api.nba.teams.list({ limit: 3 })).teams

// Print what came back
console.log(JSON.stringify(teams, null, 2))

Python

statapi
pip install statapi
Quickstart
# Hello, NBA
# Generated from schema/api/examples/hello-stat-api.yml — do not edit.
from statapi import StatApi
import json

api = StatApi()  # reads STAT_API_KEY from the environment

# List a few teams
teams = api.nba.teams.list(limit=3).rows

# Print what came back
print(json.dumps(teams, indent=2, default=str))

Go

github.com/stat-api/stat-api/go
go get github.com/stat-api/stat-api/go@latest
Quickstart
// Hello, NBA
// Generated from schema/api/examples/hello-stat-api.yml — do not edit.
package main

import (
	"context"
	"encoding/json"
	"fmt"
	statapi "github.com/stat-api/stat-api/go"
	"log"
)

func main() {
	client, err := statapi.New()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	// List a few teams
	teamsPage, err := client.NBA.Teams.List(ctx, &statapi.NBATeamsListParams{Limit: statapi.Int(3)})
	if err != nil {
		log.Fatal(err)
	}
	teams := teamsPage.Rows

	// Print what came back
	teamsJSON, err := json.MarshalIndent(teams, "", "  ")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(string(teamsJSON))

}

Java

com.statapi
git clone https://github.com/stat-api/stat-api
Quickstart
// Hello, NBA
// Generated from schema/api/examples/hello-stat-api.yml — do not edit.
package com.statapi.cookbook;

import com.statapi.StatApi;
import com.statapi.nba.*;
import java.util.*;

public final class NbaHelloStatApi {
    public static void main(String[] args) {
        StatApi api = new StatApi(); // reads STAT_API_KEY from the environment

        // List a few teams
        List<NBATeam> teams = api.nba().teams().list(new NBATeamsListParams().limit(3L)).rows();

        // Print what came back
        System.out.println(teams);

    }
}
Java guide →GitHubMaven Central (coming soon)

C#

StatApi
git clone https://github.com/stat-api/stat-api
Quickstart
// Hello, NBA
// Generated from schema/api/examples/hello-stat-api.yml — do not edit.
using StatApi;
using System.Text.Json;

var client = new StatApiClient(); // reads STAT_API_KEY from the environment

// List a few teams
var teams = (await client.Nba.Teams.ListAsync(new NbaTeamsListParams { Limit = 3 })).Rows;

// Print what came back
Console.WriteLine(JsonSerializer.Serialize(teams, new JsonSerializerOptions { WriteIndented = true }));
C# guide →GitHubNuGet (coming soon)

Prefer no install?

Every endpoint in the API reference shows a raw curl tab alongside the SDK calls, and the MCP server lets an agent query the whole catalog with no client at all.