API-FOOTBALL

GRATIS CON POSSIBILITÀ DI UPGRADE
Verified
Da API-SPORTS | Aggiornamento 8 days ago | Sports
Popolarità

10 / 10

Latenza

365ms

Livello di servizio

99%

Health Check

N/A

Torna a tutti i tutorial (11)

Widgets

WIDGETS ARE NOW AVAILABLE ON API-FOOTBALL

Our widgets are completely free and work with all our plans including the free plan.

To start we have developed 4 widgets Livescore, Fixtures, Fixture and Standings. Of course others will be developed in the future according to the users’ requests.

See example here : https://www.api-football.com/widgets

HOW IT WORKS

To integrate the widgets to your site you just have to copy/paste the code provided and fill in the tags needed for the widget to work properly.
If you integrate several widgets on the same page a single theme will be applied for all widgets. Also you will only have to integrate the <script> tag once.

For all widgets the following tags are needed :

REQUIRED TAGS Details
data-host api-football-v1.p.rapidapi.com
data-key Indicate your API-KEY obtained on our Dashboard or on RapidApi.
data-theme If you leave the field empty, the default theme will be applied, otherwise the possible values are grey or dark. It is also possible to indicate false which will not display any theme and lets you customize the widget with your own css.
data-show-errors By default false, used for debugging, with a value of true it allows to display the errors.

Debugging

If the widget does not display the requested information, it is possible to set the data-show-errorstag to true to display error messages directly in the widget and in the console. This can be due to several things like : (Non-exhaustive list)

  • You have reached your daily number of requests
  • Tags are incorrectly filled in
  • Your API-KEY is incorrect

Versions

1.0.0 : Starting version with widgets Livescore Fixtures and Standings
1.1.8 : Adding the widget Fixture and the possibility to load a modal containing the details of a fixture in the widgets Livescore and Fixtures

LIVESCORE

Displays the list of current matches grouped by competition. The matches that start are automatically added and those that end are automatically removed.

TAGS Details
data-refresh Number in seconds corresponding to the desired data update frequency. This number must be greater than or equal to at least 15. If you indicate 0 or leave this field empty the data will not be updated automatically.
<div id="wg-api-football-livescore"
     data-host="api-football-v1.p.rapidapi.com"
     data-refresh="60"
     data-key="Your-Api-Key-Here"
     data-theme=""
     data-show-errors="false"
     class="api_football_loader">
</div>
<script
    type="module"
    src="https://widgets.api-sports.io/football/1.1.8/widget.js">
</script>

That’s all, the scores will be displayed and updated automatically.

FIXTURES

Displays the list of matches grouped by competition according to the parameters used. The matches are automatically updated according to the selected frequency data-refresh.

TAGS Details
data-refresh Number in seconds corresponding to the desired data update frequency. This number must be greater than or equal to at least 15. If you indicate 0 or leave this field empty the data will not be updated automatically.
data-date Fill in the desired date YYYY-MM-DD
data-league Fill in the desired league id
data-team Fill in the desired team id
data-season Fill in the desired season
data-last Number from 1 to 99. For the X last fixtures
data-next Number from 1 to 99. For the X next fixtures

Please refer to the documentation about this endpoint and the use of the parameters. Documentation.

It is possible to find all the leagues and teams ids on our Dashboard.

<div id="wg-api-football-fixtures"
    data-host="api-football-v1.p.rapidapi.com"
    data-refresh="60"
    data-date="2021-06-30"
    data-league=""
    data-team=""
    data-season=""
    data-last=""
    data-next=""
    data-key="Your-Api-Key-Here"
    data-theme=""
    data-show-errors="false"
    class="api_football_loader">
</div>
<script
    type="module"
    src="https://widgets.api-sports.io/football/1.1.8/widget.js">
</script>

FIXTURE

Display a specific fixture as well as events, statistics, lineups and players statistics if they are available. The fixture is automatically updated according to the selected frequency data-refresh.

TAGS Details
data-refresh Number in seconds corresponding to the desired data update frequency. This number must be greater than or equal to at least 15. If you indicate 0 or leave this field empty the data will not be updated automatically.
data-id Fill in the desired fixture id
<div id="wg-api-football-fixture"
    data-host="api-football-v1.p.rapidapi.com"
    data-refresh="60"
    data-id="718243"
    data-key="Your-Api-Key-Here"
    data-theme=""
    data-show-errors="false"
    class="api_football_loader">
</div>
<script
    type="module"
    src="https://widgets.api-sports.io/football/1.1.8/widget.js">
</script>

STANDINGS

Displays the ranking of a competition or a team according to the parameters used.

TAGS Details
data-league Fill in the desired league id
data-team Fill in the desired team id
data-season Fill in the desired season

It is possible to find all the leagues and teams ids on our Dashboard.

<div id="wg-api-football-standings"
     data-host="api-football-v1.p.rapidapi.com"
     data-league="39"
     data-team=""
     data-season="2020"
     data-key="Your-Api-Key-Here"
     data-theme=""
     data-show-errors="false"
     class="api_football_loader"></div>
<script
    type="module"
    src="https://widgets.api-sports.io/football/1.1.8/widget.js">
</script>