Versions in this module Expand all Collapse all v1 v1.2.1 Aug 16, 2026 Changes in this version type PackageKind + const PackageArchive v1.2.0 Aug 7, 2026 Changes in this version + const MaxPriceTicks + var ErrWebhookLimit = errors.New("livetennisapi: webhook limit reached") type Client + func (c *Client) CreateWebhook(ctx context.Context, params WebhookParams) (*Webhook, error) + func (c *Client) DeleteWebhook(ctx context.Context, webhookID int64) error + func (c *Client) DownloadHistoryPackage(ctx context.Context, period string, kind PackageKind, format string) (io.ReadCloser, error) + func (c *Client) GetHistoryPackage(ctx context.Context, period string, kind PackageKind) (*HistoryPackage, error) + func (c *Client) GetTournament(ctx context.Context, tournamentID string) (*Tournament, error) + func (c *Client) GetUsage(ctx context.Context) (*Usage, error) + func (c *Client) ListMatchPrices(ctx context.Context, matchID int64, params MatchPricesParams) (*MatchPrices, error) + func (c *Client) ListTournaments(ctx context.Context, params TournamentsParams) (*Page[Tournament], error) + func (c *Client) ListWebhooks(ctx context.Context) (*Page[Webhook], error) + type MatchPrices struct + Data []Price + Meta MatchPricesMeta + type MatchPricesMeta struct + Count int + HasMore bool + Limit int + MatchID int64 + Minutes *int + type MatchPricesParams struct + Limit int + Minutes int type Price + PriceSource string + Synthetic *bool + type Tournament struct + Category string + City string + Country string + ID string + Indoor bool + Name string + Surface string + Tour Tour + type TournamentsParams struct + Search string + Tour Tour + type Usage struct + AsOf Time + BaseTier string + Channel string + History []UsageDay + Limits struct{ ... } + Principal string + Tier string + TierExpiresAt Time + Today struct{ ... } + type UsageDay struct + Calls int + Day Time + Errors int + type Webhook struct + ConsecutiveFailures int + CreatedAt Time + Enabled bool + Events []WebhookEvent + ID int64 + LastDeliveryAt Time + LastError string + Secret string + SecretNote string + URL string + type WebhookEvent string + const WebhookBreakPoint + const WebhookScore + type WebhookParams struct + Events []WebhookEvent + URL string v1.1.0 Aug 7, 2026 Changes in this version type APIError + Candidates []string + Detail string + LimitPerDay *int + ResetsAt time.Time + RetryAt time.Time + Scope string + type ArchiveCareer struct + ByYear []ArchiveYearRecord + Player struct{ ... } + Record ArchiveCareerRecord + Serve ArchiveCareerServe + Span struct{ ... } + type ArchiveCareerRecord struct + ByLevel map[string]WinLoss + BySurface map[string]WinLoss + Losses int + Titles int + Wins int + type ArchiveCareerServe struct + Aces int + AcesPerMatch *float64 + BPFaced int + BPSaved int + BPSavedPct *float64 + DoubleFaults int + FirstIn int + FirstInPct *float64 + FirstWon int + FirstWonPct *float64 + MatchesWithStats int + SecondWon int + SecondWonPct *float64 + ServeGames int + ServePoints int + type ArchiveMatch struct + BestOf *int + DrawSize *int + EventDate Time + ID int64 + Level string + Loser *ArchivePlayer + Minutes *int + Outcome string + Round string + Score string + SourceID string + Stats *ArchiveMatchStats + Surface string + Tour string + Tournament string + Winner *ArchivePlayer + type ArchiveMatchStats struct + Loser *ArchiveServeStats + Winner *ArchiveServeStats + type ArchiveMatchesParams struct + From string + Level string + Name string + Round string + To string + Tour Tour + type ArchivePlayer struct + Age *float64 + Country string + Entry string + Hand string + HeightCm *int + Name string + PlayerID *int64 + Rank *int + Seed *int + type ArchivePlayerBio struct + CareerHighDate Time + CareerHighRank *int + Country string + DOB Time + Hand string + HeightCm *int + ID int64 + Name string + Tour string + type ArchivePlayersParams struct + Name string + Tour Tour + type ArchiveServeStats struct + Aces *int + BPFaced *int + BPSaved *int + DoubleFaults *int + FirstIn *int + FirstWon *int + SecondWon *int + ServeGames *int + ServePoints *int + type ArchiveYearRecord struct + Losses int + Wins int + Year int + type ChartingMatch struct + ChartingMatchID int64 + Families json.RawMessage + Gender string + MCPID string + Players json.RawMessage + type ChartingPlayer struct + Coverage string + Families json.RawMessage + MatchesCharted int + Player json.RawMessage + type ChartingPlayerParams struct + Gender string + Name string type Client + func (c *Client) GetArchiveCareer(ctx context.Context, name string) (*ArchiveCareer, error) + func (c *Client) GetArchiveMatch(ctx context.Context, archiveID int64) (*ArchiveMatch, error) + func (c *Client) GetChartingMatch(ctx context.Context, chartingMatchID int64) (*ChartingMatch, error) + func (c *Client) GetChartingPlayer(ctx context.Context, params ChartingPlayerParams) (*ChartingPlayer, error) + func (c *Client) GetHeadToHead(ctx context.Context, p1, p2 string) (*HeadToHead, error) + func (c *Client) GetMatchRally(ctx context.Context, matchID int64, params ListParams) (*RallyMatchDetail, error) + func (c *Client) GetMatchStatistics(ctx context.Context, matchID int64) (*MatchStatistics, error) + func (c *Client) GetMatchTape(ctx context.Context, matchID int64, params TapeParams) (*MatchTape, error) + func (c *Client) GetRallyMatch(ctx context.Context, rallyMatchID int64, params ListParams) (*RallyMatchDetail, error) + func (c *Client) GetWSToken(ctx context.Context) (*WSToken, error) + func (c *Client) ListArchiveMatches(ctx context.Context, params ArchiveMatchesParams) (*Page[ArchiveMatch], error) + func (c *Client) ListArchivePlayers(ctx context.Context, params ArchivePlayersParams) (*Page[ArchivePlayerBio], error) + func (c *Client) ListHistoryMatches(ctx context.Context, params HistoryMatchesParams) (*Page[Match], error) + func (c *Client) ListHistoryPackages(ctx context.Context, params HistoryPackagesParams) (*HistoryPackagesPage, error) + func (c *Client) ListRallyMatches(ctx context.Context, params RallyMatchesParams) (*Page[RallyMatch], error) + func (c *Client) ListRankings(ctx context.Context, params RankingsParams) (*RankingsPage, error) + type Coverage string + const CoverageFromStart + const CoverageNone + const CoveragePartial + const CoverageReconstructed + const CoverageReconstructedPartial type Fixture + Player1ID *int64 + Player2ID *int64 + RoundCode string + StartTime Time + type H2HMeeting struct + ArchiveMatchID *int64 + Date Time + Era string + Level string + MatchID *int64 + Outcome string + Round string + RoundCode string + Score string + Surface string + Tournament string + Winner *int + type H2HSurfaceSplit struct + P1 int + P2 int + type H2HTotals struct + Meetings int + P1Wins int + P2Wins int + Undecided int + type HeadToHead struct + BySurface map[string]H2HSurfaceSplit + Meetings []H2HMeeting + Players ... + Stats json.RawMessage + Totals H2HTotals + type HistoryMatchesParams struct + Country string + Coverage Coverage + From string + Player []int64 + To string + Tour Tour + type HistoryPackage struct + BuiltAt Time + Files []PackageFile + Kind PackageKind + MatchCount *int + Period string + RowCount *int + Status string + type HistoryPackagesPage struct + Data []HistoryPackage + Meta struct{ ... } + type HistoryPackagesParams struct + Kind PackageKind + Year string type ListMatchesParams + Country string + From string + Player []int64 + To string type ListMeta + HasMore *bool + Total *int type Match + RoundCode string + Tape *TapeInfo + Tour Tour + TournamentID string + Withdrew *int + type MatchStatistics struct + AgeSeconds *int + AsOf Time + Coverage string + Detail string + Freshness StatisticsFreshness + GamesCounted int + InconsistentGamesExcluded int + MatchID int64 + Players ... + SetsCovered []int + TiebreakGamesExcluded int + type MatchTape struct + Match Match + Meta TapeMeta + Profiles []Profile + Tape []TapeRow + Tiebreaks []*SetTiebreak + type MeasuredDivergence struct + DeltaGames int + Detail string + GamesInScore int + GamesInStatistics int + Reason string + type PackageFile struct + Bytes int64 + Filename string + Format string + SHA256 string + type PackageKind string + const PackageRally + const PackageRankings + const PackageTape + type RallyMatch struct + BestOf *int + Date Time + Gender string + MatchID *int64 + Players []RallyPlayerRef + Points int + PointsParsed int + RallyMatchID int64 + Round string + SourceID string + Surface string + Tournament string + type RallyMatchDetail struct + Meta ListMeta + Rally []RallyPoint + type RallyMatchesParams struct + From string + Gender string + Player string + Surface string + To string + type RallyPlayerRef struct + Hand string + Name string + type RallyPoint struct + EndingStroke string + EndingWing string + ErrorLocation string + Game *int + Games []*int + IsAce bool + IsDoubleFault bool + IsServeAndVolley bool + IsTiebreak bool + Outcome string + Parsed bool + Point int + PointWinner *int + RallyLength *int + Raw string + Score string + ServeDirection string + ServeNumber *int + Server *int + Set []*int + Shots []RallyShot + type RallyShot struct + Code string + Depth string + Direction string + Number int + Position string + Stroke string + Wing string + type RankingRecord struct + EffectiveDate Time + ObservedAt Time + PlayerID *int64 + PlayerName string + Points *int + PreviousRank *int + Rank *int + RankMovement *int + Rating *float64 + System RankingSystem + Tour string + type RankingSystem string + const RankingATP + const RankingITFJuniors + const RankingITFMen + const RankingITFWomen + const RankingUTR + const RankingWTA + type RankingsCoverage struct + AsOf Time + OldestAvailable map[string]Time + PlayersRequested int + PlayersResolved int + SystemsRequested []string + SystemsResolved []string + type RankingsMeta struct + Coverage RankingsCoverage + type RankingsPage struct + Data []RankingRecord + Meta RankingsMeta + func (p *RankingsPage) Len() int + type RankingsParams struct + AsOf string + Player []int64 + System []RankingSystem + type Sequence string + const SequenceClean + const SequenceRaw + type SetTiebreak struct + P1 int + P2 int + type StatisticsDescribes struct + GamesP1 []int + GamesP2 []int + TotalGames int + type StatisticsFamily struct + AgeSeconds *int + AsOf Time + Coverage string + Describes *StatisticsDescribes + type StatisticsFreshness struct + Derived *StatisticsFamily + Measured *StatisticsFamily + MeasuredDivergence *MeasuredDivergence + type StatisticsSide struct + BreakPct *int + BreakPointsConverted int + BreakPointsConvertedPct *int + BreakPointsFaced int + BreakPointsPlayed int + BreakPointsSaved int + BreakPointsSavedPct *int + HoldPct *int + Measured map[string]int + PointsPlayed int + PointsWon int + ReturnGamesPlayed int + ReturnGamesWon int + ReturnPointsPlayed int + ReturnPointsWon int + ReturnPointsWonPct *int + ServiceGamesPlayed int + ServiceGamesWon int + ServicePointsPlayed int + ServicePointsWon int + ServicePointsWonPct *int + type TapeInfo struct + Coverage Coverage + ReconstructedRows int + Rows int + type TapeMeta struct + Coverage Coverage + FromArchive bool + GeneratedAt Time + MatchID int64 + PointSource string + RawRows int + Rows int + Sequence Sequence + UniqueStates int + type TapeParams struct + Sequence Sequence + type TapeRow struct + PointWinner *int + type WSChannels struct + Match string + Slate string + type WSToken struct + Channels WSChannels + ExpiresIn int + Token string + WSURL string + type WinLoss struct + Losses int + Wins int v1.0.0 Jul 24, 2026 Changes in this version + const DefaultBaseURL + const DefaultMaxRetries + const DefaultTimeout + const MaxLimit + const Version + var ErrAPI = errors.New("livetennisapi: request failed") + var ErrBadRequest = errors.New("livetennisapi: bad request") + var ErrConnection = errors.New("livetennisapi: connection failed") + var ErrNotFound = errors.New("livetennisapi: not found") + var ErrRateLimited = errors.New("livetennisapi: rate limited") + var ErrServerError = errors.New("livetennisapi: server error") + var ErrServiceUnavailable = errors.New("livetennisapi: service unavailable") + var ErrTimeout = errors.New("livetennisapi: request timed out") + var ErrUnauthorized = errors.New("livetennisapi: unauthorized") + var ErrUpgradeRequired = errors.New("livetennisapi: upgrade required") + func Paginate[T any](ctx context.Context, fetch func(context.Context, ListParams) (*Page[T], error), ...) iter.Seq2[T, error] + type APIError struct + AllowedValues []string + Body []byte + Code string + Header http.Header + Message string + RateLimit RateLimit + RequiredTier Tier + StatusCode int + URL string + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + type Analysis struct + Profile *Profile + Thesis *Thesis + type AuthMethod int + const AuthAPIKey + const AuthBearer + type Client struct + func New(apiKey string, opts ...Option) *Client + func (c *Client) GetMarketPrices(ctx context.Context, matchID int64, params ListParams) (*Market, error) + func (c *Client) GetMatch(ctx context.Context, matchID int64) (*Match, error) + func (c *Client) GetMatchAnalysis(ctx context.Context, matchID int64) (*Analysis, error) + func (c *Client) GetMatchScore(ctx context.Context, matchID int64) (*Score, error) + func (c *Client) GetPlayer(ctx context.Context, playerID int64) (*Player, error) + func (c *Client) Health(ctx context.Context) (*Health, error) + func (c *Client) ListCompletedMatches(ctx context.Context, params ListParams) (*Page[Match], error) + func (c *Client) ListFixtures(ctx context.Context, params ListFixturesParams) (*Page[Fixture], error) + func (c *Client) ListMarkets(ctx context.Context, matchID int64) (*Page[Market], error) + func (c *Client) ListMatchEvents(ctx context.Context, matchID int64, params ListParams) (*Page[Event], error) + func (c *Client) ListMatches(ctx context.Context, params ListMatchesParams) (*Page[Match], error) + func (c *Client) SearchPlayers(ctx context.Context, params SearchPlayersParams) (*Page[Player], error) + type ConnectionError struct + Err error + Timeout bool + URL string + func (e *ConnectionError) Error() string + func (e *ConnectionError) Is(target error) bool + func (e *ConnectionError) Unwrap() error + type DataCompleteness struct + Known *int + Missing []string + Note string + Of *int + func (d *DataCompleteness) Applicable() bool + func (d *DataCompleteness) Complete() bool + type Event struct + Player *int + Timestamp Time + Type EventType + type EventType string + const EventBreak + const EventGameWon + const EventMomentumRun + const EventSetWon + type Fixture struct + EventDate Time + ID int64 + Player1Name string + Player2Name string + Round string + Status string + Surface string + Tour string + Tournament string + type Health struct + Status string + Version string + type ListFixturesParams struct + Tour Tour + type ListMatchesParams struct + Status MatchStatus + Tour Tour + type ListMeta struct + Count int + Limit int + MatchID int64 + Offset int + type ListParams struct + Limit int + Offset int + type Market struct + EndDate Time + ID int64 + Liquidity *float64 + Prices []Price + Question string + Status string + Volume *float64 + type Match struct + Analysis *Analysis + EventStatus string + Format string + ID int64 + Indoor bool + IsDoubles bool + Market *Market + Players Players + Round string + ScheduledTime Time + Score *Score + Status MatchStatus + Surface string + Tournament string + Winner *int + type MatchStatus string + const StatusCancelled + const StatusCompleted + const StatusLive + const StatusUpcoming + type Option func(*Client) + func WithAuthMethod(m AuthMethod) Option + func WithBaseURL(baseURL string) Option + func WithHTTPClient(hc *http.Client) Option + func WithMaxRetries(n int) Option + func WithRateLimitObserver(fn func(RateLimit)) Option + func WithUserAgent(ua string) Option + type Page struct + Data []T + Meta ListMeta + func (p *Page[T]) Len() int + type Player struct + Backhand *int + Birthday Time + Country string + DataCompleteness *DataCompleteness + Hand string + ID int64 + IsDoublesTeam bool + Name string + Ranking *int + RankingMovement string + RankingPoints *int + Stats *PlayerStats + Tour string + type PlayerStats struct + Ratings json.RawMessage + Season json.RawMessage + type Players struct + P1 *Player + P2 *Player + type Price struct + Ask *float64 + Bid *float64 + Mid *float64 + Side *int + Spread *float64 + Timestamp Time + type Profile struct + CreatedAt Time + ExpectedCloseness *float64 + KeyFactors []string + VolatilityRating string + WinProbabilityP1 *float64 + type RateLimit struct + Limit *int + Remaining *int + Reset time.Time + RetryAfter *time.Duration + func (r RateLimit) Known() bool + func (r RateLimit) LimitOr(def int) int + func (r RateLimit) RemainingOr(def int) int + func (r RateLimit) RetryAfterOr(def time.Duration) time.Duration + type Score struct + Danger *float64 + Games [][]int + IsTiebreak bool + Points []string + Server *int + Sets []int + Timestamp Time + WinProbabilityP1 *float64 + func (s *Score) GamesForSet(setIndex int) (p1, p2 int, ok bool) + func (s *Score) NumSets() int + func (s *Score) String() string + type SearchPlayersParams struct + Search string + type Thesis struct + Confidence *float64 + CreatedAt Time + Notes ThesisNotes + PickSide *int + Reasoning string + ScenarioPlaybook json.RawMessage + State string + WinProbabilityPick *float64 + type ThesisNotes struct + Environment string + Fatigue string + Matchup string + type Tier string + const TierBasic + const TierFree + const TierPro + const TierUltra + type Time struct + Raw string + func (t *Time) UnmarshalJSON(data []byte) error + func (t Time) IsZero() bool + func (t Time) MarshalJSON() ([]byte, error) + func (t Time) String() string + type Tour string + const TourATP + const TourChallenger + const TourITF + const TourJuniors + const TourWTA