View Source PropOddsAPI.Api.Games (PropOddsApi v0.0.2)

This module provides functionality to interact with game data from the PropOdds API.

Summary

Functions

Retrieves information for a specific game by its ID.

Fetches games information for a specific league and date.

Functions

Link to this function

get_game(connection, game_id, api_key, opts \\ [])

View Source

Retrieves information for a specific game by its ID.

Parameters

  • connection: The Tesla.Env.client() used to make the HTTP request.
  • game_id: The unique identifier for the game, as a String.t().
  • api_key: The API key used for authorization, as a String.t().
  • opts: Optional parameters provided as a keyword list (currently unused).

Returns

  • {:ok, PropOddsAPI.Model.GameInfo.t()}: On success, returns the game information.
  • {:ok, PropOddsAPI.Model.HttpValidationError.t()}: If there's a validation error with the HTTP request.
  • {:error, Tesla.Env.t()}: On failure, returns the error within the Tesla environment.
Link to this function

get_games(connection, league, api_key, date, opts \\ [])

View Source

Fetches games information for a specific league and date.

Parameters

  • connection: The Tesla.Env.client() used to make the HTTP request.
  • league: The league identifier, as a String.t().
  • api_key: The API key used for authorization, as a String.t().
  • date: The date for which games information is requested, as a Date.t().
  • opts: Optional parameters provided as a keyword list, which may include timezone (:tz).

Returns

  • {:ok, PropOddsAPI.Model.GamesInfo.t()}: On success, returns the games information.
  • {:ok, PropOddsAPI.Model.HttpValidationError.t()}: If there's a validation error with the HTTP request.
  • {:error, Tesla.Env.t()}: On failure, returns the error within the Tesla environment.