Football (Soccer) is the most-watched and most played sport in the world. It has an estimated following of 4 billion people. According to FIFA, the 2018 world cup final reached an average audience of 1.12 billion people across the world.
With the evolution of technology, the way we watch television has also been changing for a number of years. The traditional linear experience is now replaced by modern alternatives.
Smart TVs are becoming the new norm as they provide a full-blown interactive entertainment experience, access to information using interactive apps, live-streaming, and easy access to on-demand content. Smartphone usage continues to grow, the number of apps in the sports industry is also increasing. As per this study, smart phone users spend 50 minutes each day on sports apps. The total addressable market for sports apps is estimated to be around $1.54 billion and is growing fast.
Many developers and sports enthusiasts are riding this wave by developing football applications and launching them for the mass market. However, you would need a trusted and reliable data partner that can not only provide you the high-quality data but should also have the tools for seamless integration.
Look no further than Football Pro API – The most reliable football data partner (trusted by 20k+ customers). It covers 1200+ leagues and provides lightning-fast live scores (15 seconds faster compared to other providers).
In this article, we will explore in detail What Football Pro API IS, Its Endpoints, Usage and Benefits. We will also explore how it can be integrated with any mobile and web applications using various programming languages.
Note: If you are new to the APIs, It’s recommended to go through this post before we dive into the details.
What is Football Pro API?
The Football Pro API is an Application Programmable Interface that allows developers and football enthusiasts to create high-quality sports applications.
It provides a rich feature set such as:
- Live Scores and Schedules.
- Statistics and Line-Ups
- Coverage and Historical Data
- Tv Stations and Highlights
- Bookmakers and Odds
- Standing and Top Scores
It has a well-defined and optimized API structure so you don’t have to execute multiple API requests for the data. The API is developer-friendly as it has the flexibility to build the custom response as per the requirements of your application.
This API has a freemium pricing model where you can make 100 requests per day. You can access all features in the basic plan. However, It does have a rate-limiting of 10 requests per minute. It also offers paid plans which include a higher volume of API requests. There are no exclusive features for specific plans so you only pay for the data you need.
How It Works
Football Pro API provides 40+ endpoints that can be executed over HTTPS using various languages and platforms.
The Client application requests the data by issuing a GET request to one of its endpoints.
The Football Pro API then executes the request and sends back the data in JSON formatted response. For instance, the client may invoke an endpoint to get information about all the leagues using one of its endpoints. The API server then returns a list of all leagues in JSON formatted text in the response body.
Below is the high-level diagram illustrating Football Pro API endpoints in various categories:
Users
Football API Pro can be used by mobile and web application developers to build next-generation football app.
Below are some of the example use cases:
iGaming Users: iGaming is one of the fastest-growing industries. Football Pro API provides several endpoints that can be used to build a high-end betting and gambling platform. Such as providing a list of major bookmakers and markets, or finding an In-play or pre-match odds of winning various bets in any given event.
Media: One of the distinct features of the Football Pro API is its ability to provide live scores in real-time, statistics and pre-match lineups, standings, and top scorers – which can play a crucial role in building a successful football website or application.
Machine Learning Applications: AI/ML Enthusiasts can make use of its endpoints to train their machine learning models; such as getting historical data about any given fixture, player, or team. This can be quite useful in building an AI-based prediction system.
How to Connect to Football Pro API Tutorial – Step by Step
Step1: Signup for an Account on RapidAPI
Let’s create an account on RapidAPI.
You can find and connect to thousands of APIs using one SDK and one API Key.
Step2: Subscribe to the Football Pro API
After successful registration, the next step is to subscribe to the API. Please follow the below steps to subscribe to the Football Pro API.
- Navigate to Football Pro API and Select Pricing Tab
- Select the desired plan and click on the ‘Subscribe’ button. It will take you to the next page where credit card information is entered.
Click on ‘Pay Now’ to complete the transaction and subscribe to the Football Pro API.
Step 3. Test the API Subscription
The last step is to test the API Subscription. Click on the ‘Endpoints’ tab to display all the available endpoints in Football Pro API.
You can test any endpoint and select the code snippet of your favorite programming language.
Note: One of the key benefits of using RapidAPI, is the API Console which provides an easy and interactive way to execute the API Endpoints – without leaving the browser. The API Console will generated the required parameters automatically.
In the below example, we executed the endpoint ‘All Seasons’ which returns the JSON Formatted list of all available seasons.
Note: In case of any failure, the Football Pro API may return one of the following responses:
- 400 Bad Request – Client sent an invalid request (missing required parameters).
- 401 Unauthorized – Failed to authenticate with the API server.
- 403 Forbidden – Client authenticated but doesn’t have permission to access the required resource.
- 404 Not Found – The requested resource (endpoint) doesn’t exist.
- 500 Internal Server Error – A generic error occurred on the API server.
- 503 Service Unavailable – The API service is not available.
Explanation of Football Pro API Endpoints
The API has over 40+ endpoints which are grouped into various categories. In this section, we will discuss them in detail.
Seasons
Endpoint | Purpose | Required Parameters |
Season Schedule | This endpoint can be used to determine if any given season is active or not. It also retrieves full-season games, fixture results, and upcoming fixtures. | Id- The ID of the Season |
Season by ID | It provides details about any given season. The response can be filtered using an optional parameter ‘include’ which simply contains comma-separated values e.g ‘league, stages, rounds’. | Id- The ID of the Season |
All Seasons | This endpoint returns the list of all available seasons | None |
Optional Parameters:
- page – > This parameter can be used to get a paginated result set.
- tz -> Use this parameter to override the default timezone, which is Europe/Amsterdam.
- include -> A list of comma-separated string to enrich the API response.
Teams and Squads
Endpoint | Purpose | Required Parameters |
Active Season by Team ID | Get the list of active seasons of any given Team | Id – The ID of the team |
Teams Squad by Season ID | Get information about the team squad using teamID and seasonID. | TeamID SeasonID |
Team by ID | Get the complete information about the team such as Team Name, Logo, Coach, Venue etc. | Id – Team ID |
Teams by Season ID | Get the list of all teams in a given season | Id – Season ID |
Players and Coaches
Endpoint | Purpose | Required Parameters |
Player by ID | Get the complete information about any given player. This endpoint can be used to build complete player profile. | Id- Player ID |
Coach by ID | Get the detailed information about coach | Id – Coach ID |
Head2Head
Endpoint | Purpose | Required Parameters |
Head 2 head by Team ID | Get the complete overview of the historical games between two teams | TeamA_ID – First Team ID TeamB_ID – Second Team ID |
Rounds
Endpoint | Purpose | Required Parameters |
Rounds by Season ID | Get the data for all rounds in a given season | Id – The id of the season |
Rounds by ID | Get the data for a single round | Id – The Id of the round |
Stages
Endpoint | Purpose | Required Parameters |
Stages by Season ID | Get the multiple stages of a given season | Id – The id of the season |
Stage by ID | Get the detailed information about a given stage of any season | Id – The id of the stage |
Standings
Endpoint | Purpose | Required Parameters |
Live Standings by Season ID | Get the the rankings of all teams for a given season, in real time. The response can be formatted in two ways based on the league setup | Id – The ID of the season |
Standings by Season ID and RoundID | Get the the standings for a given round. Rankings are calculated based on the games played until the given round ID. | seasonId – The id of the season roundId- The ID of the round |
Standings by SeasonID | Get the the standings for any given season. | Id – The id of the season |
Leagues
Endpoint | Purpose | Required Parameters |
League by ID | Get the overview of any given league | Id – League ID |
All Leagues | Get the list of all leagues. Responses can be filtered using country and season |
Fixtures and Live Scores
Endpoint | Purpose | Required Parameters |
Fixtures Between 2 Dates for one Team | This endpoint allows you to get all the fixtures between any two dates for any given team. | startDate – The first date of the date range endDate- The second date of the date range teamID |
Last Updated Fixtures | Get the list of fixtures that are last updated | None |
Fixtures Between 2 Dates | Get the list of all fixtures between two given dates. | startDate endDate |
Fixture by ID | Access complete information of any given fixture | Id – The Id of fixture |
Fixtures of Today | Get all live-scores of the current day | None |
Fixtures Inplay by League | Get all the live-scores that are in-play for given league IDs. | Leagues – Comma seperated string of league Ids |
Fixtures Currently Inplay | Get all the live-scores that are in-play | None |
Fixtures by ID List | Get the complete information about the given fixtures such as league, season, round, venue, referee, local team, visitor team, winning team, details etc. | idList – Comma separated list of fixtures’ IDs |
Fixtures by Date | Get the list of fixtures for a given date | date |
Events
Endpoint | Purpose | Required Parameters |
Events by Fixture ID | Get the complete list of events for a given Fixture. | Include – required includes to filter the API response Id – the id of the fixture |
Pre-Match and Live Odds
Endpoint | Purpose | Required Parameters |
Pre-Match Odds by Fixture ID | This endpoint allows you to add betting functionality in your application. The response data contains the pre-match odds by Fixture ID. | Id – The ID of the fixture Include – required includes to filter the API response e.g flatOdds |
InPlay Odds by Fixture ID | Retrieve live odds for any given Fixture | Id – the id of the fixture |
Line-Ups
Endpoint | Purpose | Required Parameters |
Line- Up by Fixture ID | Retrieve the line-up information for a given fixture. | Id – The ID of the team Include- required includes to filter the API response |
All Line-Ups by PlayerID | Retrieve the line-up information of any given player | Id- The id of the player Include- required includes to filter the API response |
Statistics
Endpoint | Purpose | Required Parameters |
Team Season Statistics by Team ID | Get all season statistics of any given team. This endpoint also provides historical data. | Id – The ID of the team Include – e.g stats |
Team Statistics by Team ID and Season ID | Get the team performance statistics in any given season | Id – The id of the team Season – The Id of the season Include – required includes to filter the API response |
Player Statistics by PlayerID and SeasonID | Get all the statistics for any player in a given season | Include – e.g stats Id – The id of the player Seasons – The id of the season |
Player Statistics by Player ID | Get the complete statistics for a given player | Id – the id of the player Includes – e.g stats |
Player Statistics by Fixture ID | Get the player statistics for a given fixture | Id – the id of the fixture |
Match Statistics by Fixture ID | Get the match statistics for a given fixture | Id – the id of the fixture |
Season Statistics by Season ID | Get all season statistics by season, like number of matches, total played, total goals, average goals per match etc. | Id – the id of the season |
Search
Endpoint | Purpose | Required Parameters |
Search Player by Name | Search through database using player name. The response contains the list of players that matches with your search criteria. Note: Response includes Player ID which is being used as required fields in many of the aforementioned endpoints. | Search – The name of the player you want to search |
Search Team by Name | Search through the database using the team name. | Search – The name of the team you want to search |
Search League by Name | Search through the database using the league name. Note: Use full league name for better results e.g “Premier League” | Search – the name of the league you want to search |
Continents and Countries
Endpoint | Purpose | Required Parameters |
All Countries | Get detailed information about all the countries such as flag, ISO Code, Name, etc. | None |
Country by ID | Get detailed information of a given country | Id – The id of the country |
All Continents | Get all continents in the world | |
Contentinent by ID | Get all the information for a given content | Id – The id of the continent |
Bookmakers and Odds Markets
Endpoint | Purpose | Required Parameters |
Get Odds Market by ID | Check or structure the bookmakers and markets availability. | Id – The id of the market |
Bookmaker by ID | Get information about the bookmaker such as id, | The Id of the bookmaker |
All Odds Markets | Get the list of all available markets | None |
All Bookmakers | Get the list of all available bookmakers | None |
COVID – 19
Endpoint | Purpose | Required Parameters |
Covid-19 Information per Country | Get information about the leagues that are affected by covid19, expected start date, official status (e.g canceled, playing, none), and other additional information | Include – e.g Covid |
Covid-19 information per league | Get information about leagues that are affected by covid-19 | Include – e.g country.covid |
How to Use Football Pro API with Python
Please make sure that you have installed the Python application. There are several client libraries available for python like http.client, Unirest, and the default http.client.
The below example invokes the Search Player by Name endpoint using http.client library
- It searches for the player ‘Lionel Messi’
- It also overrides the timezone variable with Europe/Amsterdam.
import http.client conn = http.client.HTTPSConnection("football-pro.p.rapidapi.com") headers = { 'x-rapidapi-key': "ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541", 'x-rapidapi-host': "football-pro.p.rapidapi.com" } conn.request("GET", "/api/v2.0/players/search/Lionel%20Messi?tz=Europe%2FAmsterdam", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
How to Use Football Pro API with PHP
Before running the sample code shared below, please make sure that you have installed PHP. You may follow this guide on how to install this correctly.
The sample code also executes the Search Player by Name endpoint using the cURL library:
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://football-pro.p.rapidapi.com/api/v2.0/players/search/Lionel%2520Messi%27?tz=Europe%2FAmsterdam", CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "x-rapidapi-host: football-pro.p.rapidapi.com", "x-rapidapi-key: ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
How to Use Football Pro API with Ruby
You can use the below code-snippet that uses net::http library to execute the Search Player by Name endpoint.
require 'uri' require 'net/http' require 'openssl' url = URI("https://football-pro.p.rapidapi.com/api/v2.0/players/search/Lionel%2520Messi%27?tz=Europe%2FAmsterdam") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) request["x-rapidapi-key"] = 'ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541' request["x-rapidapi-host"] = 'football-pro.p.rapidapi.com' response = http.request(request) puts response.read_body
How to Use Football Pro API with JavaScript
To use the API in JavaScript, you need to first set up the JavaScript environment. You can download text editors such as Atoms, Visual Studio Code, NotePad++, etc.
The following code snippet executes the Search Player by Name endpoint using the fetch method to retrieve the player profile asynchronously.
fetch("https://football-pro.p.rapidapi.com/api/v2.0/players/search/Lionel%2520Messi%27?tz=Europe%2FAmsterdam", { "method": "GET", "headers": { "x-rapidapi-key": "ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541", "x-rapidapi-host": "football-pro.p.rapidapi.com" } }) .then(response => { console.log(response); }) .catch(err => { console.error(err); });
The API will return the complete player profile using a JSON formatted response, as shown below:
Benefits
Speed: Football Pro API has an average latency of 590ms, which makes it ideal to be integrated with high performant systems.
Real-Time Updates: Providing live-score in real-time can be tricky, with Football Pro API – developers can have pieces of mind as the updates are lightning-fast e.g 15 seconds faster than the competitors
Extensive Data Coverage: Football Pro API covers over 1200 leagues and has various data points that can help your application to stand out from the crowd.
Historical Statistics: It has several endpoints to provide historical statistics for a player, team, or league, etc. This can be used for various purposes e.g building reliable machine learning models and other analytical applications.
Alternatives to Football Pro API
Below are some alternatives to Football Pro API.
- API-Football: This API covers +830 football leagues and can be used to retrieve odds, events, line-ups, coaches, players, top scorers, standings, statistics, prediction, and transfers.
- LiveScore Football: This is not an extensive API like Football Pro but it does provide the information in real-time such as league table standings, fixtures, match details, etc.
- Football Prediction: It provides predictions for upcoming football matches, odds, and results for past matches and prediction performance.
- Football API: This free API allows users to retrieve squad stats, best scores, etc.
- Football Data API: This API can deliver any type of data for a football match, tournament, or team; such as live scores, match statistics, etc.
- Soccer Football Info: This is a freemium API and has coverage of over 2000 leagues worldwide. It provides historical data, live and pre-match odds, Real-time data in both JSON and CSV formats.
Summary
In this article, we learned how Football Pro API can be used to build your own sports application. With its extensive league coverage, seamless integration with various platforms, and high-quality data, we can conclude that it’s the go-to API for application developers, building a high performant sports application.
Leave a Reply