Skip to main content

How the API works

This article explains the basics of the LeagueRepublic API in plain English. You don't need any technical knowledge to follow it.

Written by Pedro Maia

Who can use it?

Leagues on the Gold plan that have switched the API on. To switch it on, go to Admin Home > API > API Settings and tick Enable JSON API. If either is missing, every web address in these articles returns an error instead of your data.

What is it?

The API lets another website, app or program read your league's fixtures, results and tables straight from LeagueRepublic. Think of it like a waiter: your website asks for something ("today's matches, please"), and LeagueRepublic brings back the answer.

How do you ask?

You visit a web address, just like opening a web page. Instead of a nice-looking page, you get back plain text in a format called JSON. Your web developer's code, or a page made by an AI assistant, reads that text and turns it into whatever you design.

What does JSON look like?

It is a list of labels and values, a bit like a form that has been filled in:

{ "homeTeamName": "Arthurlie", "homeScore": "2" }

The word before the colon is the field name (the label on the form). The bit after it is the value (what was written in the box). The API specification explains what every field name means.

What is an ID?

Every league, season, division, team and match in LeagueRepublic has its own number, called an ID. It works like a membership number: it never changes, and no two things share one. You put IDs into the web address to say which season or team you want.

How do I find my IDs?

Your league ID is shown on Admin Home > API > API Settings.

Your season ID: open this address in your browser, with your league ID in place of [MY-LEAGUE-ID]. It lists your seasons, each with its ID.

Division and team IDs appear in the lists the API sends back. If you use one of the Build a… articles, the AI assistant looks these up for you.

Is there a limit?

Yes. Each league can only make a certain number of requests a minute, shared by everything that uses your league's data: your website, apps and anything else. A well-made page saves what it loads instead of asking again and again. The API specification gives the exact limit.

A few words you will see

Road – the away team. LeagueRepublic says "road" where most people say "away".

Fixture – a match, whether it has been played yet or not.

Fixture group – a division (such as "Premier Division"), a cup, or another group of matches.

Result – a fixture that has a score.

null – the box is empty. The league did not enter it, or it does not apply.

true / false – yes / no.

Where is the full detail?

Everything exact, such as every field name, the limit and the error messages, is in the API specification:

Did this answer your question?