Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.3.5 — 2026-10-12

- List every supported endpoint in the repository and package READMEs.
- Add platform-specific search keywords to the npm, PyPI, and Composer package metadata.

## 0.3.4 — 2026-10-09

- Keep the platform README as a language-package index without cross-language installation commands or code examples; pkg.go.dev now shows only its Go example.
Expand Down
120 changes: 116 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,135 @@
# SofaScore clients for Crawlora

Official Crawlora client packages for the hosted SofaScore API. These clients call Crawlora's hosted API; they do not scrape SofaScore locally. Requests use your Crawlora account and `CRAWLORA_API_KEY`; service usage follows your account billing plan. Crawlora is independent from and not affiliated with or endorsed by SofaScore or its owners.
Official Crawlora client packages for the hosted SofaScore API. Access 109 API endpoints covering live events, match details, lineups, statistics, tournaments, and player/team data from JavaScript/TypeScript, Python, Go, Ruby, Java, and PHP. These clients call Crawlora's hosted API; they do not scrape SofaScore locally. Requests use your Crawlora account and `CRAWLORA_API_KEY`; service usage follows your account billing plan. Crawlora is independent from and not affiliated with or endorsed by SofaScore or its owners.

## Language packages

- JavaScript / TypeScript: [`@crawlora-org/sofascore`](javascript/README.md)
- Python: [`crawlora-sofascore`](python/README.md)
- Go: [`github.com/Crawlora-org/crawlora-sofascore`](go.mod)
- Ruby: [`crawlora-sofascore`](ruby/README.md)
- Java: [`net.crawlora:crawlora-sofascore:0.3.4`](java/README.md)
- Java: [`net.crawlora:crawlora-sofascore:0.3.5`](java/README.md)
- PHP: [`crawlora/sofascore`](php/README.md)

For installation and runnable examples, use the README for your language. See the [API endpoint and parameter reference](docs/usage.md) for shared operation details.

Create an account at [crawlora.net](https://crawlora.net/signup?utm_source=github&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-repository-signup), open the [Crawlora console](https://crawlora.net/app?utm_source=github&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-repository-console) to get an API key, or read the [API documentation](https://crawlora.net/docs?utm_source=github&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-repository-api-docs). Keep `CRAWLORA_API_KEY` out of source control.

## API coverage
## API coverage and supported endpoints

The six clients provide access to 109 public API operations. See the [API reference](docs/usage.md) for supported operations, parameters, and response details.
The six language clients provide access to all 109 selected public SofaScore API operations. Search or browse by endpoint path and operation ID below; the [complete API reference](docs/usage.md) adds parameters, enums, and response details.

| Method | Endpoint | API operation | Description |
| --- | --- | --- | --- |
| `GET` | `/sofascore/categories` | `sofascore-categories` | SofaScore categories for a sport |
| `GET` | `/sofascore/category-tournaments` | `sofascore-category-tournaments` | SofaScore competitions in a category |
| `GET` | `/sofascore/draft` | `sofascore-draft` | SofaScore league draft |
| `GET` | `/sofascore/draft-picks` | `sofascore-draft-picks` | SofaScore league draft picks |
| `GET` | `/sofascore/esports-game` | `sofascore-esports-game` | SofaScore esports game detail |
| `GET` | `/sofascore/event` | `sofascore-event` | SofaScore event detail |
| `GET` | `/sofascore/event-at-bat-pitches` | `sofascore-event-at-bat-pitches` | SofaScore event at-bat pitches |
| `GET` | `/sofascore/event-at-bats` | `sofascore-event-at-bats` | SofaScore event at-bats |
| `GET` | `/sofascore/event-average-positions` | `sofascore-event-average-positions` | SofaScore event average positions |
| `GET` | `/sofascore/event-baseball-top-performers` | `sofascore-event-baseball-top-performers` | SofaScore event baseball top performers |
| `GET` | `/sofascore/event-best-players` | `sofascore-event-best-players` | SofaScore event best players |
| `GET` | `/sofascore/event-comments` | `sofascore-event-comments` | SofaScore event commentary |
| `GET` | `/sofascore/event-esports-games` | `sofascore-event-esports-games` | SofaScore event esports games |
| `GET` | `/sofascore/event-graph` | `sofascore-event-graph` | SofaScore event momentum graph |
| `GET` | `/sofascore/event-h2h` | `sofascore-event-h2h` | SofaScore event head-to-head |
| `GET` | `/sofascore/event-highlights` | `sofascore-event-highlights` | SofaScore event highlights |
| `GET` | `/sofascore/event-incidents` | `sofascore-event-incidents` | SofaScore event incidents |
| `GET` | `/sofascore/event-innings` | `sofascore-event-innings` | SofaScore event innings |
| `GET` | `/sofascore/event-lineups` | `sofascore-event-lineups` | SofaScore event lineups |
| `GET` | `/sofascore/event-managers` | `sofascore-event-managers` | SofaScore event managers |
| `GET` | `/sofascore/event-odds` | `sofascore-event-odds` | SofaScore event odds |
| `GET` | `/sofascore/event-player-heatmap` | `sofascore-event-player-heatmap` | SofaScore event player heatmap |
| `GET` | `/sofascore/event-player-statistics` | `sofascore-event-player-statistics` | SofaScore event player statistics |
| `GET` | `/sofascore/event-point-by-point` | `sofascore-event-point-by-point` | SofaScore event point-by-point |
| `GET` | `/sofascore/event-pregame-form` | `sofascore-event-pregame-form` | SofaScore event pre-game form |
| `GET` | `/sofascore/event-shotmap` | `sofascore-event-shotmap` | SofaScore event shot map |
| `GET` | `/sofascore/event-statistics` | `sofascore-event-statistics` | SofaScore event statistics |
| `GET` | `/sofascore/event-team-heatmap` | `sofascore-event-team-heatmap` | SofaScore event team heatmap |
| `GET` | `/sofascore/event-team-streaks` | `sofascore-event-team-streaks` | SofaScore event team streaks |
| `GET` | `/sofascore/event-tennis-power` | `sofascore-event-tennis-power` | SofaScore event tennis power |
| `GET` | `/sofascore/event-tv-channels` | `sofascore-event-tv-channels` | SofaScore event TV channels |
| `GET` | `/sofascore/event-votes` | `sofascore-event-votes` | SofaScore event votes |
| `GET` | `/sofascore/live-events` | `sofascore-live-events` | SofaScore live events |
| `GET` | `/sofascore/manager` | `sofascore-manager` | SofaScore manager detail |
| `GET` | `/sofascore/manager-events` | `sofascore-manager-events` | SofaScore manager recent matches |
| `GET` | `/sofascore/mma-card` | `sofascore-mma-card` | SofaScore MMA card |
| `GET` | `/sofascore/mma-schedule` | `sofascore-mma-schedule` | SofaScore MMA schedule |
| `GET` | `/sofascore/odds-dropping` | `sofascore-odds-dropping` | SofaScore dropping odds |
| `GET` | `/sofascore/odds-winning` | `sofascore-odds-winning` | SofaScore winning odds |
| `GET` | `/sofascore/player` | `sofascore-player` | SofaScore player detail |
| `GET` | `/sofascore/player-attributes` | `sofascore-player-attributes` | SofaScore player attributes and characteristics |
| `GET` | `/sofascore/player-events` | `sofascore-player-events` | SofaScore player matches with per-match numbers |
| `GET` | `/sofascore/player-last-year-summary` | `sofascore-player-last-year-summary` | SofaScore player form over the last year |
| `GET` | `/sofascore/player-national-team-statistics` | `sofascore-player-national-team-statistics` | SofaScore player national team record |
| `GET` | `/sofascore/player-penalty-history` | `sofascore-player-penalty-history` | SofaScore player penalty history |
| `GET` | `/sofascore/player-ratings` | `sofascore-player-ratings` | SofaScore player match ratings for a season |
| `GET` | `/sofascore/player-season-heatmap` | `sofascore-player-season-heatmap` | SofaScore player season heatmap |
| `GET` | `/sofascore/player-season-statistics` | `sofascore-player-season-statistics` | SofaScore player season statistics |
| `GET` | `/sofascore/player-statistical-rankings` | `sofascore-player-statistical-rankings` | SofaScore player ranking among all players in a season |
| `GET` | `/sofascore/player-statistics-seasons` | `sofascore-player-statistics-seasons` | SofaScore player statistics seasons |
| `GET` | `/sofascore/player-tournaments` | `sofascore-player-tournaments` | SofaScore player competitions |
| `GET` | `/sofascore/player-transfers` | `sofascore-player-transfers` | SofaScore player transfer history |
| `GET` | `/sofascore/ranking-types` | `sofascore-ranking-types` | SofaScore ranking catalogue |
| `GET` | `/sofascore/rankings` | `sofascore-rankings` | SofaScore rankings |
| `GET` | `/sofascore/referee` | `sofascore-referee` | SofaScore referee profile |
| `GET` | `/sofascore/referee-events` | `sofascore-referee-events` | SofaScore referee officiated matches |
| `GET` | `/sofascore/referee-statistics` | `sofascore-referee-statistics` | SofaScore referee card statistics |
| `GET` | `/sofascore/round-events` | `sofascore-round-events` | SofaScore round fixtures |
| `GET` | `/sofascore/scheduled-events` | `sofascore-scheduled-events` | SofaScore events scheduled in a category on a date |
| `GET` | `/sofascore/scheduled-tournaments` | `sofascore-scheduled-tournaments` | SofaScore tournaments scheduled on a date |
| `GET` | `/sofascore/search` | `sofascore-search` | SofaScore universal search |
| `GET` | `/sofascore/search-typed` | `sofascore-search-typed` | SofaScore search by entity type |
| `GET` | `/sofascore/season-events` | `sofascore-season-events` | SofaScore season fixtures and results |
| `GET` | `/sofascore/sports` | `sofascore-sports` | SofaScore supported sports |
| `GET` | `/sofascore/stage` | `sofascore-stage` | SofaScore motorsport and cycling stage |
| `GET` | `/sofascore/stage-categories` | `sofascore-stage-categories` | SofaScore motorsport and cycling categories and competitions |
| `GET` | `/sofascore/stage-driver-performance` | `sofascore-stage-driver-performance` | SofaScore motorsport race progress per driver |
| `GET` | `/sofascore/stage-featured` | `sofascore-stage-featured` | SofaScore featured motorsport and cycling events |
| `GET` | `/sofascore/stage-schedule` | `sofascore-stage-schedule` | SofaScore motorsport and cycling events around a date |
| `GET` | `/sofascore/stage-seasons` | `sofascore-stage-seasons` | SofaScore seasons of a motorsport or cycling competition |
| `GET` | `/sofascore/stage-standings` | `sofascore-stage-standings` | SofaScore motorsport and cycling stage standings |
| `GET` | `/sofascore/stage-substages` | `sofascore-stage-substages` | SofaScore children of a motorsport or cycling stage |
| `GET` | `/sofascore/standings` | `sofascore-standings` | SofaScore standings |
| `GET` | `/sofascore/team` | `sofascore-team` | SofaScore team detail |
| `GET` | `/sofascore/team-achievements` | `sofascore-team-achievements` | SofaScore team trophies |
| `GET` | `/sofascore/team-events` | `sofascore-team-events` | SofaScore team fixtures |
| `GET` | `/sofascore/team-goal-distributions` | `sofascore-team-goal-distributions` | SofaScore team goals by match minute |
| `GET` | `/sofascore/team-near-events` | `sofascore-team-near-events` | SofaScore team previous and next match |
| `GET` | `/sofascore/team-of-the-week` | `sofascore-team-of-the-week` | SofaScore team of the week |
| `GET` | `/sofascore/team-of-the-week-periods` | `sofascore-team-of-the-week-periods` | SofaScore team of the week periods |
| `GET` | `/sofascore/team-performance` | `sofascore-team-performance` | SofaScore team recent performance |
| `GET` | `/sofascore/team-player-statistics` | `sofascore-team-player-statistics` | SofaScore team player statistics |
| `GET` | `/sofascore/team-player-statistics-seasons` | `sofascore-team-player-statistics-seasons` | SofaScore team player statistics seasons |
| `GET` | `/sofascore/team-players` | `sofascore-team-players` | SofaScore team players |
| `GET` | `/sofascore/team-rankings` | `sofascore-team-rankings` | SofaScore team rankings |
| `GET` | `/sofascore/team-season-statistics` | `sofascore-team-season-statistics` | SofaScore team season statistics |
| `GET` | `/sofascore/team-statistics-seasons` | `sofascore-team-statistics-seasons` | SofaScore team statistics seasons |
| `GET` | `/sofascore/team-top-players` | `sofascore-team-top-players` | SofaScore team top players |
| `GET` | `/sofascore/team-tournaments` | `sofascore-team-tournaments` | SofaScore team competitions |
| `GET` | `/sofascore/team-transfers` | `sofascore-team-transfers` | SofaScore team transfers |
| `GET` | `/sofascore/tennis-player-grand-slam-results` | `sofascore-tennis-player-grand-slam-results` | SofaScore tennis player grand slam results |
| `GET` | `/sofascore/tournament-cuptree` | `sofascore-tournament-cuptree` | SofaScore competition knockout tree |
| `GET` | `/sofascore/tournament-info` | `sofascore-tournament-info` | SofaScore competition info |
| `GET` | `/sofascore/tournament-player-of-the-season` | `sofascore-tournament-player-of-the-season` | SofaScore player of the season |
| `GET` | `/sofascore/tournament-player-statistics` | `sofascore-tournament-player-statistics` | SofaScore season player statistics table |
| `GET` | `/sofascore/tournament-rounds` | `sofascore-tournament-rounds` | SofaScore competition season rounds |
| `GET` | `/sofascore/tournament-seasons` | `sofascore-tournament-seasons` | SofaScore competition seasons |
| `GET` | `/sofascore/tournament-statistics-info` | `sofascore-tournament-statistics-info` | SofaScore player statistics table filters |
| `GET` | `/sofascore/tournament-team-of-the-season` | `sofascore-tournament-team-of-the-season` | SofaScore team of the season |
| `GET` | `/sofascore/tournament-teams` | `sofascore-tournament-teams` | SofaScore teams of a competition season |
| `GET` | `/sofascore/tournament-top-players` | `sofascore-tournament-top-players` | SofaScore season top players |
| `GET` | `/sofascore/tournament-top-teams` | `sofascore-tournament-top-teams` | SofaScore season top teams |
| `GET` | `/sofascore/tournament-venues` | `sofascore-tournament-venues` | SofaScore venues of a competition season |
| `GET` | `/sofascore/tournament-winners` | `sofascore-tournament-winners` | SofaScore past winners of a competition |
| `GET` | `/sofascore/tournaments-with-feature` | `sofascore-tournaments-with-feature` | SofaScore competitions that carry a feature |
| `GET` | `/sofascore/trending-events` | `sofascore-trending-events` | SofaScore trending events |
| `GET` | `/sofascore/trending-players` | `sofascore-trending-players` | SofaScore trending players |
| `GET` | `/sofascore/venue` | `sofascore-venue` | SofaScore venue |
| `GET` | `/sofascore/venue-events` | `sofascore-venue-events` | SofaScore matches at a venue |

## License

Expand Down
33 changes: 28 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Package sofascore is a focused Go client for Crawlora's SofaScore endpoints.
// 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
package sofascore

import (
"bytes"
"context"
"encoding/json"
"fmt"
Expand All @@ -17,7 +18,7 @@ import (

const (
DefaultBaseURL = "https://api.crawlora.net/api/v1"
Version = "0.3.4"
Version = "0.3.5"
)

// Params maps the exact OpenAPI parameter names expected by this platform client.
Expand Down Expand Up @@ -62,12 +63,31 @@ func (c *Client) Call(ctx context.Context, operationID string, params Params) (a
if !ok {
return nil, fmt.Errorf("unknown SofaScore operation: %s", operationID)
}
if operation.Method != http.MethodGet {
if operation.Method != http.MethodGet && operation.Method != http.MethodPost {
return nil, fmt.Errorf("unsupported HTTP method %s for %s", operation.Method, operationID)
}
if params == nil {
params = Params{}
}
var payload io.Reader
if operation.BodyParam != "" {
// The JSON body is passed under the operation's body parameter name or "body".
value, ok := params[operation.BodyParam]
if !ok || value == nil {
value, ok = params["body"]
}
if !ok || value == nil {
if operation.BodyRequired {
return nil, fmt.Errorf("missing required request body: %s", operation.BodyParam)
}
} else {
encoded, err := json.Marshal(value)
if err != nil {
return nil, fmt.Errorf("encode request body: %w", err)
}
payload = bytes.NewReader(encoded)
}
}
requestURL, err := buildURL(c.BaseURL, operation, params)
if err != nil {
return nil, err
Expand All @@ -77,11 +97,14 @@ func (c *Client) Call(ctx context.Context, operationID string, params Params) (a
ctx, cancel = context.WithTimeout(ctx, c.Timeout)
defer cancel()
}
request, err := http.NewRequestWithContext(ctx, http.MethodGet, requestURL, nil)
request, err := http.NewRequestWithContext(ctx, operation.Method, requestURL, payload)
if err != nil {
return nil, err
}
request.Header.Set("User-Agent", "crawlora-sofascore-go/0.3.4")
if payload != nil {
request.Header.Set("Content-Type", "application/json")
}
request.Header.Set("User-Agent", "crawlora-sofascore-go/0.3.5")
for _, security := range operation.Security {
if security == "ApiKeyAuth" && c.APIKey != "" {
request.Header.Set("x-api-key", c.APIKey)
Expand Down
19 changes: 18 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
{
"name": "crawlora/sofascore",
"description": "SofaScore client for the Crawlora hosted API",
"description": "Crawlora SofaScore API client with 109 endpoints for live events, match details, lineups, statistics, tournaments, and player/team data",
"keywords": [
"crawlora",
"api-client",
"sdk",
"web-scraping",
"scraping-api",
"sofascore",
"sofascore-api",
"sofascore-scraper",
"sofascore-data",
"sofascore-live-events",
"sofascore-match-details",
"sofascore-lineups",
"sofascore-statistics",
"sofascore-tournaments",
"sofascore-player-team-data"
],
"type": "library",
"license": "MIT",
"require": {
Expand Down
6 changes: 3 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SofaScore client usage
# SofaScore API endpoint reference and client usage

The `@crawlora-org/sofascore` and `crawlora-sofascore` packages call Crawlora's hosted API. Set `CRAWLORA_API_KEY` to a key for your Crawlora account before making requests. Service usage is billed under that account. These clients do not run a browser or scrape SofaScore locally; Crawlora is independent from and not endorsed by SofaScore or its owners.
This reference lists all 109 public SofaScore API endpoints exposed by the `@crawlora-org/sofascore` and `crawlora-sofascore` packages, covering live events, match details, lineups, statistics, tournaments, and player/team data. The clients call Crawlora's hosted API. Set `CRAWLORA_API_KEY` to a key for your Crawlora account before making requests. Service usage is billed under that account. These clients do not run a browser or scrape SofaScore locally; Crawlora is independent from and not endorsed by SofaScore or its owners.

The package tracks the public API contract revision `sha256:645115670262bb86bf9c49f16ddbfdd94bbec67befb2aa8497f10f86ee2d5e46` bundled with release `0.3.4`. Maintainers can preview daily contract updates with the repository's `Sync live API contract` workflow; unchanged contracts do not produce package releases.
The package tracks the public API contract revision `sha256:645115670262bb86bf9c49f16ddbfdd94bbec67befb2aa8497f10f86ee2d5e46` bundled with release `0.3.5`. Maintainers can preview daily contract updates with the repository's `Sync live API contract` workflow; unchanged contracts do not produce package releases.

Both packages expose all 109 operations in the bundled API contract. JavaScript uses camelCase methods and Python uses snake_case methods. Methods also remain available through the `sofascore` group and the generated `Client` alias.

Expand Down
Loading
Loading