# Spain Football Results & Tables (`trovevault/spain-football-results-tables`) Actor

Extracts Spain football matches, scores, standings, teams, points, and rounds. Export data, run via API, schedule and monitor runs, or integrate with other tools.

- **URL**: https://apify.com/trovevault/spain-football-results-tables.md
- **Developed by:** [Trove Vault](https://apify.com/trovevault) (community)
- **Categories:** Automation, News, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.85 / 1,000 match or league standings

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

### What does Spain Football Results & Tables do?

Spain Football Results & Tables returns structured **Spanish football match results and league tables** for selected domestic competitions. It focuses on supported league competitions only: La Liga, Segunda División.

The actor is useful as a lightweight Spanish football API alternative when you need clean rows for dashboards, spreadsheets, scheduled updates, reporting workflows, or downstream data pipelines.

### Why use Spain Football Results & Tables?

Use this actor when you need Spanish football data in a consistent dataset instead of manually checking separate competition pages. You can select several competitions in one run, limit match output to a specific round or matchday, and return matches and calculated standings as two separate output tables.

Main capabilities:

- Retrieve fixtures, dates, teams, scores, status, and winners.
- Calculate standings from completed full-time results.
- Compare supported Spanish competitions in one normalized format.
- Schedule matchday runs on Apify and export data through the API.
- Append results into an existing Apify dataset with `datasetId`.
- Add your own workflow identifier with `runId`.

### What data can it extract?

| Field | Type | Description |
|---|---:|---|
| `leagueName` | string | Spain competition name |
| `competitionType` | string | `league` |
| `competitionGender` | string | `men` |
| `country` | string | Spain |
| `season` | number | Season start year |
| `round` | number | Matchday when available |
| `matchDate` | string | Match date in ISO 8601 format |
| `homeTeam`, `awayTeam` | string | Teams for match rows |
| `homeScore`, `awayScore` | number | Full-time score when available |
| `winner` | string | `home`, `away`, `draw`, or empty |
| `position`, `teamName`, `points` | number/string | Standing row fields |
| `played`, `won`, `drawn`, `lost` | number | League record |
| `goalsFor`, `goalsAgainst`, `goalDifference` | number | League-table goal fields |

### Supported Spain competitions

The dropdown currently supports:

- La Liga
- Segunda División

This actor does not currently include cups, European competitions, youth leagues, or women's leagues because the free no-key dataset coverage is not stable enough for this launch scope.

### Use cases

- Build Spanish football dashboards and matchday trackers.
- Keep spreadsheets of Spanish league results.
- Feed editorial tools with structured score and table data.
- Compare selected Spanish competitions in one normalized output.
- Schedule daily or matchday updates through Apify.
- Combine this dataset with club, attendance, media, or market workflows where legally permitted.

### How to use it

1. Open the actor input tab.
2. Choose one or more Spain competitions from the Competitions dropdown.
3. Set the season start year, for example `2025` for 2025/2026.
4. Optionally set Round to retrieve only one matchday.
5. Keep Include Matches enabled for fixtures and scores.
6. Keep Include Standings enabled when you want calculated league tables.
7. Run the actor and download the Matches and Standings tables as JSON, CSV, Excel, XML, or HTML.

### Input

See the input tab for full configuration options.

Example input:

```json
{
  "leagues": ["la-liga","segunda-division"],
  "season": 2025,
  "round": 1,
  "includeMatches": true,
  "includeStandings": true,
  "maxMatches": 20
}
````

For scheduled matchday updates, set `round` and keep `maxMatches` low. For full-season match exports, leave `round` blank and raise `maxMatches`. Standings rows are calculated from all completed full-time matches available for the selected season, not from the selected round only.

### Output

The actor creates two output tables: **Matches** and **Standings**. You can download each dataset in various formats such as JSON, HTML, CSV, or Excel.

Example output:

```json
[
  {
    "leagueName": "Spain Primera División",
    "competitionType": "league",
    "competitionGender": "men",
    "country": "Spain",
    "season": 2025,
    "round": 1,
    "matchDate": "2025-08-15T00:00:00.000Z",
    "status": "finished",
    "homeTeam": "Girona FC",
    "awayTeam": "Rayo Vallecano de Madrid",
    "homeScore": 1,
    "awayScore": 3,
    "winner": "away"
  },
  {
    "leagueName": "Spain Primera División",
    "competitionType": "league",
    "competitionGender": "men",
    "country": "Spain",
    "season": 2025,
    "position": 1,
    "teamName": "FC Barcelona",
    "played": 34,
    "won": 22,
    "drawn": 7,
    "lost": 5,
    "goalsFor": 64,
    "goalsAgainst": 26,
    "goalDifference": 38,
    "points": 73
  }
]
```

### API usage example

```bash
curl "https://api.apify.com/v2/acts/trovevault~spain-football-results-tables/runs?waitForFinish=120" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "leagues": ["la-liga","segunda-division"],
    "season": 2025,
    "round": 1,
    "includeMatches": true,
    "includeStandings": true,
    "maxMatches": 20
  }'
```

### Limitations

This actor covers supported Spain domestic league competitions only. It does not include Champions League, Europa League, national-team fixtures, cups, player-level scorer feeds, or unsupported lower divisions in this version.

Standings are calculated from completed full-time match results available in the public dataset. If some recent matches have not been updated yet, the calculated table can lag until the source dataset is updated.

### FAQ

#### Does this actor include Champions League?

No. The scope is supported Spain domestic leagues only.

#### Can I select multiple leagues?

Yes. The Competitions field is a multi-select dropdown.

#### Does the actor include cups?

No. This first version is league-only so that standings remain meaningful.

#### Which season format should I use?

Use the season start year. For example, `2025` means the 2025/2026 season.

#### Can I get only one round?

Yes. Set Round to a matchday number. Standings still use all completed season matches.

#### Does the actor include scorers?

No. This actor is standardized around match results and standings only.

#### Is the output suitable for spreadsheets?

Yes. Matches and standings are separate flat tables that export cleanly to CSV or Excel.

#### Can I append results to an existing dataset?

Yes. Fill `datasetId` to append rows to another Apify dataset in addition to the default run datasets. When both matches and standings are appended to this external dataset, the actor adds `entityType` so downstream workflows can distinguish `match` and `standing` rows.

### Troubleshooting

If a run returns fewer rows than expected, check the selected season and round first. The free JSON dataset coverage for this actor starts at 2012/2013. Older inputs such as 2000 are outside the supported source coverage, and the current season can be incomplete until public data updates land.

If standings do not match the selected round, that is expected: tables are calculated from the full available season, not one historical matchday.

For bugs, missing competitions, or output issues, use the Issues tab on the actor page.

### Related actors

For a similar country-specific actor, see UK Football Results & Tables.

### Changelog

#### 0.1

Initial version with supported Spain football matches and calculated league tables.

# Actor input Schema

## `leagues` (type: `array`):

Spain football competitions to retrieve. The actor fetches season fixtures and results, then calculates standings from completed matches. Select one league for a compact run or several competitions to compare supported domestic leagues in one run. Only supported competitions from the dropdown are processed.

## `season` (type: `integer`):

Season start year to retrieve. Spain football seasons use the first year of the season, so 2025 means the 2025/2026 season for supported competitions. Use a recent year such as 2024 or 2025 for the most complete data. The free JSON dataset coverage for this actor starts at 2012/2013. Older API inputs are rejected by the input schema or handled gracefully as no-result runs when no source file exists.

## `round` (type: `integer`):

Optional round or matchday number to retrieve for match rows. When filled, the actor returns only that matchday, for example 1 for opening matchday. Leave blank to retrieve all matches in the selected season. Standings are calculated from all completed matches available for the season, not from the selected round only.

## `includeMatches` (type: `boolean`):

Whether to return match rows with teams, dates, scores, status, winner, and round. Disable this only when you need league tables without fixtures. Recommended: keep enabled for matchday feeds and dashboards.

## `includeStandings` (type: `boolean`):

Whether to calculate and return standings rows for selected league competitions. The table is calculated from completed full-time results in the selected season. Disable this to reduce output size when you only need fixtures and scores.

## `maxMatches` (type: `integer`):

Maximum match rows to return for each selected competition after round filtering. Higher values give a fuller season dataset but produce more rows and take longer. Use 10 to 20 for testing or matchday updates, and 600 for full league seasons.

## `datasetId` (type: `string`):

ID of an existing Apify dataset to append results to, in addition to the default run datasets. Leave blank to use only the default Matches and Standings outputs. Use this when chaining scheduled Spain football updates into a long-lived dashboard dataset.

## `runId` (type: `string`):

ID of an existing Apify actor run or workflow step to associate with output rows. The actor copies this value into each row when provided, which helps connect Spain football results to pipeline runs. Leave blank for standalone runs.

## Actor input object example

```json
{
  "leagues": [
    "la-liga"
  ],
  "season": 2025,
  "includeMatches": true,
  "includeStandings": true,
  "maxMatches": 20
}
```

# Actor output Schema

## `matches` (type: `string`):

No description

## `standings` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "leagues": [
        "la-liga"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("trovevault/spain-football-results-tables").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "leagues": ["la-liga"] }

# Run the Actor and wait for it to finish
run = client.actor("trovevault/spain-football-results-tables").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "leagues": [
    "la-liga"
  ]
}' |
apify call trovevault/spain-football-results-tables --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=trovevault/spain-football-results-tables",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Spain Football Results & Tables",
        "description": "Extracts Spain football matches, scores, standings, teams, points, and rounds. Export data, run via API, schedule and monitor runs, or integrate with other tools.",
        "version": "0.1",
        "x-build-id": "irIKFyTvzXTzbrQUW"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/trovevault~spain-football-results-tables/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-trovevault-spain-football-results-tables",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/trovevault~spain-football-results-tables/runs": {
            "post": {
                "operationId": "runs-sync-trovevault-spain-football-results-tables",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/trovevault~spain-football-results-tables/run-sync": {
            "post": {
                "operationId": "run-sync-trovevault-spain-football-results-tables",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "leagues"
                ],
                "properties": {
                    "leagues": {
                        "title": "Competitions",
                        "type": "array",
                        "description": "Spain football competitions to retrieve. The actor fetches season fixtures and results, then calculates standings from completed matches. Select one league for a compact run or several competitions to compare supported domestic leagues in one run. Only supported competitions from the dropdown are processed.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "la-liga",
                                "segunda-division"
                            ],
                            "enumTitles": [
                                "La Liga",
                                "Segunda División"
                            ]
                        }
                    },
                    "season": {
                        "title": "Season Start Year",
                        "minimum": 2012,
                        "maximum": 2030,
                        "type": "integer",
                        "description": "Season start year to retrieve. Spain football seasons use the first year of the season, so 2025 means the 2025/2026 season for supported competitions. Use a recent year such as 2024 or 2025 for the most complete data. The free JSON dataset coverage for this actor starts at 2012/2013. Older API inputs are rejected by the input schema or handled gracefully as no-result runs when no source file exists.",
                        "default": 2025
                    },
                    "round": {
                        "title": "Round",
                        "minimum": 1,
                        "maximum": 60,
                        "type": "integer",
                        "description": "Optional round or matchday number to retrieve for match rows. When filled, the actor returns only that matchday, for example 1 for opening matchday. Leave blank to retrieve all matches in the selected season. Standings are calculated from all completed matches available for the season, not from the selected round only."
                    },
                    "includeMatches": {
                        "title": "Include Matches",
                        "type": "boolean",
                        "description": "Whether to return match rows with teams, dates, scores, status, winner, and round. Disable this only when you need league tables without fixtures. Recommended: keep enabled for matchday feeds and dashboards.",
                        "default": true
                    },
                    "includeStandings": {
                        "title": "Include Standings",
                        "type": "boolean",
                        "description": "Whether to calculate and return standings rows for selected league competitions. The table is calculated from completed full-time results in the selected season. Disable this to reduce output size when you only need fixtures and scores.",
                        "default": true
                    },
                    "maxMatches": {
                        "title": "Max Matches Per Competition",
                        "minimum": 1,
                        "maximum": 600,
                        "type": "integer",
                        "description": "Maximum match rows to return for each selected competition after round filtering. Higher values give a fuller season dataset but produce more rows and take longer. Use 10 to 20 for testing or matchday updates, and 600 for full league seasons.",
                        "default": 20
                    },
                    "datasetId": {
                        "title": "Dataset ID (optional)",
                        "type": "string",
                        "description": "ID of an existing Apify dataset to append results to, in addition to the default run datasets. Leave blank to use only the default Matches and Standings outputs. Use this when chaining scheduled Spain football updates into a long-lived dashboard dataset."
                    },
                    "runId": {
                        "title": "Run ID (optional)",
                        "type": "string",
                        "description": "ID of an existing Apify actor run or workflow step to associate with output rows. The actor copies this value into each row when provided, which helps connect Spain football results to pipeline runs. Leave blank for standalone runs."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
