Skip to main content

Build a team page

Written by Pedro Maia

A team page shows one team's season at a glance: its results with wins, draws and losses, and its upcoming matches in every competition it plays in. It is ideal for a club website.

You don't need to be a developer. An AI assistant such as ChatGPT or Claude can build the page for you from the instructions below.

Before you start

  • Your league needs the Gold plan with the API switched on. See Getting started with the API.

  • You need your season ID. How the API works shows how to find it.

  • You need the team's name, written exactly as it appears on your league website.

How to use the prompt

  1. Copy the prompt from the grey box below.

  2. Fill in your details. Replace [MY-SEASON-ID] with your season ID and [MY-TEAM-NAME] with the team's name.

  3. Say how you want it to look. Describe your club colours and style, or attach a screenshot of your website or a design you like. A picture usually works best. If you don't say anything, the AI will pick a plain design.

  4. Paste it into the AI assistant and send it.

  5. Open the file it gives you. Save it, then double-click it to open it in your browser.

  6. Check it against your league website. If something looks wrong, tell the AI in plain words, for example "that match was at home, not away". It will fix it.

The prompt

Before you start, read the LeagueRepublic JSON API specification at https://docs.api.leaguerepublic.com/leaguerepublic-read-api.md. Use only the services, web addresses and field names it describes, and follow its rules on the rate limit, empty values, errors and "road" meaning away. If you cannot open that address, stop and ask me to paste the specification in.

Build me a single web page (one HTML file I can open in my browser) that shows one team's matches for the season. My season ID is [MY-SEASON-ID] and the team is called [MY-TEAM-NAME].

The page should:

1. Find the team's ID from the season's fixtures the first time it loads, then use the Get Fixtures For Team service. Remember the ID so it does not need looking up again.

2. Use the team's name as the title.

3. Split the matches into "Results", newest first, and "Upcoming", soonest first.

4. For each match, show the date, the competition (and the cup round, if there is one), the opponent, whether it was home or away, and the score, with my team’s score first.

5. For results, show W, D or L from the team's point of view. If a match finished level and was decided on penalties, show who won the shoot-out instead of D, with the shoot-out score.

6. Show any extra score detail, such as half-time, in small text. If a match is postponed, show that instead of a time. If a match date has passed but there is no result yet, show "Awaiting result" instead of a time.

7. Do not reload the data more than once a minute.

Keep the design clean and easy to read on a phone. Explain in simple steps how to open and use the file. Ask me if anything is unclear.

Design: [DESCRIBE THE LOOK YOU WANT, OR ATTACH A SCREENSHOT]

If something goes wrong

  • The page says the team can't be found. Check the team name is written exactly as on your league website, and that the team plays in that season.

  • The page shows an error message. Check your season ID, and that the API is switched on for your league.

  • The page doesn't work in the AI's preview window. Many previews can't fetch data from other websites. Save the file and open it in your browser instead.

  • The AI says it can't read the specification. Open the specification address in your browser, select everything, copy it and paste it into the AI.

The full detail of the Get Fixtures For Team service is in the API specification.

Did this answer your question?