> For the complete documentation index, see [llms.txt](https://docs.sportmonks.com/v3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportmonks.com/v3/sportmonks-ai-docs/vibe-coding.md).

# Vibe Coding

Describe what you want to build. Let the AI write the code. Ship it.

This page gives you everything you need to build with the Sportmonks Football API using any AI coding tool - the right context, and ready-to-run prompts for common football data builds.

### Give your AI the right context

For the AI to write accurate Sportmonks integration code, it needs to know the API. Pick one of the options below and give it to your AI tool before you start building.

#### llms.txt - full documentation index

Sportmonks publishes a machine-readable index of all its APIs at:

```
https://docs.sportmonks.com/llms.txt
```

Paste this URL into Claude, ChatGPT, or Cursor and ask it to fetch the content. This gives the AI a broad picture of every Sportmonks API before you start.

#### Context block - Football API quick reference

For faster setup, paste this directly into your session:

```
Sportmonks Football API v3

Base URL: https://api.sportmonks.com/v3/football
Auth: ?api_token=YOUR_TOKEN (query parameter on every request)

Key endpoints:
GET /players/search/{query}
GET /teams/search/{query}
GET /leagues/search/{query}
GET /fixtures/{id}
GET /fixtures/date/{date}
GET /livescores/inplay
GET /squads/teams/{team_id}
GET /standings/live/leagues/{league_id}
GET /topscorers/seasons/{season_id}

Includes: semicolon-separated (e.g. include=participants;scores;league;state)
Filters: key:value syntax (e.g. filters=fixtureLeagues:8)
Pagination: ?page=1&per_page=25

Docs: https://docs.sportmonks.com/football
```

For a more complete reference with all endpoints, includes, filters, and common IDs, see the full context block.

#### Cursor Rules or Copilot instructions

If you use Cursor or GitHub Copilot, you can make the API knowledge persistent across your whole project - no need to paste context every session.

* Cursor Rules
* GitHub Copilot instructions

### Build prompts

Each prompt below is ready to paste into your AI tool. They're written to produce working code against the real API - not mock data.

> **Note:** These prompts guide the AI to write code that calls the Sportmonks API directly from your application. This is different from the MCP server, which is a companion tool for exploring data conversationally - not for generating application code.

#### Live score dashboard

A real-time dashboard that polls for in-play matches and updates every 30 seconds.

```
I'm building with the Sportmonks Football API v3.
Base URL: https://api.sportmonks.com/v3/football
Auth: api_token query parameter, read from SPORTMONKS_API_TOKEN env var.

Build a live score dashboard:
- Fetch in-play matches from GET /livescores/inplay?include=participants;scores;state;periods
- Display each match as a card: home team, away team, current score, match state (1H/HT/2H), elapsed minutes
- Poll every 30 seconds and update without a full page reload
- Show a "No live matches right now" empty state when the feed is empty

Use React and Tailwind CSS.
First, fetch a real sample response from the endpoint and print the raw JSON so we can confirm the data shape before writing any UI.
```

#### Pre-match briefing card

Given a fixture ID, generate a briefing with team details, head-to-head history, and current league positions.

```
I'm building with the Sportmonks Football API v3.
Base URL: https://api.sportmonks.com/v3/football
Auth: api_token query parameter, read from SPORTMONKS_API_TOKEN env var.

Build a pre-match briefing generator:
1. Accept a fixture ID as input
2. Fetch the fixture: GET /fixtures/{id}?include=participants;league;state
3. Extract the two team IDs from participants, then fetch: GET /fixtures/head-to-head/{team1_id}/{team2_id}?per_page=5&order=desc&include=participants;scores
4. Fetch current standings: GET /standings/live/leagues/{league_id}?include=participant;details

Render a briefing card showing:
- Match title, kick-off time, competition name
- Last 5 H2H results as a compact table (date, result, score)
- Current league position for each team (position, played, points)

Use Next.js with Tailwind. Accept the fixture ID as a URL param (/briefing?fixture=123456).
Start by printing the raw API responses for fixture 19135697 before writing any UI.
```

#### Squad viewer

Search for any team by name and browse their current squad grouped by position.

```
I'm building with the Sportmonks Football API v3.
Base URL: https://api.sportmonks.com/v3/football
Auth: api_token query parameter, read from SPORTMONKS_API_TOKEN env var.

Build a squad viewer:
1. A search input that calls GET /teams/search/{query} and shows results as a clickable list
2. On team select, fetch: GET /squads/teams/{team_id}?include=player;position;detailedPosition
3. Display the squad grouped by position (Goalkeepers, Defenders, Midfielders, Attackers), each player showing name, jersey number, and detailed position

Use React and Tailwind.
First fetch team_id 85 (Arsenal) squad and print the raw JSON to confirm the response shape before building the UI.
```

#### Top scorers leaderboard

A season leaderboard for goals, assists, or yellow cards with a toggle to switch between them.

```
I'm building with the Sportmonks Football API v3.
Base URL: https://api.sportmonks.com/v3/football
Auth: api_token query parameter, read from SPORTMONKS_API_TOKEN env var.

Build a top scorers leaderboard:
1. On load, fetch the Premier League's current season: GET /leagues/8?include=currentseason
2. Fetch the top 25 goal scorers: GET /topscorers/seasons/{season_id}?include=player;participant;type&filters=seasonTopscorerTypes:208&per_page=25
3. Show a ranked table: position, player name, team, count
4. Add a toggle between goals (type 208), assists (type 209), and yellow cards (type 84) - re-fetch on switch

Use React and Tailwind. Show a skeleton loader while fetching.
Start by printing the league and topscorers responses before writing any UI.
```

#### Discord match alert bot

A Node.js script that posts to Discord when a match kicks off or ends.

```
I'm building with the Sportmonks Football API v3.
Base URL: https://api.sportmonks.com/v3/football
Auth: api_token query parameter, read from SPORTMONKS_API_TOKEN env var.

Build a Discord alert bot in Node.js:
1. Poll GET /livescores/inplay?include=participants;scores;state every 60 seconds
2. Track which fixture IDs have already been announced in memory
3. New match in the feed: post "🟢 KICK OFF: {home} vs {away}" to Discord
4. Match disappears from feed: post "⏹ FULL TIME: {home} {score} {away}"
5. Read SPORTMONKS_API_TOKEN and DISCORD_WEBHOOK_URL from environment variables

Single index.js file, no framework. Use node-fetch for HTTP and the Discord webhook API for posting.
```

### Tips

* **Fetch real data first.** Every prompt above asks the AI to print the raw API response before building UI. This prevents the AI from guessing the wrong response shape.
* **Search before you hardcode.** Ask the AI to use the search endpoints to resolve names to IDs rather than hardcoding them.
* **Iterate in plain English.** Once there's a working base, describe changes conversationally - "group players by position", "add a loading skeleton", "make the cards darker".
* **Use the full context block for complex builds.** For anything beyond a single endpoint, paste the full context so the AI knows the complete include and filter syntax upfront.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sportmonks.com/v3/sportmonks-ai-docs/vibe-coding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
