Skip to content

Fantasy

griddy / nfl / endpoints / pro / stats / fantasy**

fantasy

Classes

Fantasy

Fantasy(
    sdk_config: SDKConfiguration,
    parent_ref: Optional[object],
)

Bases: ProSDK


              flowchart TD
              griddy.nfl.endpoints.pro.stats.fantasy.Fantasy[Fantasy]
              griddy.nfl.endpoints.pro.ProSDK[ProSDK]
              griddy.nfl.basesdk.BaseSDK[BaseSDK]

                              griddy.nfl.endpoints.pro.ProSDK --> griddy.nfl.endpoints.pro.stats.fantasy.Fantasy
                                griddy.nfl.basesdk.BaseSDK --> griddy.nfl.endpoints.pro.ProSDK
                



              click griddy.nfl.endpoints.pro.stats.fantasy.Fantasy href "" "griddy.nfl.endpoints.pro.stats.fantasy.Fantasy"
              click griddy.nfl.endpoints.pro.ProSDK href "" "griddy.nfl.endpoints.pro.ProSDK"
              click griddy.nfl.basesdk.BaseSDK href "" "griddy.nfl.basesdk.BaseSDK"
            

Fantasy football player statistics and scoring metrics

Source code in griddy/nfl/endpoints/pro/__init__.py
def __init__(self, sdk_config: SDKConfiguration, parent_ref: Optional[object]):
    super().__init__(sdk_config=sdk_config, parent_ref=parent_ref)
    self.sdk_configuration.server_type = "pro"
Functions
get_stats_by_season
get_stats_by_season(
    *,
    season: int,
    season_type: SeasonTypeEnum,
    limit: Optional[int] = 35,
    offset: Optional[int] = 0,
    page: Optional[int] = 1,
    sort_key: Optional[
        GetFantasyStatsBySeasonSortKey
    ] = "fpStd",
    sort_value: Optional[SortOrderEnum] = None,
    position_group: Optional[
        List[GetFantasyStatsBySeasonPositionGroup]
    ] = None,
    team_offense: Optional[str] = None,
    team_defense: Optional[str] = None,
    min_offensive_snaps: Optional[int] = 0,
    last_n_weeks: Optional[int] = None,
    retries: OptionalNullable[RetryConfig] = UNSET,
    server_url: Optional[str] = None,
    timeout_ms: Optional[int] = None,
    http_headers: Optional[Mapping[str, str]] = None
) -> FantasyStatsResponse

Get Fantasy Football Statistics by Season

Retrieves comprehensive fantasy football statistics for NFL players during a specified season. Returns fantasy-relevant metrics including standard scoring, PPR scoring, snap counts, and target share data. Supports filtering by position groups (QB, RB, WR, TE, SPEC), teams, minimum offensive snap thresholds, and rolling N-week windows for recent performance analysis. Data includes traditional fantasy categories and advanced metrics for lineup optimization.

:param season: Season year :param season_type: Type of season :param limit: Maximum number of players to return :param offset: Number of records to skip for pagination :param page: Page number for pagination :param sort_key: Field to sort by :param sort_value: Sort direction :param position_group: Filter by position groups (supports multiple positions) :param team_offense: Filter by specific offensive team ID :param team_defense: Filter by specific defensive team ID (opponent analysis) :param min_offensive_snaps: Minimum offensive snaps threshold for inclusion :param last_n_weeks: Number of recent weeks to analyze (rolling window) :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests.

Source code in griddy/nfl/endpoints/pro/stats/fantasy.py
def get_stats_by_season(
    self,
    *,
    season: int,
    season_type: models.SeasonTypeEnum,
    limit: Optional[int] = 35,
    offset: Optional[int] = 0,
    page: Optional[int] = 1,
    sort_key: Optional[models.GetFantasyStatsBySeasonSortKey] = "fpStd",
    sort_value: Optional[models.SortOrderEnum] = None,
    position_group: Optional[
        List[models.GetFantasyStatsBySeasonPositionGroup]
    ] = None,
    team_offense: Optional[str] = None,
    team_defense: Optional[str] = None,
    min_offensive_snaps: Optional[int] = 0,
    last_n_weeks: Optional[int] = None,
    retries: OptionalNullable[utils.RetryConfig] = UNSET,
    server_url: Optional[str] = None,
    timeout_ms: Optional[int] = None,
    http_headers: Optional[Mapping[str, str]] = None,
) -> models.FantasyStatsResponse:
    r"""Get Fantasy Football Statistics by Season

    Retrieves comprehensive fantasy football statistics for NFL players during a specified season.
    Returns fantasy-relevant metrics including standard scoring, PPR scoring, snap counts, and
    target share data. Supports filtering by position groups (QB, RB, WR, TE, SPEC), teams,
    minimum offensive snap thresholds, and rolling N-week windows for recent performance analysis.
    Data includes traditional fantasy categories and advanced metrics for lineup optimization.


    :param season: Season year
    :param season_type: Type of season
    :param limit: Maximum number of players to return
    :param offset: Number of records to skip for pagination
    :param page: Page number for pagination
    :param sort_key: Field to sort by
    :param sort_value: Sort direction
    :param position_group: Filter by position groups (supports multiple positions)
    :param team_offense: Filter by specific offensive team ID
    :param team_defense: Filter by specific defensive team ID (opponent analysis)
    :param min_offensive_snaps: Minimum offensive snaps threshold for inclusion
    :param last_n_weeks: Number of recent weeks to analyze (rolling window)
    :param retries: Override the default retry configuration for this method
    :param server_url: Override the default server URL for this method
    :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
    :param http_headers: Additional headers to set or replace on requests.
    """
    config = self._get_stats_by_season_config(
        season=season,
        season_type=season_type,
        limit=limit,
        offset=offset,
        page=page,
        sort_key=sort_key,
        sort_value=sort_value,
        position_group=position_group,
        team_offense=team_offense,
        team_defense=team_defense,
        min_offensive_snaps=min_offensive_snaps,
        last_n_weeks=last_n_weeks,
        retries=retries,
        server_url=server_url,
        timeout_ms=timeout_ms,
        http_headers=http_headers,
    )
    return self._execute_endpoint(config)
get_stats_by_season_async async
get_stats_by_season_async(
    *,
    season: int,
    season_type: SeasonTypeEnum,
    limit: Optional[int] = 35,
    offset: Optional[int] = 0,
    page: Optional[int] = 1,
    sort_key: Optional[
        GetFantasyStatsBySeasonSortKey
    ] = "fpStd",
    sort_value: Optional[SortOrderEnum] = None,
    position_group: Optional[
        List[GetFantasyStatsBySeasonPositionGroup]
    ] = None,
    team_offense: Optional[str] = None,
    team_defense: Optional[str] = None,
    min_offensive_snaps: Optional[int] = 0,
    last_n_weeks: Optional[int] = None,
    retries: OptionalNullable[RetryConfig] = UNSET,
    server_url: Optional[str] = None,
    timeout_ms: Optional[int] = None,
    http_headers: Optional[Mapping[str, str]] = None
) -> FantasyStatsResponse

Get Fantasy Football Statistics by Season

Retrieves comprehensive fantasy football statistics for NFL players during a specified season. Returns fantasy-relevant metrics including standard scoring, PPR scoring, snap counts, and target share data. Supports filtering by position groups (QB, RB, WR, TE, SPEC), teams, minimum offensive snap thresholds, and rolling N-week windows for recent performance analysis. Data includes traditional fantasy categories and advanced metrics for lineup optimization.

:param season: Season year :param season_type: Type of season :param limit: Maximum number of players to return :param offset: Number of records to skip for pagination :param page: Page number for pagination :param sort_key: Field to sort by :param sort_value: Sort direction :param position_group: Filter by position groups (supports multiple positions) :param team_offense: Filter by specific offensive team ID :param team_defense: Filter by specific defensive team ID (opponent analysis) :param min_offensive_snaps: Minimum offensive snaps threshold for inclusion :param last_n_weeks: Number of recent weeks to analyze (rolling window) :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests.

Source code in griddy/nfl/endpoints/pro/stats/fantasy.py
async def get_stats_by_season_async(
    self,
    *,
    season: int,
    season_type: models.SeasonTypeEnum,
    limit: Optional[int] = 35,
    offset: Optional[int] = 0,
    page: Optional[int] = 1,
    sort_key: Optional[models.GetFantasyStatsBySeasonSortKey] = "fpStd",
    sort_value: Optional[models.SortOrderEnum] = None,
    position_group: Optional[
        List[models.GetFantasyStatsBySeasonPositionGroup]
    ] = None,
    team_offense: Optional[str] = None,
    team_defense: Optional[str] = None,
    min_offensive_snaps: Optional[int] = 0,
    last_n_weeks: Optional[int] = None,
    retries: OptionalNullable[utils.RetryConfig] = UNSET,
    server_url: Optional[str] = None,
    timeout_ms: Optional[int] = None,
    http_headers: Optional[Mapping[str, str]] = None,
) -> models.FantasyStatsResponse:
    r"""Get Fantasy Football Statistics by Season

    Retrieves comprehensive fantasy football statistics for NFL players during a specified season.
    Returns fantasy-relevant metrics including standard scoring, PPR scoring, snap counts, and
    target share data. Supports filtering by position groups (QB, RB, WR, TE, SPEC), teams,
    minimum offensive snap thresholds, and rolling N-week windows for recent performance analysis.
    Data includes traditional fantasy categories and advanced metrics for lineup optimization.


    :param season: Season year
    :param season_type: Type of season
    :param limit: Maximum number of players to return
    :param offset: Number of records to skip for pagination
    :param page: Page number for pagination
    :param sort_key: Field to sort by
    :param sort_value: Sort direction
    :param position_group: Filter by position groups (supports multiple positions)
    :param team_offense: Filter by specific offensive team ID
    :param team_defense: Filter by specific defensive team ID (opponent analysis)
    :param min_offensive_snaps: Minimum offensive snaps threshold for inclusion
    :param last_n_weeks: Number of recent weeks to analyze (rolling window)
    :param retries: Override the default retry configuration for this method
    :param server_url: Override the default server URL for this method
    :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
    :param http_headers: Additional headers to set or replace on requests.
    """
    config = self._get_stats_by_season_config(
        season=season,
        season_type=season_type,
        limit=limit,
        offset=offset,
        page=page,
        sort_key=sort_key,
        sort_value=sort_value,
        position_group=position_group,
        team_offense=team_offense,
        team_defense=team_defense,
        min_offensive_snaps=min_offensive_snaps,
        last_n_weeks=last_n_weeks,
        retries=retries,
        server_url=server_url,
        timeout_ms=timeout_ms,
        http_headers=http_headers,
    )
    return await self._execute_endpoint_async(config)