home / skills / openclaw / skills / the-sports-db

the-sports-db skill

/skills/gumadeiras/the-sports-db

This skill helps you fetch and monitor sports data from TheSportsDB, including team lookups and recent or upcoming events.

npx playbooks add skill openclaw/skills --skill the-sports-db

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
853 B
---
name: the-sports-db
description: Access sports data via TheSportsDB (teams, events, scores).
metadata: {"clawdbot":{"emoji":"🏟️","requires":{"env":["THE_SPORTS_DB_KEY"]}}}
---

# TheSportsDB

Free sports database.

## Configuration
Ensure `THE_SPORTS_DB_KEY` is set in `~/.clawdbot/.env`. (Default test key is often `123` or `3`).

## Usage

### Search Team
```bash
curl -s "https://www.thesportsdb.com/api/v1/json/$THE_SPORTS_DB_KEY/searchteams.php?t=Palmeiras"
```

### Last Events (Scores)
Get last 5 events for a team ID:
```bash
curl -s "https://www.thesportsdb.com/api/v1/json/$THE_SPORTS_DB_KEY/eventslast.php?id=134465"
```

### Next Events (Fixtures)
Get next 5 events for a team ID:
```bash
curl -s "https://www.thesportsdb.com/api/v1/json/$THE_SPORTS_DB_KEY/eventsnext.php?id=134465"
```

**Note:** Rate limit is 30 requests/minute.

Overview

This skill provides programmatic access to TheSportsDB to fetch teams, events, and scores. It connects to the public API and exposes endpoints for searching teams, retrieving recent match results, and pulling upcoming fixtures. Configure an API key to use in automated scripts or integrations.

How this skill works

The skill queries TheSportsDB HTTP API using an API key stored in a local environment file. It supports team search, last events (recent scores) and next events (upcoming fixtures) by team ID, returning JSON responses you can parse or forward. Rate limiting is enforced by TheSportsDB, so clients should throttle requests accordingly.

When to use it

  • Looking up team metadata and details by name.
  • Fetching the last N matches and final scores for a team.
  • Pulling the next N scheduled fixtures for planning or display.
  • Populating sports dashboards or live-score widgets.
  • Building chatbots or assistants that answer sports queries.

Best practices

  • Set THE_SPORTS_DB_KEY in ~/.clawdbot/.env and avoid hardcoding keys.
  • Cache responses (especially team and fixtures data) to reduce API calls.
  • Respect the rate limit (30 requests/minute) and implement retry/backoff.
  • Use the public test key only for development; switch to a registered key for production.
  • Validate and sanitize API responses before displaying to users.

Example use cases

  • Search for a team by name and display its stadium, formed year and badge.
  • Fetch the last 5 events for a team ID to show recent score history.
  • Retrieve the next 5 fixtures for a team ID to power a schedule view.
  • Feed match data into a live scoreboard or notification system.
  • Aggregate team stats for a fantasy league or scouting tool.

FAQ

Where do I set the API key?

Set THE_SPORTS_DB_KEY in ~/.clawdbot/.env so scripts can read it at runtime.

Is there a rate limit?

Yes. TheSportsDB enforces about 30 requests per minute, so throttle or cache requests.

Can I use the default test key in production?

No. Default test keys are for development only; obtain a proper key for production use.