Help us shape the future of Go! Take the 2026 Go Developer Survey

sofascore

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 11 Imported by: 0

README

SofaScore clients for Crawlora

Official Crawlora client packages for the hosted SofaScore API. These packages send requests to Crawlora's API and require a Crawlora account and CRAWLORA_API_KEY; service usage follows your Crawlora account billing plan.

The packages do not run a browser or scrape SofaScore locally. Crawlora is an independent service and is not affiliated with or endorsed by SofaScore or its owners.

Create an account at crawlora.net, open the Crawlora console to get an API key, or read the API documentation.

Install

npm install @crawlora-org/sofascore
python -m pip install crawlora-sofascore
go get github.com/Crawlora-org/crawlora-sofascore@latest
gem install crawlora-sofascore
composer require crawlora/sofascore

For Java, add net.crawlora:crawlora-sofascore:0.2.0 to your Maven dependencies; see java/README.md.

Set your Crawlora key in the environment before running a client:

export CRAWLORA_API_KEY="your-crawlora-api-key"

Do not commit API keys. See the language-specific READMEs for sync and async use.

PHP example

The Packagist package is available as crawlora/sofascore:

composer require crawlora/sofascore
<?php
require __DIR__ . '/vendor/autoload.php';

$apiKey = getenv('CRAWLORA_API_KEY');
if (!$apiKey) throw new RuntimeException('Set CRAWLORA_API_KEY before running this example.');
$client = new \Crawlora\Sofascore\Client(apiKey: $apiKey);
$result = $client->request("sofascore-search", ['q' => 'Liverpool']);
print_r($result);
$client->close();

The same example and install details are in php/README.md.

Run examples from a source checkout

From the repository root, set CRAWLORA_API_KEY as shown above and run:

node examples/javascript.mjs
python -m pip install ./python
python examples/python.py

The checked-in JavaScript example imports the generated local source at javascript/src/index.js. The Python command installs this checkout's package before running its example. Every language-specific README also includes an install snippet and a client call for the corresponding registry package.

Contract

This package release is 0.2.0. The generated client methods follow the bundled openapi/public.json contract at revision sha256:91686922e3c5ab6569dbe0abd882fbbbc86c4395a86f151582a2291fb11de036. scripts/generate.py regenerates all six language clients and the documentation from the shared source.

Contract updates and releases

The Sync live API contract workflow checks the deployed public OpenAPI contract every day at 03:17 UTC. It always reads https://api.crawlora.net/swagger/doc.json; its only manual option is dry_run, which applies the candidate in the workflow and reports the result without validating, committing, tagging, or publishing it.

An unchanged contract is a no-op and does not run the client test matrix or create a release. Additions and updates are applied to a candidate, checked across Node.js, Python, Go, Ruby, Java, and PHP, then committed to main only after all checks pass. Removing or deprecating an existing operation stops the run for maintainer review; packages already published remain available. The release workflow publishes accepted versions to npm, PyPI, Go modules, RubyGems, Maven Central, GitHub Packages, and Packagist. A failed fetch, invalid contract, or failed check also stops before the commit. A later scheduled run can resume an incomplete registry publication at the same package version and immutable tag; recovery does not bypass the removed-operation review.

The workflow does not accept an alternate source URL or a caller-supplied version. To preview a change, open Actions → Sync live API contract → Run workflow and select dry_run.

License

MIT. See LICENSE.

Documentation

Overview

Package sofascore is a focused Go client for Crawlora's SofaScore endpoints.

Index

Constants

View Source
const (
	DefaultBaseURL = "https://api.crawlora.net/api/v1"
	Version        = "0.2.0"
)
View Source
const OperationCount = 43

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

type Client struct {
	APIKey     string
	BaseURL    string
	Timeout    time.Duration
	HTTPClient *http.Client
}

Client calls only the operation IDs included in this platform module.

func NewClient

func NewClient(apiKey string) *Client

NewClient creates a client using the supplied API key, or CRAWLORA_API_KEY when empty.

func (*Client) Call

func (c *Client) Call(ctx context.Context, operationID string, params Params) (any, error)

Call executes a selected platform operation by operation ID.

func (*Client) Categories

func (c *Client) Categories(ctx context.Context, params Params) (any, error)

Categories calls the sofascore-categories operation.

func (*Client) CategoryTournaments

func (c *Client) CategoryTournaments(ctx context.Context, params Params) (any, error)

CategoryTournaments calls the sofascore-category-tournaments operation.

func (*Client) Close

func (c *Client) Close() error

Close releases idle connections held by the configured HTTP transport.

func (*Client) Event

func (c *Client) Event(ctx context.Context, params Params) (any, error)

Event calls the sofascore-event operation.

func (*Client) EventBestPlayers

func (c *Client) EventBestPlayers(ctx context.Context, params Params) (any, error)

EventBestPlayers calls the sofascore-event-best-players operation.

func (*Client) EventComments

func (c *Client) EventComments(ctx context.Context, params Params) (any, error)

EventComments calls the sofascore-event-comments operation.

func (*Client) EventGraph

func (c *Client) EventGraph(ctx context.Context, params Params) (any, error)

EventGraph calls the sofascore-event-graph operation.

func (*Client) EventH2h

func (c *Client) EventH2h(ctx context.Context, params Params) (any, error)

EventH2h calls the sofascore-event-h2h operation.

func (*Client) EventIncidents

func (c *Client) EventIncidents(ctx context.Context, params Params) (any, error)

EventIncidents calls the sofascore-event-incidents operation.

func (*Client) EventLineups

func (c *Client) EventLineups(ctx context.Context, params Params) (any, error)

EventLineups calls the sofascore-event-lineups operation.

func (*Client) EventOdds

func (c *Client) EventOdds(ctx context.Context, params Params) (any, error)

EventOdds calls the sofascore-event-odds operation.

func (*Client) EventPlayerStatistics

func (c *Client) EventPlayerStatistics(ctx context.Context, params Params) (any, error)

EventPlayerStatistics calls the sofascore-event-player-statistics operation.

func (*Client) EventShotmap

func (c *Client) EventShotmap(ctx context.Context, params Params) (any, error)

EventShotmap calls the sofascore-event-shotmap operation.

func (*Client) EventStatistics

func (c *Client) EventStatistics(ctx context.Context, params Params) (any, error)

EventStatistics calls the sofascore-event-statistics operation.

func (*Client) LiveEvents

func (c *Client) LiveEvents(ctx context.Context, params Params) (any, error)

LiveEvents calls the sofascore-live-events operation.

func (*Client) Manager

func (c *Client) Manager(ctx context.Context, params Params) (any, error)

Manager calls the sofascore-manager operation.

func (*Client) ManagerEvents

func (c *Client) ManagerEvents(ctx context.Context, params Params) (any, error)

ManagerEvents calls the sofascore-manager-events operation.

func (*Client) Player

func (c *Client) Player(ctx context.Context, params Params) (any, error)

Player calls the sofascore-player operation.

func (*Client) PlayerSeasonStatistics

func (c *Client) PlayerSeasonStatistics(ctx context.Context, params Params) (any, error)

PlayerSeasonStatistics calls the sofascore-player-season-statistics operation.

func (*Client) PlayerStatisticsSeasons

func (c *Client) PlayerStatisticsSeasons(ctx context.Context, params Params) (any, error)

PlayerStatisticsSeasons calls the sofascore-player-statistics-seasons operation.

func (*Client) PlayerTransfers

func (c *Client) PlayerTransfers(ctx context.Context, params Params) (any, error)

PlayerTransfers calls the sofascore-player-transfers operation.

func (*Client) RankingTypes

func (c *Client) RankingTypes(ctx context.Context, params Params) (any, error)

RankingTypes calls the sofascore-ranking-types operation.

func (*Client) Rankings

func (c *Client) Rankings(ctx context.Context, params Params) (any, error)

Rankings calls the sofascore-rankings operation.

func (*Client) RoundEvents

func (c *Client) RoundEvents(ctx context.Context, params Params) (any, error)

RoundEvents calls the sofascore-round-events operation.

func (*Client) ScheduledEvents

func (c *Client) ScheduledEvents(ctx context.Context, params Params) (any, error)

ScheduledEvents calls the sofascore-scheduled-events operation.

func (*Client) ScheduledTournaments

func (c *Client) ScheduledTournaments(ctx context.Context, params Params) (any, error)

ScheduledTournaments calls the sofascore-scheduled-tournaments operation.

func (*Client) Search

func (c *Client) Search(ctx context.Context, params Params) (any, error)

Search calls the sofascore-search operation.

func (*Client) SeasonEvents

func (c *Client) SeasonEvents(ctx context.Context, params Params) (any, error)

SeasonEvents calls the sofascore-season-events operation.

func (*Client) Sports

func (c *Client) Sports(ctx context.Context, params Params) (any, error)

Sports calls the sofascore-sports operation.

func (*Client) Standings

func (c *Client) Standings(ctx context.Context, params Params) (any, error)

Standings calls the sofascore-standings operation.

func (*Client) Team

func (c *Client) Team(ctx context.Context, params Params) (any, error)

Team calls the sofascore-team operation.

func (*Client) TeamEvents

func (c *Client) TeamEvents(ctx context.Context, params Params) (any, error)

TeamEvents calls the sofascore-team-events operation.

func (*Client) TeamOfTheWeek

func (c *Client) TeamOfTheWeek(ctx context.Context, params Params) (any, error)

TeamOfTheWeek calls the sofascore-team-of-the-week operation.

func (*Client) TeamOfTheWeekPeriods

func (c *Client) TeamOfTheWeekPeriods(ctx context.Context, params Params) (any, error)

TeamOfTheWeekPeriods calls the sofascore-team-of-the-week-periods operation.

func (*Client) TeamPlayers

func (c *Client) TeamPlayers(ctx context.Context, params Params) (any, error)

TeamPlayers calls the sofascore-team-players operation.

func (*Client) TeamSeasonStatistics

func (c *Client) TeamSeasonStatistics(ctx context.Context, params Params) (any, error)

TeamSeasonStatistics calls the sofascore-team-season-statistics operation.

func (*Client) TeamStatisticsSeasons

func (c *Client) TeamStatisticsSeasons(ctx context.Context, params Params) (any, error)

TeamStatisticsSeasons calls the sofascore-team-statistics-seasons operation.

func (*Client) TeamTransfers

func (c *Client) TeamTransfers(ctx context.Context, params Params) (any, error)

TeamTransfers calls the sofascore-team-transfers operation.

func (*Client) TournamentInfo

func (c *Client) TournamentInfo(ctx context.Context, params Params) (any, error)

TournamentInfo calls the sofascore-tournament-info operation.

func (*Client) TournamentPlayerStatistics

func (c *Client) TournamentPlayerStatistics(ctx context.Context, params Params) (any, error)

TournamentPlayerStatistics calls the sofascore-tournament-player-statistics operation.

func (*Client) TournamentRounds

func (c *Client) TournamentRounds(ctx context.Context, params Params) (any, error)

TournamentRounds calls the sofascore-tournament-rounds operation.

func (*Client) TournamentSeasons

func (c *Client) TournamentSeasons(ctx context.Context, params Params) (any, error)

TournamentSeasons calls the sofascore-tournament-seasons operation.

func (*Client) TournamentTopPlayers

func (c *Client) TournamentTopPlayers(ctx context.Context, params Params) (any, error)

TournamentTopPlayers calls the sofascore-tournament-top-players operation.

func (*Client) TournamentTopTeams

func (c *Client) TournamentTopTeams(ctx context.Context, params Params) (any, error)

TournamentTopTeams calls the sofascore-tournament-top-teams operation.

type Params

type Params map[string]any

Params maps the exact OpenAPI parameter names expected by this platform client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL