Football

FREEMIUM
Verified
By GiulianoCrescimbeni | Updated 21 days ago | Sports
Popularity

9.4 / 10

Latency

15,568ms

Service Level

100%

Health Check

N/A

Back to All Tutorials (1)

How to use the API (Python)

In this tutorial you will see how to properly use the API. We used python but the essentials are the same for every language you choose. In the endpoints section you can find code snippets with example for mostly all the languages.

The API offers a fast and easy way to gets data. Data is given to you in the simplest way possible so you can easily implement it in any of yours project.

Explanation

The base structure of the call is: /{championship}/endpoint/{additional information}

  1. For each call of the API you need to specify a championship to get data from. We recommend to firstly use the “competitions” endpoint so you can get a view of the available ones

  2. The endpoint is the targeted data that you want to gets, for example “news” or “table”

  3. additional informations are explained later in this article

A simple snippets for a request can be like this:

In this example we wanted to know the second position in the Premier League table. As you can see we used the following URL:
https://football98.p.rapidapi.com/premierleague/table/squadposition/2

  1. “premierleague” is the championship that we choose, the format that you have to use is the same used in the “competitions” endpoint.
  2. “table” is the endpoint, in this case we wanted to get the live table of the championship
  3. “squadposition” is an additional parameter, it acts like a filter in the table and it needs an additional information to be specified, in this case the position “2”

As you can see the structure is pretty simple. You can finds a list of all the endpoints, with a description for each endpoint, down below or in the About section.

Documentation

Parameters

championship
The name of the championship that you want to search for;

squadname
The name of the squad you want to search for. You can also digit a bunch of letters, the API will fetch the corresponding results that contain them;

squadposition
This can be a single-digit with the position of the squad that you are searching for in a specific league;

Endpoints

Get a list of all of the championship implemented:
/competitions/

Get all the squads informations in a certain league:
/{championship}/table
Example: /premierleague/table

Get a single squad by its name:
/{championship}/squadname/{squadname}
Example: /ligue1/squadname/brest

Get a single squad by its position:
/{championship}/squadposition/{squadposition}
Example: /seriea/squadposition/2

Get results from a championship:
/{championship}/results/
Example: /championsleague/results/

Get fixtures from a championship:
/{championship}/fixtures/
Example: /championsleague/fixtures/

Get all the recent news from a championship:
/{championship}/news/
Example: /championsleague/news/

Get all the recent transfers from a championship:
/{championship}/transfers/
Example: /seriea/transfers/