A plugin providing live football match data and league standings integration for ElizaOS agents.
The Football plugin integrates with the Football-Data.org API to enable ElizaOS agents to fetch live football match information and league standings. It includes actions and utilities to provide real-time football data in conversations.
To install the plugin, use the following command:
pnpm install @elizaos/plugin-football
- Action:
fetchMatchAction
- Retrieves live football match data, including:
- Teams
- Scores
- Game events
- Provides real-time updates for ongoing matches.
- Retrieves live football match data, including:
- Action:
fetchStandingsAction
- Fetches league standings for a specified competition, including:
- Team rankings
- Points
- Goals scored
- Other league statistics.
- Fetches league standings for a specified competition, including:
- Extendable for additional football data, such as:
- Player statistics
- Match schedules
- Historical match data.
To use this plugin, you need an API key from Football-Data.org.
-
Register and obtain your API key from Football-Data.org.
-
Add the API key to your
.env
file:FOOTBALL_API_KEY=your_api_key_here
The plugin will use this key to authenticate requests.
Description: Retrieves live match data.
Code Example:
import { fetchMatchAction } from "@elizaos/plugin-football";
const result = await fetchMatchAction.handler(runtime, message, state);
console.log(result);
Sample Output:
{
"matches": [
{
"homeTeam": { "name": "Chelsea" },
"awayTeam": { "name": "Arsenal" },
"score": {
"fullTime": { "homeTeam": 1, "awayTeam": 2 }
}
}
]
}
Description: Fetches league standings for a specific competition.
Code Example:
import { fetchStandingsAction } from "@elizaos/plugin-football";
const result = await fetchStandingsAction.handler(runtime, message, state);
console.log(result);
Sample Output:
{
"standings": [
{
"table": [
{
"position": 1,
"team": { "name": "Manchester City" },
"points": 45
},
{ "position": 2, "team": { "name": "Arsenal" }, "points": 42 }
]
}
]
}
-
Clone the repository:
git clone https://github.com/elizaOS/eliza.git
-
Navigate to the
plugin-football
directory and install dependencies:cd packages/plugin-football pnpm install
-
Build the plugin:
pnpm run build
-
Run linting:
pnpm run lint
-
Test the plugin:
pnpm vitest src/tests/match-action.test.ts pnpm vitest src/tests/fetch-standings-action.test.ts
This plugin relies on the following dependency:
@elizaos/core: workspace:*
- Player statistics
- Match schedules and fixtures
- Team information and histories
- Historical match data
- Real-time updates for all supported leagues
- Integration with more competitions (e.g., Champions League, World Cup)
- Improved data formatting for conversational outputs
- Support for additional localization options
- Enhanced API error handling
- Caching for frequently accessed data
- Increased rate-limit compliance for the Football-Data.org API
- Sample applications for plugin usage
- Test suites for advanced football scenarios
- Examples for extending plugin functionality
Contributions are welcome! Please see the CONTRIBUTING.md file for more information.
This plugin integrates with and builds upon several key technologies:
- Football-Data.org Official Football-Data platform API
Special thanks to:
- Special thanks to Football-Data.org for providing the API that powers this plugin.
- The Eliza Core development team.
- The Eliza community for their contributions and feedback
For more information about Football-Data integration capabilities:
This plugin is part of the Eliza project. See the main project repository for license information.