"description": "Single: provide playerWyId+competitionId+seasonId. Batch: omit playerWyId (imports all players for that competition+season). Auto: omit all IDs (imports distinct player_wy_id+competition_id+season_id combos from player_careers; resumable).",
"tags": [
"Import"
],
"summary": "Import player advanced stats from Wyscout",
"parameters": [
{
"type": "integer",
"description": "Wyscout player ID (optional; omit for batch/auto modes)",
"name": "playerWyId",
"in": "query"
},
{
"type": "integer",
"description": "Wyscout competition ID (required for single/batch; omit for auto mode)",
"name": "competitionId",
"in": "query"
},
{
"type": "integer",
"description": "Wyscout season ID (required for single/batch; omit for auto mode)",
"name": "seasonId",
"in": "query"
},
{
"type": "integer",
"description": "Optional limit on number of requests (batch: players; auto: combos)",
"description": "Auto mode only: reset checkpoint and restart from beginning",
"name": "reset",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/import/players/career": {
"post": {
"description": "Fetches /v3/players/{playerWyId}/career for players already present in the DB (players.wy_id not null). Upserts records into player_careers.",
...
...
@@ -1457,6 +1531,74 @@ const docTemplate = `{
}
}
},
"/import/teams/career": {
"post": {
"description": "Fetches /v3/teams/{teamWyId}/career?details=competition,season for teams in the DB (teams.wy_id not null) plus teams referenced in team_children. Upserts records into team_careers.",
"tags": [
"Import"
],
"summary": "Import team career stats from Wyscout",
"parameters": [
{
"type": "integer",
"description": "Process only one Wyscout team wy_id",
"name": "teamWyId",
"in": "query"
},
{
"type": "integer",
"description": "Limit number of teams processed when teamWyId is omitted",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Concurrent workers (default 8)",
"name": "workers",
"in": "query"
},
{
"type": "integer",
"description": "DB batch size for reading team IDs (default 2000)",
"description": "Fetches /v3/teams/{wyId} for a specific team (or for teams in DB when wyId is omitted) and stores imageDataURL on the team and its children.",
...
...
@@ -1888,6 +2030,12 @@ const docTemplate = `{
"in": "query"
},
{
"type": "string",
"description": "Filter players by gender (male/female)",
"name": "gender",
"in": "query"
},
{
"type": "array",
"items": {
"type": "string"
...
...
@@ -2080,6 +2228,102 @@ const docTemplate = `{
}
}
},
"/players/wyscout/{wyId}/advancedpositions": {
"get": {
"description": "Returns the positions played by season for a player, plus an average distribution across the last 5 seasons.",
"tags": [
"Players"
],
"summary": "Get player advanced positions",
"parameters": [
{
"type": "integer",
"description": "Wyscout player wy_id",
"name": "wyId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/players/wyscout/{wyId}/advancedstats": {
"get": {
"description": "Returns player advanced stats averages: anchor season average, last 2 years average, last 5 years average. If seasonId is omitted, the latest season found for the player is used as anchor.",
"tags": [
"Players"
],
"summary": "Get player advanced stats averages",
"parameters": [
{
"type": "integer",
"description": "Wyscout player wy_id",
"name": "wyId",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Anchor season wy_id (optional; defaults to latest season available)",
"name": "seasonId",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/players/{id}": {
"get": {
"description": "Returns a single player by its internal ID.",
...
...
@@ -2646,6 +2890,42 @@ const docTemplate = `{
"description": "Number of items to skip before starting to collect the result set (default 0)",
"name": "offset",
"in": "query"
},
{
"type": "string",
"description": "Filter teams by name",
"name": "name",
"in": "query"
},
{
"type": "string",
"description": "Filter teams by gender (male/female)",
"name": "gender",
"in": "query"
},
{
"type": "string",
"description": "Filter teams by type (club/national)",
"name": "teamType",
"in": "query"
},
{
"type": "string",
"description": "Alias for teamType (club/national)",
"name": "type",
"in": "query"
},
{
"type": "string",
"description": "If truthy, filter teams by type=club",
"name": "club",
"in": "query"
},
{
"type": "string",
"description": "If truthy, filter teams by type=national",
"description":"Single: provide playerWyId+competitionId+seasonId. Batch: omit playerWyId (imports all players for that competition+season). Auto: omit all IDs (imports distinct player_wy_id+competition_id+season_id combos from player_careers; resumable).",
"tags":[
"Import"
],
"summary":"Import player advanced stats from Wyscout",
"parameters":[
{
"type":"integer",
"description":"Wyscout player ID (optional; omit for batch/auto modes)",
"name":"playerWyId",
"in":"query"
},
{
"type":"integer",
"description":"Wyscout competition ID (required for single/batch; omit for auto mode)",
"name":"competitionId",
"in":"query"
},
{
"type":"integer",
"description":"Wyscout season ID (required for single/batch; omit for auto mode)",
"name":"seasonId",
"in":"query"
},
{
"type":"integer",
"description":"Optional limit on number of requests (batch: players; auto: combos)",
"description":"Auto mode only: reset checkpoint and restart from beginning",
"name":"reset",
"in":"query"
}
],
"responses":{
"200":{
"description":"OK",
"schema":{
"type":"object",
"additionalProperties":true
}
},
"400":{
"description":"Bad Request",
"schema":{
"type":"object",
"additionalProperties":{
"type":"string"
}
}
},
"500":{
"description":"Internal Server Error",
"schema":{
"type":"object",
"additionalProperties":{
"type":"string"
}
}
}
}
}
},
"/import/players/career":{
"post":{
"description":"Fetches /v3/players/{playerWyId}/career for players already present in the DB (players.wy_id not null). Upserts records into player_careers.",
...
...
@@ -1450,6 +1524,74 @@
}
}
},
"/import/teams/career":{
"post":{
"description":"Fetches /v3/teams/{teamWyId}/career?details=competition,season for teams in the DB (teams.wy_id not null) plus teams referenced in team_children. Upserts records into team_careers.",
"tags":[
"Import"
],
"summary":"Import team career stats from Wyscout",
"parameters":[
{
"type":"integer",
"description":"Process only one Wyscout team wy_id",
"name":"teamWyId",
"in":"query"
},
{
"type":"integer",
"description":"Limit number of teams processed when teamWyId is omitted",
"name":"limit",
"in":"query"
},
{
"type":"integer",
"description":"Concurrent workers (default 8)",
"name":"workers",
"in":"query"
},
{
"type":"integer",
"description":"DB batch size for reading team IDs (default 2000)",
"description":"Fetches /v3/teams/{wyId} for a specific team (or for teams in DB when wyId is omitted) and stores imageDataURL on the team and its children.",
...
...
@@ -1881,6 +2023,12 @@
"in":"query"
},
{
"type":"string",
"description":"Filter players by gender (male/female)",
"name":"gender",
"in":"query"
},
{
"type":"array",
"items":{
"type":"string"
...
...
@@ -2073,6 +2221,102 @@
}
}
},
"/players/wyscout/{wyId}/advancedpositions":{
"get":{
"description":"Returns the positions played by season for a player, plus an average distribution across the last 5 seasons.",
"tags":[
"Players"
],
"summary":"Get player advanced positions",
"parameters":[
{
"type":"integer",
"description":"Wyscout player wy_id",
"name":"wyId",
"in":"path",
"required":true
}
],
"responses":{
"200":{
"description":"OK",
"schema":{
"type":"object",
"additionalProperties":true
}
},
"400":{
"description":"Bad Request",
"schema":{
"type":"object",
"additionalProperties":{
"type":"string"
}
}
},
"500":{
"description":"Internal Server Error",
"schema":{
"type":"object",
"additionalProperties":{
"type":"string"
}
}
}
}
}
},
"/players/wyscout/{wyId}/advancedstats":{
"get":{
"description":"Returns player advanced stats averages: anchor season average, last 2 years average, last 5 years average. If seasonId is omitted, the latest season found for the player is used as anchor.",
"tags":[
"Players"
],
"summary":"Get player advanced stats averages",
"parameters":[
{
"type":"integer",
"description":"Wyscout player wy_id",
"name":"wyId",
"in":"path",
"required":true
},
{
"type":"integer",
"description":"Anchor season wy_id (optional; defaults to latest season available)",
"name":"seasonId",
"in":"query"
}
],
"responses":{
"200":{
"description":"OK",
"schema":{
"type":"object",
"additionalProperties":true
}
},
"400":{
"description":"Bad Request",
"schema":{
"type":"object",
"additionalProperties":{
"type":"string"
}
}
},
"500":{
"description":"Internal Server Error",
"schema":{
"type":"object",
"additionalProperties":{
"type":"string"
}
}
}
}
}
},
"/players/{id}":{
"get":{
"description":"Returns a single player by its internal ID.",
...
...
@@ -2639,6 +2883,42 @@
"description":"Number of items to skip before starting to collect the result set (default 0)",
"name":"offset",
"in":"query"
},
{
"type":"string",
"description":"Filter teams by name",
"name":"name",
"in":"query"
},
{
"type":"string",
"description":"Filter teams by gender (male/female)",
"name":"gender",
"in":"query"
},
{
"type":"string",
"description":"Filter teams by type (club/national)",
"name":"teamType",
"in":"query"
},
{
"type":"string",
"description":"Alias for teamType (club/national)",
"name":"type",
"in":"query"
},
{
"type":"string",
"description":"If truthy, filter teams by type=club",
"name":"club",
"in":"query"
},
{
"type":"string",
"description":"If truthy, filter teams by type=national",
// GetAdvancedStatsAverages returns aggregated advanced stats for a player.
// @Summary Get player advanced stats averages
// @Description Returns player advanced stats averages: anchor season average, last 2 years average, last 5 years average. If seasonId is omitted, the latest season found for the player is used as anchor.
// @Tags Players
// @Param wyId path int true "Wyscout player wy_id"
// @Param seasonId query int false "Anchor season wy_id (optional; defaults to latest season available)"