Skip to content

Function: meta

Brian Ward edited this page Mar 27, 2025 · 5 revisions

Get available values from StatsAPI for use in other queries, or look up descriptions for values found in API results.

statsapi.meta(type, fields=None)

Limit the fields returned by providing a comma-separated list in the fields parameter. Get the field names from the un-limited response for the same type.

Example

To get a list of leader categories to use when calling the team_leaders function:

statsapi.meta('leagueLeaderTypes')

Known types

  • awards
  • baseballStats
  • eventTypes
  • freeGameTypes
  • gameStatus
  • gameTypes
  • hitTrajectories
  • jobTypes
  • languages
  • leagueLeaderTypes
  • logicalEvents
  • metrics
  • pitchCodes
  • pitchTypes
  • platforms
  • positions
  • reviewReasons
  • rosterTypes
  • runnerDetailTypes
  • scheduleTypes
  • scheduleEventTypes
  • situationCodes
  • sky
  • standingsTypes
  • statGroups
  • statTypes
  • violationTypes
  • windDirection