Live tennis scores, rankings and fixtures inside Slack — a plugin for Slack Machine.
Data source disclosure: this plugin is built and maintained by the Live Tennis API team and talks to the Live Tennis API. A free key (live scores, match state, players with ranking & Elo, fixtures — 30 req/min, 100/day, no card required) is available at https://livetennisapi.com/subscribe/free.
/tennis live— matches in progress right now, with score, who's serving, and break-point / retirement / walkover flags/tennis rankings— top ranked players, with Elo/tennis player <name>— a player's ranking and Elo/tennis next— upcoming fixtures- Natural language: mention the bot with
tennis live,tennis player alcaraz, … - Graceful handling of a missing key, a rejected key (401), rate limits (429), and empty results
Using uv:
uv add slack-machine-livetennisUsing pip (add to your bot's requirements.txt):
slack-machine-livetennis
Add the plugin to the PLUGINS list in your bot's local_settings.py, and
provide your Live Tennis API key as the LIVETENNIS_API_KEY setting:
PLUGINS = [
"machine.plugins.builtin.general.HelloPlugin",
"machine.plugins.builtin.help.HelpPlugin",
"sm_livetennis.LiveTennis",
]
SLACK_APP_TOKEN = "xapp-..."
SLACK_BOT_TOKEN = "xoxb-..."
# Get a free key at https://livetennisapi.com/subscribe/free
LIVETENNIS_API_KEY = "your-key-here"Settings can also come from the environment using Slack Machine's SM_ prefix
convention, so the following is equivalent to the setting above:
export SM_LIVETENNIS_API_KEY="your-key-here"You need a Slack app configured with a slash command /tennis pointing at your
bot (Socket Mode), plus the usual Slack Machine bot scopes. See the
Slack Machine docs for setup.
| Setting | Default | Purpose |
|---|---|---|
LIVETENNIS_API_KEY |
(required at runtime) | Your Live Tennis API key |
LIVETENNIS_BASE_URL |
https://api.livetennisapi.com/api/public/v1 |
Override the API base URL |
/tennis live
/tennis rankings
/tennis player alcaraz
/tennis next
/tennis help
Or mention the bot:
@yourbot tennis live
@yourbot tennis player sinner
uv sync # or: pip install -e ".[test]"
pytest # unit tests, fully mocked — no networkTests mock all HTTP with respx and never
hit the network.