Football (Soccer) Videos

Sports & Fitness

Exploring the Scorebat Video API

Scorebat API Logo

Scorebat is a website that provides live football video highlights from various popular leagues around the world. The website also provides a public API that developers can use to access their video database and integrate it into their own applications. In this blog, we will explore the Scorebat Video API and see how it works.

Basic API Usage

To use the Scorebat Video API, you need to first register and get your API key from their website. Once you have the API key, you can start making requests to the API endpoints.

Endpoint URL

The Scorebat Video API has a single endpoint URL which is:

https://www.scorebat.com/video-api/v1/

Parameters

The API allows you to pass various parameters to filter and customize the search results. Some of the common parameters are:

  • embed - This parameter allows you to embed the video player on your website instead of just getting a link to the video.
  • competition_id - This parameter allows you to filter the highlights by competition ID.
  • date - This parameter allows you to search highlights that were published on a specific date. It should be in yyyy-mm-dd format.
  • limit - This parameter allows you to limit the number of results per page.

Authentication

To authenticate your API requests, you need to include your API key in the request header. The header should look like this:

headers: {
    'x-rapidapi-host': 'scorebat-video-api.p.rapidapi.com',
    'x-rapidapi-key': 'YOUR_API_KEY_HERE'
}

Response Format

The Scorebat Video API returns JSON response. The response will contain the video highlights data along with the relevant metadata such as title, competition, date, etc.

Examples

Get All Available Competitions

This example shows how to get all the available competitions from the Scorebat Video API.

fetch("https://www.scorebat.com/video-api/v1/competitions/",
    {
        "method": "GET",
        "headers": {
            "x-rapidapi-host": "scorebat-video-api.p.rapidapi.com",
            "x-rapidapi-key": "YOUR_API_KEY_HERE"
        }
    })
    .then(response => {
        console.log(response);
    })
    .catch(err => {
        console.log(err);
    });

Get All Highlights

This example shows how to get all the video highlights from the Scorebat Video API.

fetch("https://www.scorebat.com/video-api/v1/",
    {
        "method": "GET",
        "headers": {
            "x-rapidapi-host": "scorebat-video-api.p.rapidapi.com",
            "x-rapidapi-key": "YOUR_API_KEY_HERE"
        }
    })
    .then(response => {
        console.log(response);
    })
    .catch(err => {
        console.log(err);
    });

Get Embeddable Highlights

This example shows how to get embeddable video highlights from the Scorebat Video API.

fetch("https://www.scorebat.com/video-api/v1/?embed=true",
    {
        "method": "GET",
        "headers": {
            "x-rapidapi-host": "scorebat-video-api.p.rapidapi.com",
            "x-rapidapi-key": "YOUR_API_KEY_HERE"
        }
    })
    .then(response => {
        console.log(response);
    })
    .catch(err => {
        console.log(err);
    });

Get Highlights by Date

This example shows how to get video highlights published on a specific date from the Scorebat Video API.

fetch("https://www.scorebat.com/video-api/v1/?date=2022-11-01", 
    {
        "method": "GET",
        "headers": {
            "x-rapidapi-host": "scorebat-video-api.p.rapidapi.com",
            "x-rapidapi-key": "YOUR_API_KEY_HERE"
        }
    })
    .then(response => {
        console.log(response);
    })
    .catch(err => {
        console.log(err);
    });

Conclusion

In this blog, we explored the Scorebat Video API and saw how to make requests to its endpoints. We also saw different examples of API requests that developers can use to integrate video highlights data into their applications. With the Scorebat Video API, developers can create new applications and provide football fans with the latest highlights from popular leagues around the world.

Related APIs in Sports & Fitness