Documentation
¶
Overview ¶
Package sofascore is Crawlora's SofaScore API client for 109 endpoints, covering live events, match details, lineups, statistics, tournaments, and player/team data. API documentation: https://crawlora.net/docs?utm_source=pkg.go.dev&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-go-api-docs
Index ¶
- Constants
- func OperationIDs() []string
- type Client
- func (c *Client) Call(ctx context.Context, operationID string, params Params) (any, error)
- func (c *Client) Categories(ctx context.Context, params Params) (any, error)
- func (c *Client) CategoryTournaments(ctx context.Context, params Params) (any, error)
- func (c *Client) Close() error
- func (c *Client) Draft(ctx context.Context, params Params) (any, error)
- func (c *Client) DraftPicks(ctx context.Context, params Params) (any, error)
- func (c *Client) EsportsGame(ctx context.Context, params Params) (any, error)
- func (c *Client) Event(ctx context.Context, params Params) (any, error)
- func (c *Client) EventAtBatPitches(ctx context.Context, params Params) (any, error)
- func (c *Client) EventAtBats(ctx context.Context, params Params) (any, error)
- func (c *Client) EventAveragePositions(ctx context.Context, params Params) (any, error)
- func (c *Client) EventBaseballTopPerformers(ctx context.Context, params Params) (any, error)
- func (c *Client) EventBestPlayers(ctx context.Context, params Params) (any, error)
- func (c *Client) EventComments(ctx context.Context, params Params) (any, error)
- func (c *Client) EventEsportsGames(ctx context.Context, params Params) (any, error)
- func (c *Client) EventGraph(ctx context.Context, params Params) (any, error)
- func (c *Client) EventH2h(ctx context.Context, params Params) (any, error)
- func (c *Client) EventHighlights(ctx context.Context, params Params) (any, error)
- func (c *Client) EventIncidents(ctx context.Context, params Params) (any, error)
- func (c *Client) EventInnings(ctx context.Context, params Params) (any, error)
- func (c *Client) EventLineups(ctx context.Context, params Params) (any, error)
- func (c *Client) EventManagers(ctx context.Context, params Params) (any, error)
- func (c *Client) EventOdds(ctx context.Context, params Params) (any, error)
- func (c *Client) EventPlayerHeatmap(ctx context.Context, params Params) (any, error)
- func (c *Client) EventPlayerStatistics(ctx context.Context, params Params) (any, error)
- func (c *Client) EventPointByPoint(ctx context.Context, params Params) (any, error)
- func (c *Client) EventPregameForm(ctx context.Context, params Params) (any, error)
- func (c *Client) EventShotmap(ctx context.Context, params Params) (any, error)
- func (c *Client) EventStatistics(ctx context.Context, params Params) (any, error)
- func (c *Client) EventTeamHeatmap(ctx context.Context, params Params) (any, error)
- func (c *Client) EventTeamStreaks(ctx context.Context, params Params) (any, error)
- func (c *Client) EventTennisPower(ctx context.Context, params Params) (any, error)
- func (c *Client) EventTvChannels(ctx context.Context, params Params) (any, error)
- func (c *Client) EventVotes(ctx context.Context, params Params) (any, error)
- func (c *Client) LiveEvents(ctx context.Context, params Params) (any, error)
- func (c *Client) Manager(ctx context.Context, params Params) (any, error)
- func (c *Client) ManagerEvents(ctx context.Context, params Params) (any, error)
- func (c *Client) MmaCard(ctx context.Context, params Params) (any, error)
- func (c *Client) MmaSchedule(ctx context.Context, params Params) (any, error)
- func (c *Client) OddsDropping(ctx context.Context, params Params) (any, error)
- func (c *Client) OddsWinning(ctx context.Context, params Params) (any, error)
- func (c *Client) Player(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerAttributes(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerEvents(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerLastYearSummary(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerNationalTeamStatistics(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerPenaltyHistory(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerRatings(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerSeasonHeatmap(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerSeasonStatistics(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerStatisticalRankings(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerStatisticsSeasons(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerTournaments(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerTransfers(ctx context.Context, params Params) (any, error)
- func (c *Client) RankingTypes(ctx context.Context, params Params) (any, error)
- func (c *Client) Rankings(ctx context.Context, params Params) (any, error)
- func (c *Client) Referee(ctx context.Context, params Params) (any, error)
- func (c *Client) RefereeEvents(ctx context.Context, params Params) (any, error)
- func (c *Client) RefereeStatistics(ctx context.Context, params Params) (any, error)
- func (c *Client) RoundEvents(ctx context.Context, params Params) (any, error)
- func (c *Client) ScheduledEvents(ctx context.Context, params Params) (any, error)
- func (c *Client) ScheduledTournaments(ctx context.Context, params Params) (any, error)
- func (c *Client) Search(ctx context.Context, params Params) (any, error)
- func (c *Client) SearchTyped(ctx context.Context, params Params) (any, error)
- func (c *Client) SeasonEvents(ctx context.Context, params Params) (any, error)
- func (c *Client) Sports(ctx context.Context, params Params) (any, error)
- func (c *Client) Stage(ctx context.Context, params Params) (any, error)
- func (c *Client) StageCategories(ctx context.Context, params Params) (any, error)
- func (c *Client) StageDriverPerformance(ctx context.Context, params Params) (any, error)
- func (c *Client) StageFeatured(ctx context.Context, params Params) (any, error)
- func (c *Client) StageSchedule(ctx context.Context, params Params) (any, error)
- func (c *Client) StageSeasons(ctx context.Context, params Params) (any, error)
- func (c *Client) StageStandings(ctx context.Context, params Params) (any, error)
- func (c *Client) StageSubstages(ctx context.Context, params Params) (any, error)
- func (c *Client) Standings(ctx context.Context, params Params) (any, error)
- func (c *Client) Team(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamAchievements(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamEvents(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamGoalDistributions(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamNearEvents(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamOfTheWeek(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamOfTheWeekPeriods(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamPerformance(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamPlayerStatistics(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamPlayerStatisticsSeasons(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamPlayers(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamRankings(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamSeasonStatistics(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamStatisticsSeasons(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamTopPlayers(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamTournaments(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamTransfers(ctx context.Context, params Params) (any, error)
- func (c *Client) TennisPlayerGrandSlamResults(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentCuptree(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentInfo(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentPlayerOfTheSeason(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentPlayerStatistics(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentRounds(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentSeasons(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentStatisticsInfo(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentTeamOfTheSeason(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentTeams(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentTopPlayers(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentTopTeams(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentVenues(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentWinners(ctx context.Context, params Params) (any, error)
- func (c *Client) TournamentsWithFeature(ctx context.Context, params Params) (any, error)
- func (c *Client) TrendingEvents(ctx context.Context, params Params) (any, error)
- func (c *Client) TrendingPlayers(ctx context.Context, params Params) (any, error)
- func (c *Client) Venue(ctx context.Context, params Params) (any, error)
- func (c *Client) VenueEvents(ctx context.Context, params Params) (any, error)
- type Params
Examples ¶
Constants ¶
const ( DefaultBaseURL = "https://api.crawlora.net/api/v1" Version = "0.4.0" )
const OperationCount = 109
OperationCount reports how many selected-platform operations this module exposes.
Variables ¶
This section is empty.
Functions ¶
func OperationIDs ¶
func OperationIDs() []string
OperationIDs returns the selected operation IDs in stable sorted order.
Types ¶
type Client ¶
Client calls only the operation IDs included in this platform module.
func NewClient ¶
NewClient creates a client using the supplied API key, or CRAWLORA_API_KEY when empty.
func (*Client) Call ¶
Call executes a selected platform operation by operation ID.
Example ¶
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{"ok":true}`))
}))
defer server.Close()
client := NewClient("your-crawlora-api-key")
client.BaseURL = server.URL + "/api/v1"
client.HTTPClient = server.Client()
result, err := client.Call(context.Background(), "sofascore-categories", Params{"sport": "american-football"})
if err != nil {
panic(err)
}
fmt.Println(result.(map[string]any)["ok"])
Output: true
func (*Client) Categories ¶
Categories calls the sofascore-categories operation.
func (*Client) CategoryTournaments ¶
CategoryTournaments calls the sofascore-category-tournaments operation.
func (*Client) DraftPicks ¶ added in v0.3.0
DraftPicks calls the sofascore-draft-picks operation.
func (*Client) EsportsGame ¶ added in v0.3.0
EsportsGame calls the sofascore-esports-game operation.
func (*Client) EventAtBatPitches ¶ added in v0.3.0
EventAtBatPitches calls the sofascore-event-at-bat-pitches operation.
func (*Client) EventAtBats ¶ added in v0.3.0
EventAtBats calls the sofascore-event-at-bats operation.
func (*Client) EventAveragePositions ¶ added in v0.3.0
EventAveragePositions calls the sofascore-event-average-positions operation.
func (*Client) EventBaseballTopPerformers ¶ added in v0.3.0
EventBaseballTopPerformers calls the sofascore-event-baseball-top-performers operation.
func (*Client) EventBestPlayers ¶
EventBestPlayers calls the sofascore-event-best-players operation.
func (*Client) EventComments ¶
EventComments calls the sofascore-event-comments operation.
func (*Client) EventEsportsGames ¶ added in v0.3.0
EventEsportsGames calls the sofascore-event-esports-games operation.
func (*Client) EventGraph ¶
EventGraph calls the sofascore-event-graph operation.
func (*Client) EventHighlights ¶ added in v0.3.0
EventHighlights calls the sofascore-event-highlights operation.
func (*Client) EventIncidents ¶
EventIncidents calls the sofascore-event-incidents operation.
func (*Client) EventInnings ¶ added in v0.3.0
EventInnings calls the sofascore-event-innings operation.
func (*Client) EventLineups ¶
EventLineups calls the sofascore-event-lineups operation.
func (*Client) EventManagers ¶ added in v0.3.0
EventManagers calls the sofascore-event-managers operation.
func (*Client) EventPlayerHeatmap ¶ added in v0.3.0
EventPlayerHeatmap calls the sofascore-event-player-heatmap operation.
func (*Client) EventPlayerStatistics ¶
EventPlayerStatistics calls the sofascore-event-player-statistics operation.
func (*Client) EventPointByPoint ¶ added in v0.3.0
EventPointByPoint calls the sofascore-event-point-by-point operation.
func (*Client) EventPregameForm ¶ added in v0.3.0
EventPregameForm calls the sofascore-event-pregame-form operation.
func (*Client) EventShotmap ¶
EventShotmap calls the sofascore-event-shotmap operation.
func (*Client) EventStatistics ¶
EventStatistics calls the sofascore-event-statistics operation.
func (*Client) EventTeamHeatmap ¶ added in v0.3.0
EventTeamHeatmap calls the sofascore-event-team-heatmap operation.
func (*Client) EventTeamStreaks ¶ added in v0.3.0
EventTeamStreaks calls the sofascore-event-team-streaks operation.
func (*Client) EventTennisPower ¶ added in v0.3.0
EventTennisPower calls the sofascore-event-tennis-power operation.
func (*Client) EventTvChannels ¶ added in v0.3.0
EventTvChannels calls the sofascore-event-tv-channels operation.
func (*Client) EventVotes ¶ added in v0.3.0
EventVotes calls the sofascore-event-votes operation.
func (*Client) LiveEvents ¶
LiveEvents calls the sofascore-live-events operation.
func (*Client) ManagerEvents ¶
ManagerEvents calls the sofascore-manager-events operation.
func (*Client) MmaSchedule ¶ added in v0.3.0
MmaSchedule calls the sofascore-mma-schedule operation.
func (*Client) OddsDropping ¶ added in v0.3.0
OddsDropping calls the sofascore-odds-dropping operation.
func (*Client) OddsWinning ¶ added in v0.3.0
OddsWinning calls the sofascore-odds-winning operation.
func (*Client) PlayerAttributes ¶ added in v0.3.0
PlayerAttributes calls the sofascore-player-attributes operation.
func (*Client) PlayerEvents ¶ added in v0.3.0
PlayerEvents calls the sofascore-player-events operation.
func (*Client) PlayerLastYearSummary ¶ added in v0.3.0
PlayerLastYearSummary calls the sofascore-player-last-year-summary operation.
func (*Client) PlayerNationalTeamStatistics ¶ added in v0.3.0
PlayerNationalTeamStatistics calls the sofascore-player-national-team-statistics operation.
func (*Client) PlayerPenaltyHistory ¶ added in v0.3.0
PlayerPenaltyHistory calls the sofascore-player-penalty-history operation.
func (*Client) PlayerRatings ¶ added in v0.3.0
PlayerRatings calls the sofascore-player-ratings operation.
func (*Client) PlayerSeasonHeatmap ¶ added in v0.3.0
PlayerSeasonHeatmap calls the sofascore-player-season-heatmap operation.
func (*Client) PlayerSeasonStatistics ¶
PlayerSeasonStatistics calls the sofascore-player-season-statistics operation.
func (*Client) PlayerStatisticalRankings ¶ added in v0.3.0
PlayerStatisticalRankings calls the sofascore-player-statistical-rankings operation.
func (*Client) PlayerStatisticsSeasons ¶
PlayerStatisticsSeasons calls the sofascore-player-statistics-seasons operation.
func (*Client) PlayerTournaments ¶ added in v0.3.0
PlayerTournaments calls the sofascore-player-tournaments operation.
func (*Client) PlayerTransfers ¶
PlayerTransfers calls the sofascore-player-transfers operation.
func (*Client) RankingTypes ¶
RankingTypes calls the sofascore-ranking-types operation.
func (*Client) RefereeEvents ¶ added in v0.3.0
RefereeEvents calls the sofascore-referee-events operation.
func (*Client) RefereeStatistics ¶ added in v0.3.0
RefereeStatistics calls the sofascore-referee-statistics operation.
func (*Client) RoundEvents ¶
RoundEvents calls the sofascore-round-events operation.
func (*Client) ScheduledEvents ¶
ScheduledEvents calls the sofascore-scheduled-events operation.
func (*Client) ScheduledTournaments ¶
ScheduledTournaments calls the sofascore-scheduled-tournaments operation.
func (*Client) SearchTyped ¶ added in v0.3.0
SearchTyped calls the sofascore-search-typed operation.
func (*Client) SeasonEvents ¶
SeasonEvents calls the sofascore-season-events operation.
func (*Client) StageCategories ¶ added in v0.3.0
StageCategories calls the sofascore-stage-categories operation.
func (*Client) StageDriverPerformance ¶ added in v0.3.0
StageDriverPerformance calls the sofascore-stage-driver-performance operation.
func (*Client) StageFeatured ¶ added in v0.3.0
StageFeatured calls the sofascore-stage-featured operation.
func (*Client) StageSchedule ¶ added in v0.3.0
StageSchedule calls the sofascore-stage-schedule operation.
func (*Client) StageSeasons ¶ added in v0.3.0
StageSeasons calls the sofascore-stage-seasons operation.
func (*Client) StageStandings ¶ added in v0.3.0
StageStandings calls the sofascore-stage-standings operation.
func (*Client) StageSubstages ¶ added in v0.3.0
StageSubstages calls the sofascore-stage-substages operation.
func (*Client) TeamAchievements ¶ added in v0.3.0
TeamAchievements calls the sofascore-team-achievements operation.
func (*Client) TeamEvents ¶
TeamEvents calls the sofascore-team-events operation.
func (*Client) TeamGoalDistributions ¶ added in v0.3.0
TeamGoalDistributions calls the sofascore-team-goal-distributions operation.
func (*Client) TeamNearEvents ¶ added in v0.3.0
TeamNearEvents calls the sofascore-team-near-events operation.
func (*Client) TeamOfTheWeek ¶
TeamOfTheWeek calls the sofascore-team-of-the-week operation.
func (*Client) TeamOfTheWeekPeriods ¶
TeamOfTheWeekPeriods calls the sofascore-team-of-the-week-periods operation.
func (*Client) TeamPerformance ¶ added in v0.3.0
TeamPerformance calls the sofascore-team-performance operation.
func (*Client) TeamPlayerStatistics ¶ added in v0.3.0
TeamPlayerStatistics calls the sofascore-team-player-statistics operation.
func (*Client) TeamPlayerStatisticsSeasons ¶ added in v0.3.0
TeamPlayerStatisticsSeasons calls the sofascore-team-player-statistics-seasons operation.
func (*Client) TeamPlayers ¶
TeamPlayers calls the sofascore-team-players operation.
func (*Client) TeamRankings ¶ added in v0.3.0
TeamRankings calls the sofascore-team-rankings operation.
func (*Client) TeamSeasonStatistics ¶
TeamSeasonStatistics calls the sofascore-team-season-statistics operation.
func (*Client) TeamStatisticsSeasons ¶
TeamStatisticsSeasons calls the sofascore-team-statistics-seasons operation.
func (*Client) TeamTopPlayers ¶ added in v0.3.0
TeamTopPlayers calls the sofascore-team-top-players operation.
func (*Client) TeamTournaments ¶ added in v0.3.0
TeamTournaments calls the sofascore-team-tournaments operation.
func (*Client) TeamTransfers ¶
TeamTransfers calls the sofascore-team-transfers operation.
func (*Client) TennisPlayerGrandSlamResults ¶ added in v0.3.0
TennisPlayerGrandSlamResults calls the sofascore-tennis-player-grand-slam-results operation.
func (*Client) TournamentCuptree ¶ added in v0.3.0
TournamentCuptree calls the sofascore-tournament-cuptree operation.
func (*Client) TournamentInfo ¶
TournamentInfo calls the sofascore-tournament-info operation.
func (*Client) TournamentPlayerOfTheSeason ¶ added in v0.3.0
TournamentPlayerOfTheSeason calls the sofascore-tournament-player-of-the-season operation.
func (*Client) TournamentPlayerStatistics ¶
TournamentPlayerStatistics calls the sofascore-tournament-player-statistics operation.
func (*Client) TournamentRounds ¶
TournamentRounds calls the sofascore-tournament-rounds operation.
func (*Client) TournamentSeasons ¶
TournamentSeasons calls the sofascore-tournament-seasons operation.
func (*Client) TournamentStatisticsInfo ¶ added in v0.3.0
TournamentStatisticsInfo calls the sofascore-tournament-statistics-info operation.
func (*Client) TournamentTeamOfTheSeason ¶ added in v0.3.0
TournamentTeamOfTheSeason calls the sofascore-tournament-team-of-the-season operation.
func (*Client) TournamentTeams ¶ added in v0.3.0
TournamentTeams calls the sofascore-tournament-teams operation.
func (*Client) TournamentTopPlayers ¶
TournamentTopPlayers calls the sofascore-tournament-top-players operation.
func (*Client) TournamentTopTeams ¶
TournamentTopTeams calls the sofascore-tournament-top-teams operation.
func (*Client) TournamentVenues ¶ added in v0.3.0
TournamentVenues calls the sofascore-tournament-venues operation.
func (*Client) TournamentWinners ¶ added in v0.3.0
TournamentWinners calls the sofascore-tournament-winners operation.
func (*Client) TournamentsWithFeature ¶ added in v0.3.0
TournamentsWithFeature calls the sofascore-tournaments-with-feature operation.
func (*Client) TrendingEvents ¶ added in v0.3.0
TrendingEvents calls the sofascore-trending-events operation.
func (*Client) TrendingPlayers ¶ added in v0.3.0
TrendingPlayers calls the sofascore-trending-players operation.