statshawk
REST APIAnalysis

GET /v1/analysis/compare-teams?a=&b=&as_of= — clubs OR national teams.

cost 10 unitsany plan
GET
/v1/analysis/compare-teams
X-API-Key<token>

Raw API key (sk_live_… or sk_test_…). Preferred for REST clients. Keys are read-only; the environment prefix is the only key role. See https://statshawk.ai/docs/getting-started/permissions

In: header

Query Parameters

a*string

Team A (minted id). Required.

b*string

Team B (minted id). Required.

season?|

Season start year — roster of persons who appeared that season. Cross-year leagues (NBA/NHL/NCAA) use the year the season STARTS in (2025 = the 2025-26 season).

as_of?|

RFC3339 instant — who represented the team in a window ending here.

Formatdate-time
edition?|

Tournament edition id — appearances ∪ edition-overlapping memberships.

days?|

Look-back window in days for the Current/AsOf scopes (clamped [1, 90]).

Formatint32

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/analysis/compare-teams?a=team_0a1b2c3d4e5f6g7h8i9j0k1l2m&b=team_0a1b2c3d4e5f6g7h8i9j0k1l2m"
{
  "data": {
    "a": {
      "roster": [
        {
          "person": {
            "bio": {
              "baseball": null,
              "birth_country": null,
              "display_name": "string",
              "dob": "2019-08-24",
              "full_name": "string",
              "height_inches": null,
              "position": null,
              "weight_lbs": null
            },
            "external_ids": {
              "property1": [
                "string"
              ],
              "property2": [
                "string"
              ]
            },
            "id": "per_0a1b2c3d4e5f6g7h8i9j0k1l2m"
          },
          "source": "appearance"
        }
      ],
      "team": {
        "home_competition": null,
        "id": "team_0a1b2c3d4e5f6g7h8i9j0k1l2m",
        "name": "string",
        "sport": "basketball",
        "traits": [
          {
            "country": "BRA",
            "kind": "represents_country"
          }
        ]
      }
    },
    "b": {
      "roster": [
        {
          "person": {
            "bio": {
              "baseball": null,
              "birth_country": null,
              "display_name": "string",
              "dob": "2019-08-24",
              "full_name": "string",
              "height_inches": null,
              "position": null,
              "weight_lbs": null
            },
            "external_ids": {
              "property1": [
                "string"
              ],
              "property2": [
                "string"
              ]
            },
            "id": "per_0a1b2c3d4e5f6g7h8i9j0k1l2m"
          },
          "source": "appearance"
        }
      ],
      "team": {
        "home_competition": null,
        "id": "team_0a1b2c3d4e5f6g7h8i9j0k1l2m",
        "name": "string",
        "sport": "basketball",
        "traits": [
          {
            "country": "BRA",
            "kind": "represents_country"
          }
        ]
      }
    }
  },
  "meta": {
    "cache": "HIT",
    "fetched_at": "2025-10-15T18:30:00Z",
    "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
    "source": "postgres",
    "version": "v1"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "property1": null,
    "property2": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "property1": null,
    "property2": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "property1": null,
    "property2": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "property1": null,
    "property2": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "property1": null,
    "property2": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "property1": null,
    "property2": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "property1": null,
    "property2": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "property1": null,
    "property2": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "property1": null,
    "property2": null
  }
}