Skip to main content

Build a league table

Written by Pedro Maia

A league table page shows the standings for each division in your league, with a menu to switch between them. You can use it on its own, or put it on your website next to your news.

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

How to use the prompt

  1. Copy the prompt from the grey box below.

  2. Fill in your season ID. Replace [MY-SEASON-ID] with your own number.

  3. Say how you want it to look. Describe your 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 "the points column is missing". 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 my league's tables. My season ID is [MY-SEASON-ID].

The page should:

1. Use the Get Fixture Groups For Season service to list the season's divisions, and show them in a menu. Open on the first division.

2. When I pick a division, show its table using the Get Standings For Fixture Group service. Only load a division when I pick it.

3. Show position, team, played, won, drawn, lost, score for, score against, difference and points, plus recent form as small coloured badges (won, drawn, lost).

4. List the cups in the menu too, but only check a cup for tables when I pick it. If it is played in groups, show one table for each group with the group's name above it. If it has no tables, say so.

5. Let me tap a team to highlight its row.

6. On a phone, keep position, team, played, difference and points, and hide the other columns.

7. Save each table after loading it, and do not ask for the same one again within 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

  • A division's table is all zeros. That division hasn't played any matches yet. It fills in once results are entered.

  • A division is missing. Divisions with their tables hidden on your league website are hidden here too.

  • 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 services used here is in the API specification.

Did this answer your question?