# About API

SoccerFootball.info is an advanced soccer API service; robust, high-performing and with reviewed and reliable data.

We have been collecting data since 2017 in a robust and secure environment. We have been using internally collected data for processing. And in 2021, we decided to open our giant DB to the public!

Currently our DB is composed of more than 1.5 billion of data 📈📈📈

## Why soccer football info?

Because it's an easy-to-read API even for human, with Excel (CSV) and JSON formats and the ability to [request custom enpoint](/faq#how-can-i-request-a-custom-query-endpoint)

**And we are the first to provide a**[ **websocket API**](/websocket/getting-started) **for real-time updates.**

### Real-Time WebSocket Data

Our [WebSocket real-time API](/websocket-api) delivers live soccer data with ultra-low latency. Receive match events, statistics, and odds updates the instant they change — no polling required.

* **6 channels** for events, statistics, and odds (including 3 REALTIME channels)
* **Ultra-low latency** MAIN\_REALTIME channel for the fastest match events in the market
* **Real-time odds** from bet365 and Unibet streamed directly to your application
* **Multiple scopes**: subscribe to all matches, a single match, or an entire league

[Learn more about WebSocket API](/websocket-api) | [Get started](/websocket/getting-started)

## Source of data

The data are retrieved directly from Unibet's source and aggregated with those of bet365 as they are more complete.

{% hint style="info" %}
Our staff periodically reviews the data collected to validate it
{% endhint %}

## Tools and collection

All tools, chrome extension, software, collection ecc.. is in[ tools section](/tools)


# Price & Limits

**You can subscribe to the service through** [**RapidAPI**](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info/pricing) or by writing directly to <info@soccerfootball.info>

We offer 4 different plans:

<table><thead><tr><th width="138">Plan</th><th width="122">Price</th><th width="140">Request/hour</th><th width="107">IP limit</th><th>Items/page</th><th>Coverage</th></tr></thead><tbody><tr><td>⬜ BASIC *</td><td>200 free</td><td>8 /hr + €0.005/r</td><td>no</td><td>25</td><td>🌎 full</td></tr><tr><td>🟨 PRO</td><td>$ 25 / mon</td><td>1800 / hr</td><td>yes (2)</td><td>25</td><td>🌎 full</td></tr><tr><td>🟦 ULTRA</td><td>$ 75 / mon</td><td>4200 / hr</td><td>yes (5)</td><td>50</td><td>🌎 full</td></tr><tr><td>🟩 MEGA</td><td>$ 150 / mon</td><td>7800 / hr</td><td>yes (10)</td><td>100</td><td>🌎 full</td></tr></tbody></table>

\* Pay per use free method is available only on RapidAPI\
\
Instead, here is the list of endpoints access permissions, in the ways described above.

<table><thead><tr><th>Call</th><th width="123">BASIC ⬜</th><th width="102.5999755859375">PRO 🟨</th><th width="113.7999267578125">ULTRA 🟦</th><th width="116.0001220703125">MEGA 🟩</th></tr></thead><tbody><tr><td>/v1/countries/list</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/languages/list</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/stadiums/list</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/stadiums/view</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/managers/list</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/managers/view</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/players/list</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/players/view</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/championships/list</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/championships/view</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/teams/list</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/teams/view</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/referees/list</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/referees/view</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/matches/day/basic</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/matches/view/basic</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/matches/by/basic</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/live/basic</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/teams/versus</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/teams/history</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/emulation/totalcorner/match/today</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/emulation/totalcorner/match/schedule</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/matches/day/full</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/matches/by/full</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/matches/odds/</td><td>✔️</td><td>❌</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/live/full</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/matches/view/full</td><td>✔️</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/matches/view/progressive</td><td>✔️</td><td>❌</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/custom</td><td>❌</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/ws/new</td><td>❌</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/ws/delete</td><td>❌</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/ws/get</td><td>❌</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/ws/renew</td><td>❌</td><td>✔️</td><td>✔️</td><td>✔️</td></tr><tr><td>/v1/live/ws</td><td>❌</td><td>❌</td><td>❌</td><td>✔️</td></tr><tr><td>/v1/championships/ws</td><td>❌</td><td>❌</td><td>❌</td><td>✔️</td></tr><tr><td>/v1/teams/ws</td><td>❌</td><td>❌</td><td>❌</td><td>✔️</td></tr></tbody></table>

#### Websocket limits

This document describes the WebSocket subscription tiers and their associated limits.

<table><thead><tr><th width="114.5999755859375">Plan</th><th width="99.60009765625">Access</th><th width="168.2000732421875">Max connections</th><th width="133.2000732421875">Max sub per connections</th><th>Channels</th></tr></thead><tbody><tr><td>BASIC ⬜</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td></tr><tr><td>PRO 🟨</td><td>✔️</td><td>2</td><td>3</td><td>MAIN</td></tr><tr><td>ULTRA 🟦</td><td>✔️</td><td>33</td><td>10</td><td>MAIN, STATS, ODDS</td></tr><tr><td>MEGA 🟩</td><td>✔️</td><td>100</td><td>30</td><td>ALL CHANNELS (include MAIN_REALTIME)</td></tr></tbody></table>


# Coverage

Currently in our DB we have:

| Entity        | Numbers                                 |
| ------------- | --------------------------------------- |
| Matches       | \~ 802 000                              |
| Managers      | \~ 11 000                               |
| Players       | \~ 90 000                               |
| Championships | \~ 2 000                                |
| Stadiums      | \~ 7 000                                |
| Teams         | \~ 43 000                               |
| Language      | [20](/faq#what-languages-are-supported) |

The coverage is global and is the same given by Unibet and Bet365. When a match is not from one bookmaker it is recovered by the other and vice versa. **Currently we only support physical soccer not e-sports or simulated soccer**

{% hint style="info" %}
By launching the /v1/countries/list call, it is possible to trace the precise number of items for each state.
{% endhint %}

**Data is collected from January 1, 2017** to present, some specific endpoint have a shorter collection time.


# FAQ

## What languages are supported?

There is a range of content that can be translated. To do this you must pass the language code as a parameter. More details in the individual endpoints. \
Here are the currently supported languages:

| **Language**   | **Code** | **Note**         |
| -------------- | -------- | ---------------- |
| English (main) | en\_US   | Full translate   |
| Svenska        | sv\_SE   | Full translate   |
| Italiano       | it\_IT   | Full translate   |
| Français       | fr\_FR   | Full translate   |
| Polski         | pl\_PL   | Full translate   |
| Dansk          | da\_DK   | 60% of translate |
| Español        | es\_ES   | Full translate   |
| Norsk          | nn\_NO   | Full translate   |
| Slovenčina     | sk\_SK   | 60% of translate |
| Ελληνικά       | el\_GR   | 60% of translate |
| Deutsch        | de\_DE   | Full translate   |
| Português      | pt\_PT   | Full translate   |
| Română         | ro\_RO   | 60% of translate |
| Česky          | cs\_CZ   | 60% of translate |
| Magyar         | hu\_HU   | 60% of translate |
| 简体中文           | zh\_CN   | 60% of translate |
| Nederlands     | nl\_NL   | Full translate   |
| Eesti          | et\_EE   | Full translate   |
| Русский        | ru\_RU   | 60% of translate |
| 日本語            | ja\_JP   | 60% of translate |

## How can I view/download the entity media?

Some elements have an image. All images reside on our static site. You can access the image by going to the following URL:&#x20;

`https://static.soccerfootball.info/images/?i=ID_ITEM`

Replacing `ID_ITEM`with the code of the element you are looking for

## How paginate work?

Endpoints with many returns routinely paginated. Here I explain more about how pagination works. \
First of all, you need to know that the number of elements per page changes automatically depending on your subscription. **There is no possibility to specify the number of elements per page.**

* BASIC: *25*
* PRO: *25*
* ULTRA: *75*
* MEGA: *100*

Using the **`p`** parameter you can specify the required page number, if you omit it as a default value page 1 is required. In the body of the endpoint response you will find the paginate section. This indicates that pagination is active in the following call. If the value would be an empty array, then the call is not paginated.

```javascript
{
  "status": 200,
  "errors": [],
  	"pagination": [
      {
        "page": 1,
        "per_page": 100,
        "items" : 6726
      }
    ],
  	"result": [
  		...
  	]
}
```

* **`page`** indicates the current page number
* **`per_page`** indicates the number of items there are per page
* **`items`** indicates the total number of items

To see if there are any new elements, you can store the last **`items`** value and check it periodically.\
To figure out how many pages there are for each endpoint (and then call them with the **`p`** parameter) just divide **`items`** with the **`per_page`** value, rounding up.

If you use a CSV format, the paginate data appear in the first column with this format: \
page\_**1**\_perPage\_**100**\_items\_**38250**

* **`1`** indicates the current page number
* **`100`** indicates the number of items there are per page
* **`38250`** indicates the total number of items

In general if you want to know how many page there are can do the following operation: \
**`items / per_page = number_of_pages`**

## How can i request a custom query/endpoint?

The first question is: Why do I need a custom endpoint? Simple, sometimes to optimize your project you need to perform very complex queries on a large database. Here's an example: I want to know the average dangerous attacks and normal attacks of teams that scored at least X goals in a predefined time frame.

We can help you! And we will create a custom enpoint for you that you can call as many times as you want, with different parameters, in complete autonomy.

To request it is very simple: write to <info@soccerfootball.info> and describe what your endpoint should do and we will guide you step by step.


# Tools

Our API is simple and straightforward even for a human.

For read JSON you can use a simple browser, compone your URL and go to the page.\
If you use Google Chrome we suggest [an extension](https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh) that format JSON result.

To use API in more complex mode,  as well as obviously write a code in the language you prefer, you can use a API software like Postman (<https://www.postman.com/>) or Swagger  (<https://swagger.io/>)

If you using Postman we have develop the collection file:

* Postman collection for **direct mode API**  [**`RUN`**](https://app.getpostman.com/run-collection/3ffbdb1dd9f7fcc059a0)    [**`DOWNLOAD`**](https://www.getpostman.com/collections/52464763-458e1e54-837c-4524-85d7-e26e0505c1cb)               <br>
* Postman collection for **rapid API mode**   [**`RUN`**](https://app.getpostman.com/run-collection/e96d50bada5f1de05608)    [**`DOWNLOAD`**](https://www.getpostman.com/collections/52464763-25d2e128-c842-49f1-b449-a860e0462a0f)

We have also[ BRUNO](https://www.usebruno.com/) collection:

* [Bruno direct mode API](https://static.soccerfootball.info/schema/BRUNO-SoccerFootball-info-DIRECT.json)
* [Bruno RapidAPI mode](https://static.soccerfootball.info/schema/BRUNO-SoccerFootball-info-RAPIDAPI.json)

If you need to read the CSV format you can use some office software like MS Excel, Libreoffice, OpenOffice or Google spreadsheets.

Our CSV is all in UTF8 linux format, that is compatible with double click open without needed import.&#x20;

If you need simple the OpenAPI v3 Manifest:

* [OpenAPI v3 **direct mode API**](https://static.soccerfootball.info/schema/openapi_3_0_schema_DIRECT.json)&#x20;
* [OpenAPI v3 **rapid API mode**](https://static.soccerfootball.info/schema/openapi_3_0_schema_RAPIDAPI.json)


# External libraries

In addition to the official **soccerfootball.info** API, there are libraries and connectors created by **external developers (community)** or **internal teams** to make integrations faster and easier.\
These projects typically reduce boilerplate by providing ready-to-use methods, handling authentication, and offering higher-level abstractions over the raw HTTP endpoints.

Below you can find a list of available external libraries/connectors.

***

#### Python — `soccer-info`

**Package:** `soccer-info`\
**PyPI:** <https://pypi.org/project/soccer-info/>

A Python library that provides a connector to interact with the **soccerfootball.info** API in a simple and developer-friendly way.

**Install**

```bash
pip install soccer-info
```


# Dominance index

The dominance index is the innovative index that objectively indicates the pressure that team A or B is exerting in the match.

### How is it computed?

The calculation is relatively simple. Each event is given a weight expressed in points, and the sum of the points in the 30-second time frame gives the result. \
The most complex part is to correctly weigh all events

### What values do we have available?

In the calls where the dominance index is indicated there are two values:

* dominance\_index
* dominance\_index\_2\_5\_avg&#x20;

The first value contains a JSON updated every 30 seconds that shows the current game performance. The average value of 2.5 minutes shows the average score of the last 5 samples.

Two values are present because the first one can be useful to draw and humanly interpret graphs, the second one instead gives a dry value that numerically indicates the pressure of the team in that moment, so it can be useful for strategies or bots.

### How should it be interpreted?

The higher the value, the higher the pace of the team.&#x20;

The difference between the value of team A and that of team B indicates dominance. \
If the dominance is positive, team A is dominating, if it is negative, team B is dominating, if the gap is wide, either negative or positive, the dominance is very marked.

### How can it be plotted?

Indicatively the dominance index can be drawn in two ways:

#### With line chart&#x20;

![Dominance index line chart](/files/j2wJK7WuM5GB2qLs4Dcb)

The graph shows not only the difference between the two indices but also the rhythm of the match. The higher the value, the higher the rhythm of the two teams.

**With bar chart**

![Dominance index bar chart](/files/kHF30NU7xpb3cFjVZcIt)

The bar chart plots the difference of the two indices and at a glance shows the tendency of dominance of one of the two teams .\
To generate a bar char just do the difference between the index of dominance A and B.\
If result is negative team B dominance vice versa dominates the A team

To help you draw the graph quickly, we wrote a COLAB document that interprets the response of the MATCH VIEW call and prints the graphs.

[**`GO TO COLAB FILE`**](https://colab.research.google.com/drive/1tkPTJK5OBesFBMVsQBPitLZN_lz87vU7?usp=sharing)

### What calls are available?

Dominance index are available in this calls:

* [Emulation totalcorner today](/v1/emulated/totalcorner/match-today)
* [Emulation totalcorner schedule](/v1/emulated/totalcorner/match-schedule)
* [Live full](/v1/live/live-full)
* [Live basic](/v1/live/live-basic)
* [Match day basic](/v1/matches/day-basic)
* [Match day full](/v1/matches/day-full)
* [Match view basic](/v1/matches/view-basic)
* [Match view full](/v1/matches/view-full)
* [Match by basic](/v1/matches/by-basic)
* [Match by full](/v1/matches/by-full)
* [Match view  progressive](/v1/matches/view-progressive)


# xG (Expected Goals)

The xG statistic, or Expected Goals, is a measure used in soccer to evaluate the quality of goal-scoring opportunities created during a match. This index is based on a series of factors, such as the position of the shot, the angle of the shot, the pressure of the defender, and others, to calculate the probability that a shot will turn into a goal. In this way, the xG index provides a more accurate measure of a team's offensive performance compared to simply counting the goals scored.

We are pleased to announce that, starting with version 1.50 of our APIs, the xG statistic is now available for all matches starting from 2024-03-15.&#x20;

This means that developers can now access this valuable information through our endpoints and use it to enrich their applications and analyses.

In contrast to many other services, we offer the **xG data at the moment of kickoff and update it live during the match**. This means that you can access the most up-to-date information in real-time, giving you an edge in your analysis and decision-making. Additionally, it is possible to perform backtests of past matches using the matchprogressive call, allowing you to analyze historical data and gain even deeper insights.

Thank you for choosing our APIs for your soccer data. We are committed to providing you with the most accurate and timely information, and we will continue to work to improve our service and offer you even more valuable features.


# WebSocket API

SoccerFootball.info is the first soccer API to offer a complete WebSocket real-time data service. Get live match events, real-time statistics, and live betting odds updates delivered instantly to your application through a persistent WebSocket connection — no polling, no delays.

Our WebSocket infrastructure is built for speed and reliability, with servers in Europe (EU) and Asia (AS) to ensure optimal connectivity worldwide.

## Why WebSocket for Soccer Data?

Traditional REST API polling introduces latency and wastes bandwidth. Every poll request takes time, and most responses contain no new data. Our WebSocket API pushes data to your application the instant it changes, making it ideal for:

* **Live score trackers and widgets** — display goals and match events as they happen
* **Real-time betting platforms** — react to odds changes and match events instantly
* **In-play statistics dashboards** — show possession, corners, shots, and cards in real-time
* **Automated trading systems** — execute strategies based on live odds and statistics movements
* **Mobile applications** — push notifications triggered by real-time match events
* **Fantasy sports platforms** — update player performance data live during matches

## Ultra-Low Latency with MAIN\_REALTIME

The [MAIN\_REALTIME](/websocket/channels/main-realtime) channel, exclusive to MEGA plan subscribers, delivers match events (goals, kickoffs, halftime, match end) with the absolute lowest latency available in the market.

When milliseconds matter — in live betting arbitrage, in-play trading, or competitive fantasy sports — MAIN\_REALTIME gives you the edge over any other soccer data provider.

## Available Channels

We offer 6 WebSocket channels to cover every real-time soccer data need:

### Match Events

* [**MAIN**](/websocket/channels/main) — Key match events: goals, halftime, match start and end. Available from PRO plan.
* [**MAIN\_REALTIME**](/websocket/channels/main-realtime) — Same events as MAIN with ultra-low latency delivery. MEGA plan only.

### Live Statistics

* [**STATS**](/websocket/channels/stats) — Complete statistics snapshots including possession, attacks, shots, corners, fouls, cards, and xG. Available from ULTRA plan.
* [**STATS\_REALTIME**](/websocket/channels/stats-realtime) — Real-time statistics deltas, delivering only changed values for instant updates and minimal bandwidth. MEGA plan only.

### Live Odds

* [**ODDS**](/websocket/channels/odds) — Complete odds snapshots for all major markets (1X2, Over/Under, Asian Handicap, Corners, and more) from bet365 and Unibet. Available from ULTRA plan.
* [**ODDS\_REALTIME**](/websocket/channels/odds-realtime) — Real-time odds deltas for instant market movement detection. MEGA plan only.

## Competitive Advantages

* **First soccer API with WebSocket** — no other soccer data provider offers real-time WebSocket streaming for matches, statistics, and odds
* **Real-time odds streaming** — get live odds changes from bet365 and Unibet as they happen, not minutes later
* **Real-time statistics** — possession, corners, shots, cards, xG — all delivered instantly as they update
* **Ultra-low latency** — MAIN\_REALTIME channel delivers the fastest match events in the industry
* **Low bandwidth** — REALTIME channels send only changed data (deltas), minimizing network usage
* **Flexible subscriptions** — subscribe to all matches, a single match, or an entire league
* **Reliable infrastructure** — EU and AS server regions for optimal connectivity worldwide

## Getting Started

1. Subscribe to a [plan that includes WebSocket access](/price-and-limits) (PRO or higher)
2. Obtain a WebSocket token via the [/v1/ws/new](/v1/ws/new) REST endpoint
3. Connect to the WebSocket server and [subscribe to channels](/websocket/getting-started)
4. Start receiving real-time data

For complete integration instructions, code examples in JavaScript and Python, and detailed channel documentation, see the [WebSocket Getting Started guide](/websocket/getting-started).

## Bridging REST and WebSocket

Our WebSocket system uses its own real-time IDs for matches, teams, and championships. To seamlessly bridge between REST API data and WebSocket real-time data, use these dedicated mapping endpoints:

* [/v1/live/ws](/v1/live/live-ws) — Live matches with dual ID mapping (WebSocket + REST IDs)
* [/v1/championships/ws](/v1/championships/ws) — Championships with dual ID mapping
* [/v1/teams/ws](/v1/teams/ws) — Teams with dual ID mapping

These endpoints return both the `ws_realtime` ID (used in WebSocket channels) and the `rest_releated` ID (used in REST API endpoints) for every entity, enabling you to cross-reference data between the two systems effortlessly.


# Changelog

Starting with version 1.5, we started to make our changelog public.\
API development is now mature and stable.

<details>

<summary>Version 2.00   - 2026/02/10</summary>

* Add [websocket](/websocket/getting-started) realtime API
* Fix pagination issue in match/by call

</details>

<details>

<summary>Version 1.51   - 2024/03/21</summary>

* Add "important" filed in [/championships/list](/v1/championships) and[ /championships/list](/v1/championships)

</details>

<details>

<summary>Version 1.50   - 2024/03/15</summary>

* We add xG (expected goal) stats to our main match
* Minor fix

</details>


# Support

For support you can write an email at <info@soccerfootball.info>


# Authentication

Soccer Football info REST api authenticates via Access Token.

The modes differ if you use the direct API or via RapidAPI. \
Here's how to do it:

### Authentication with direct API&#x20;

The main URL is: `https://api.soccerfootball.info`

You must enter the **`t=`** parameter with your access token for each endpoint to work.\
For example:&#x20;

```
https://api.soccerfootball.info/endpoint/url?t=TOKEN
```

#### Header on response

On response there is some header that you can use to check API status

* `X-Rate-Limit-Limit`: the rate limit ceiling for that given endpoint
* `X-Rate-Limit-Remaining`: the number of requests left for the hour window
* `X-Rate-Limit-Reset`: the remaining window before the rate limit resets, in UTC epoch seconds

### Authentication with RapidAPI&#x20;

The main URL is: `https://soccer-football-info.p.rapidapi.com`

You must pass two custom header to endpoint with your token and api host.

* `x-rapidapi-host` : the api hostname is always `soccer-football-info.p.rapidapi.com`
* `x-rapidapi-key` : your API token

{% hint style="danger" %}
Pay attention to endpoint, in case of rapidAPI is **always** without /v1/ prefix \
/v1/live/full -> /live/full/ ecc...
{% endhint %}

For example:

```
GET https://soccer-football-info.p.rapidapi.com/endpoint

x-rapidapi-host: soccerfootballinfo.rapidapi.com
x-rapidapi-key: TOKEN
```

#### Header on response

Ogni chiamata se risponderà 200 vi fornirà negli header le seguenti informazioni:

* `x-ratelimit-request-limit`: The number of requests the plan you are currently subscribed to allows you to make, before incurring overages
* `x-ratelimit-requests-remaining`: The number of requests remaining before you reach the limit of requests your application is allowed to make, before experiencing overage charges.

more info [here](https://docs.rapidapi.com/docs/headers-sent-by-api-proxy)

{% hint style="info" %}
You can limit your token by IP from RapidApi Dashboard or if you have a directly subscribe write a mail to <linfo@soccerfootball.info> with your token and the IP.
{% endhint %}


# Errors

There is some possibile errors:

## #404

*Not Found error*. The endpoint is missing or element not found

```javascript
{
	"status": 404,
	"errors": [
		{
			"code" : 6,
			"message" : "Not Found"
		}
	],
  	"pagination": [],
  	"result": []
}
```

## #400

*Bad Request.* Missing some variable in endpoint. Only one error at time

```javascript
{
	"status": 400,
	"errors": [
		{
			"code" : 1,
			"message" : "Missing XXX param"
		},
		{
			"code" : 7,
			"message" : "Wrong XXX param"
		}
	],
  	"pagination": [],
  	"result": []
}
```

## #401

*Unauthorized.* Your token don't have enough of privileges to access at this endpoint or is suspended/invalid

```javascript
{
	"status": 401,
	"errors": [
		{
			"code" : 2,
			"message" : "Token is invalid"
		},
		{
			"code" : 3,
			"message" : "Token is suspended"
		},
		{
			"code" : 4,
			"message" : "Token does not have permission"
		},
		{
			"code" : 5,
			"message" : "Token IP is invalid"
		}
	],
  	"pagination": [],
  	"result": []
}
```

## #429

*Too many requests.* Your token do too many requests due your plan limitation. Need to wait next hour

```javascript
{
	"status": 429,
	"errors": [
		{
			"code" : 7,
			"message" : "Too many requests"
		}
	],
  	"pagination": [],
  	"result": []
}
```


# Championships

List of endpoints of Championship entity.

[**List**](/v1/championships/list#list-of-all-championships) **-** */v1/championships/list* ⬜ 🟨 🟦 🟩\
List of championships with relented entity

[**View**](/v1/championships/view) **-** */v1/championships/view* 🟨 🟦 🟩\
*View* of single championship and all its data

[**WS**](/v1/championships/ws) **-** */v1/championships/ws* 🟩\
List of championships with WebSocket dual ID mapping (MEGA only)


# list

## List of all championships ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/championships/list/`

This endpoint return with all championships and its data. \
This is a paginate call, see instruction inside FAQ \
If this entity has **`has_image`** to true, you can access/download the entity media; see the instruction inside FAQ. \
The parameter **`c`** must be a country code getted from coutries/list endpoint. \
The parameter **`l`** must be a language code getted from languages/list endpoint.\
Format CSV is in MS excel compatible mode (double click open without import!)\
The latest data are on the last page.

#### Query Parameters

| Name | Type   | Description                                                |
| ---- | ------ | ---------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                       |
| f    | string | Format response can be "json" or "csv" (default is "json") |
| p    | string | Page number (default value is 1)                           |
| c    | string | Country code or "all" (default value is "all")             |
| l    | string | Language code (default value is "en\_US")                  |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[
      {
         "page":1,// current page
         "per_page":100, // items per page
         "items":1950 // total items number
      }
   ],
   "result":[
      {
         "id":"5fda5fa713daf8c1", // championship unique id
         "name":"Kosovo - Superliga",
         "country":null,
         "has_image": false,
         "important": true // important championship has extended stats
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
page_1_perPage_100_items_1954;id;name;country;has_image;important
;5fda5fa713daf8c1;"Kosovo Superliga";;"no";"yes"
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/championships/list/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/championships/list/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/championships/list/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/championships/list/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/championships/list/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/championships/list/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/championships/list/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/championships/list/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/championships/list/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/championships/list/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/championships/list/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/championships/list/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info)


# view

## View championship with its data 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/championships/view/?i=ID`

This endpoint returns with champiosnhip data and tables \
The parameter **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**      |
| i    | string | Championship ID                           |
| l    | string | Language code (default value is "en\_US") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":"5fda5fab11fbd288",
         "name":"Italy Serie A",
         "country":"IT",
         "has_image":false,
         "important": true, // important championship has extended stats
         "seasons":[
            {
               "name":"Serie A 20/21",
               "from":"2020-09-19",
               "to":"2021-05-23",
               "groups":[
                  {
                     "name":"Serie A",
                     "table":[
                        {
                           "team":{
                              "id":"5fda5fcad92584cd",
                              "name":"AC Milan"
                           },
                           "position":1,
                           "win":11,
                           "draw":4,
                           "loss":1,
                           "points":37,
                           "goals_scored":35,
                           "goals_conceded":19,
                           "note":"Champions League"
                        },
                        ...
                     ]
                  }
               ]
            }
         ]
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/championships/view/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/championships/view/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/championships/view/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/championships/view/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/championships/view/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/championships/view/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/championships/view/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/championships/view/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/championships/view/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/championships/view/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/championships/view/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/championships/view/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info)


# ws

## List of all championships with WebSocket ID mapping 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/championships/ws/`

This endpoint returns a paginated list of championships with the dual ID mapping system for the **MAIN\_REALTIME** WebSocket channel.\
Each field (id, name, country) is an object containing two values:\
**`ws_realtime`**: the value used exclusively in **MAIN\_REALTIME** channel messages\
**`rest_releated`**: the value from the standard REST API and all other WebSocket channels (MAIN, STATS, ODDS, STATS\_REALTIME, ODDS\_REALTIME)\
This mapping allows you to match championships between MAIN\_REALTIME events and the rest of the API.\
You can search by name or look up a specific championship by either ID type.\
The parameters **`find_id`** and **`find_ws_id`** are mutually exclusive.\
Format CSV is in MS excel compatible mode (double click open without import!)\
The latest data are on the last page.

{% hint style="warning" %}
**MAIN\_REALTIME only** — This endpoint is needed only if you subscribe to the **MAIN\_REALTIME** channel (MEGA plan 🟩). All other WebSocket channels already use REST IDs, so no mapping is required for them.
{% endhint %}

#### Query Parameters

| Name         | Type   | Description                                                |
| ------------ | ------ | ---------------------------------------------------------- |
| t            | string | Your API Token **`DIRECT API ONLY`**                       |
| f            | string | Format response can be "json" or "csv" (default is "json") |
| p            | string | Page number (default value is 1)                           |
| search\_ws   | string | Search by WebSocket championship name (partial match)      |
| search       | string | Search by REST championship name (partial match)           |
| find\_id     | string | Find by REST championship ID (exact match)                 |
| find\_ws\_id | string | Find by WebSocket championship ID (exact match)            |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[
      {
         "page":1,// current page
         "per_page":100, // items per page
         "items":542 // total items number
      }
   ],
   "result":[
      {
         "id":{
            "ws_realtime":"a1b2c3d4e5f6a7b8", // WebSocket championship ID
            "rest_releated":"5fda5fa713daf8c1" // REST API championship ID
         },
         "name":{
            "ws_realtime":"Serie A TIM", // name from WebSocket data source
            "rest_releated":"Italian Serie A" // name from REST API
         },
         "country":{
            "ws_realtime":null, // country from WebSocket data source (may be null)
            "rest_releated":"IT" // country from REST API
         }
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
page_1_perPage_100_items_542;id_ws_realtime;id_rest_releated;name_ws_realtime;name_rest_releated;country_ws_realtime;country_rest_releated
;a1b2c3d4e5f6a7b8;5fda5fa713daf8c1;"Serie A TIM";"Italian Serie A";;"IT"
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/championships/ws/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/championships/ws/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/championships/ws/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/championships/ws/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/championships/ws/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/championships/ws/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/championships/ws/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/championships/ws/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/championships/ws/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/championships/ws/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/championships/ws/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/championships/ws/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info)


# Countries

List of endpoints of Countries entity.

[**List**](/v1/countries/list) **-** */v1/countries/list*  ⬜ 🟨 🟦 🟩\
List of countries with relented  entity


# list

## List of all countries  ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/countries/list/`

This endpoint returns with all countries and the relented entries. You can use this call to get country code and use it in another endpoints.\
The possible format of this call is json or csv (MS office compatible)\
Format CSV is in MS excel compatible mode (double click open without import!)

#### Query Parameters

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                    |
| f    | string | Format response can be "json" or "csv" (default "json") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "code":"AF",  // unique country code
         "name":"Afghanistan",
         "timezones":[
            "UTC+04:30"
         ],
         "championships":0, 
         "managers":2,
         "players":13,
         "referees":0,
         "stadiums": 0,
         "teams":4
      },
		...
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
code;name;timezones;championships;managers;players;referees;stadiums;teams
AD;Andorra;UTC+01:00;5;32;35;1;7;41
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

### Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/countries/list/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
	echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/countries/list/?t=TOKEN", {
	"method": "GET"
})
.then(response => {
	console.log(response);
})
.catch(err => {
	console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/countries/list/?t=TOKEN'
};

request(options, function (error, response, body) {
	if (error) throw new Error(error);

	console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/countries/list/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash

curl --request GET \
	--url 'https://api.soccerfootball.info/v1/countries/list/?t=TOKEN'

```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.soccerfootball.info/v1/countries/list/?t=TOKEN"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

### Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/countries/list/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
		"X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
		"X-RapidAPI-Key: TOKEN"
	],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
	echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/countries/list/", {
	"method": "GET",
	"headers": {
		"X-RapidAPI-Key": "TOKEN",
		"X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
	}
})
.then(response => {
	console.log(response);
})
.catch(err => {
	console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/countries/list/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
	 "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
	if (error) throw new Error(error);

	console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/countries/list/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
	  "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
	--url https://soccer-football-info.p.rapidapi.com/countries/list/ \
	--header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
	--header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://soccer-football-info.p.rapidapi.com/countries/list/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-RapidAPI-Key", "TOKEN")
	req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info)


# Emulation

List of endpoints of Emulation entity.

### **Totalcorner emulation**

[**Match today**](/v1/emulated/totalcorner/match-today)**-** */v1/emulation/totalcorner/match/today*   🟨 🟦 🟩\
And emulated call with our data and [totalcorner structure ](https://www.totalcorner.com/page/api#api_today_list)


# Totalcorner

List of endpoints of totalcorner emulation

[**Match today**](/v1/emulated/totalcorner/match-today) **-** */v1/emulation/totalcorner/match/today*  ⬜ 🟨 🟦 🟩\
Live emulated call with our data and [totalcorner structure ](https://www.totalcorner.com/page/api#api_today_list)

[**Match schedule**](/v1/emulated/totalcorner/match-schedule) **-** */v1/emulation/totalcorner/match/schedule* ⬜ 🟨 🟦 🟩\
Upcoming and past call with our data and [totalcorner structure ](https://www.totalcorner.com/page/api#api_today_list)


# match schedule

## View past, present and future match with totalcorner schema ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/emulation/totalcorner/match/schedule/?date=DATE`

This endpoint returns with past, present or future match with totalcorner schema.\
\
**Different between totalcorner version:** \
➡️ The database is different. More up-to-date and accurate to the second. \
➡️ Over and under quote of goalline under ou\_odds value. The goal line value remains at the first place of i\_goal to ensure compatibility with the original schema. (over under bet) \
➡️No esports event. Only real football. \
➡️ Fix some not working column Id is alphanumeric not numeric \
➡️ Add some data like last 5 matches team performance WWLLLD (Win Loss Draw) \
➡️Translated team name and championship name with bet365 translation ref (param **`l`** )\
➡️ **Trend stats 15 minute and 5 minute!**  \
➡️ Advance stats: avg goal in past match, over under percent, btts percent ecc.. see response\
➡️ Don't need to use a long url eg. \&type=inplay\&columns=events,odds,asian ecc all data will be always sent. No performance problem\
➡️[Dominance index](/dominance-index)\
➡️ Add `bet365_url` that contains bet365 url match. \
Please note, this is the link pointing to the match. After kickoff, the link may change but bet365 **should send** you back to the updated link.\
You have to replace .EXT with your needed extension ".com, .it etc..."\
\
Present and future call is paginate by your subscription page item numbers: \
25 PRO🟨/ BASIC ⬜ , 50 ULTRA🟦  , 100 MEGA 🟩\
\
**Past call has no pagination**\ <br>

#### Query Parameters

| Name | Type   | Description                                       |
| ---- | ------ | ------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**              |
| p    | string | current page (default 1)                          |
| date | string | Date ISO format without separator (default today) |
| l    | string | Language code (default value is "en\_US")         |

#### Headers

| Name            | Type   | Description                                             |
| --------------- | ------ | ------------------------------------------------------- |
| x-rapidapi-key  | string | Your API token **`RAPIDAPI ONLY`**                      |
| x-rapidapi-host | string | soccer-football-info.p.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="Present / Future" %}

```javascript
{
   "success":1,
   "pagination":{
      "current":1,
      "prev":false,
      "next":true,
      "per_page":100,
      "pages":5
   },
   "data":[
      {
         "id":"6044182dd31fdc64",
         "h":"Campinense Clube",
         "h_id":"5fda6031b85b47ea",
         "a":"EC Bahia",
         "a_id":"5fda5fcebabd1ab4",
         "l":"Brasile - Coppa di Brasile",
         "l_id":"5fda5fa7a37c687c",
         "l_c":"BR",
         "start":"2021-03-10 00:30:00",
         "status":null,
         "est_e":"0",
         "hc":"0",
         "ac":"0",
         "hg":"0",
         "ag":"0",
         "hrc":"0",
         "arc":"0",
         "hyc":"0",
         "ayc":"0",
         "hd_avg2_5" : "10.5", // team A (home) dominance avg 2.5
         "ad_avg2_5" : "10.5", // team B (away) dominance avg 2.5
         "hf_hc":"0",
         "hf_ac":"0",
         "hf_hg":"0",
         "hf_ag":"0",
         "ish":"0",
         "hp":null, 
         "ap":null, 
         "h_perf":"WWDLD", 
         "a_perf":"DDLWW", 
         "h_xG":[ // xG null if missing
            "1.08", // kickoff xG value
            "0.70" //  current xG value
         ],
         "a_xG":[
            "1.08",
            "0.70"
         ],
         "events":null,
         "d_index": [
            {
                "timer":"00:00", // timer of dominance index
                "teamA":"5",
                "teamB":"5"
             },
             ...
         ],
         "p_odds":[
            "9.000",
            "6.500",
            "1.200"
         ],
         "i_odds":[
            null,
            null,
            null
         ],
         "po_odds":[
            "6.500",
            "4.000",
            "1.400"
         ],
         "p_asian":[
            "+1.0"
         ],
         "i_asian":[
            ""
         ],
         "p_corner":[
            "10.5"
         ],
         "i_corner":[
            ""
         ],
         "p_corner_h":[
            "5"
         ],
         "i_corner_h":[
            ""
         ],
         "p_goal":[
            "2.5,3.0"
         ],
         "ou_odds":[
            "2.050",
            "1.800",
            "2.5,3.0"
         ],
         "i_goal":[
            ""
         ],
         "p_goal_h":[
            "1.0"
         ],
         "i_goal_h":[
            ""
         ],
         "asian_corner":[
            ""
         ],
         "attacks":[
            "0",
            "0"
         ],
         "attacks_h":[
            "0",
            "0"
         ],
         "dang_attacks":[
            "0",
            "0"
         ],
         "dang_attacks_h":[
            "0",
            "0"
         ],
         "shot_on":[
            "0",
            "0"
         ],
         "shot_on_h":[
            "0",
            "0"
         ],
         "shot_off":[
            "0",
            "0"
         ],
         "shot_off_h":[
            "0",
            "0"
         ],
         "possess":[
            "0",
            "0"
         ],
         "possess_h":[
            "0",
            "0"
         ],
         "g_a":[
            "0",
            "0"
         ],
         "o_s":[
            "0",
            "0"
         ],
         "fo":[
            "0",
            "0"
         ],
         "p_avg_g_g":[ // average game goals in past 5 matches
            "2.5", // teamA (home)
            "1"  // teamB (away)
         ],
         "p_avg_g_s":[ // average goals scored in past 5 matches
            "0.5",
            "0.5"
         ],
         "p_avg_g_c":[ // average goals conceded in past 5 matches
            "1",
            "0.5"
         ],
         "p_o_1_5_t":[ // percent of over 1.5 goal by team in past 5 matches
            "60",
            "30"
         ],
         "p_btts":[ // percent of BTTS (Goal/Goal) in past 5 matches
            "20",
            "80"
         ],
         "p_o_0_5_game":[ // percent of over 0.5 goal by game in past 5 matches
            "60",
            "30"
         ],
         "p_o_1_5_game":[ // percent of over 1.5 goal by game in past 5 matches
            "60",
            "30"
         ],
         "p_o_2_5_game":[ // percent of over 2.5 goal by game in past 5 matches
            "60",
            "30"
         ],
         "p_o_3_5_game":[ // percent of over 3.5 goal by game in past 5 matches
            "60",
            "30"
         ],
         "p_t_g_s":[ // total goals scored in last 5 matches
             "60", // teamA (home) number of goals
             "30"  // teamB (home) number of goals
         ],
         "p_g_s_0_15":[ // goals scored between 0 and 15 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_s_16_30":[ // goals scored between 16 and 30 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_s_31_45":[ // goals scored between 31 and end first half in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_s_46_60":[ // goals scored between 46 and 60 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_s_61_75":[ // goals scored between 61 and 75 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_s_76_90":[ // goals scored between 76 and end second half in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_t_g_c":[ // total goals conceded in last 5 matches
             "60", // teamA (home) number of goals
             "30"  // teamB (home) number of goals
         ],
         "p_g_c_0_15":[ // goals conceded between 0 and 15 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_c_16_30":[ // goals conceded between 16 and 30 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_c_31_45":[ // goals conceded between 31 and end first half in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_c_46_60":[ // goals conceded between 46 and 60 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_c_61_75":[ // goals conceded between 61 and 75 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_c_76_90":[ // goals conceded between 76 and end second half in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "bet365_url" : "https://www.bet365.EXT/#/AC/B1/C1/D8/E130968528/F3/I0/"
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="Past" %}

```javascript
{
   "success":1,
   "pagination":{
      "current":1,
      "prev":false,
      "next":true,
      "per_page":100,
      "pages":5
   },
   "data":[
      {
         "id":"6044182dd31fdc64",
         "h":"Campinense Clube",
         "h_id":"5fda6031b85b47ea",
         "a":"EC Bahia",
         "a_id":"5fda5fcebabd1ab4",
         "l":"Brasile - Coppa di Brasile",
         "l_id":"5fda5fa7a37c687c",
         "l_c":"BR",
         "start":"2021-03-10 00:30:00",
         "status":null,
         "est_e":"0",
         "hc":"0",
         "ac":"0",
         "hg":"0",
         "ag":"0",
         "hrc":"0",
         "arc":"0",
         "hyc":"0",
         "ayc":"0",
         "hf_hc":"0",
         "hf_ac":"0",
         "hf_hg":"0",
         "hf_ag":"0",
         "ish":"0",
         "events":[
            {
               "tp":"c", // type can be: c (corner), g (goal), rc (red_card), yc (yellow_card), su (substitution), pos (penalty overtime score), pom (penalty overtime miss), pm (penalty miss), ps (penalty score)
               "h":"a",  // refe team h (home teamA), a (away teamB)
               "t":"26"  // time of events in minute
            },
            ...
         ],
         "p_odds":[
            "9.000",
            "6.500",
            "1.200"
         ],
         "i_odds":[
            null,
            null,
            null
         ],
         "po_odds":[
            "6.500",
            "4.000",
            "1.400"
         ],
         "p_asian":[
            "+1.0"
         ],
         "i_asian":[
            ""
         ],
         "p_corner":[
            "10.5"
         ],
         "i_corner":[
            ""
         ],
         "p_corner_h":[
            "5"
         ],
         "i_corner_h":[
            ""
         ],
         "p_goal":[
            "2.5,3.0"
         ],
         "ou_odds":[
            "2.050",
            "1.800",
            "2.5,3.0"
         ],
         "i_goal":[
            ""
         ],
         "p_goal_h":[
            "1.0"
         ],
         "i_goal_h":[
            ""
         ],
         "asian_corner":[
            ""
         ],
         "attacks":[
            "0",
            "0"
         ],
         "attacks_h":[
            "0",
            "0"
         ],
         "dang_attacks":[
            "0",
            "0"
         ],
         "dang_attacks_h":[
            "0",
            "0"
         ],
         "shot_on":[
            "0",
            "0"
         ],
         "shot_on_h":[
            "0",
            "0"
         ],
         "shot_off":[
            "0",
            "0"
         ],
         "shot_off_h":[
            "0",
            "0"
         ],
         "possess":[
            "0",
            "0"
         ],
         "possess_h":[
            "0",
            "0"
         ],
         "g_a":[
            "0",
            "0"
         ],
         "o_s":[
            "0",
            "0"
         ],
         "fo":[
            "0",
            "0"
         ]
      },
      ...
   ]
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/emulation/totalcorner/match/schedule/?date=DATE&t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/emulation/totalcorner/match/schedule/?date=DATE&t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/emulation/totalcorner/match/schedule/?date=DATE&t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/emulation/totalcorner/match/schedule/?date=DATE&t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/emulation/totalcorner/match/schedule/?date=DATE&t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/emulation/totalcorner/match/schedule/?date=DATE&t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/v1/emulation/totalcorner/match/schedule/?date=DATE';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "x-rapidapi-host: soccer-football-info.p.rapidapi.com",
        "x-rapidapi-key: TOKEN"
    ],
));

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/v1/emulation/totalcorner/match/schedule/?date=DATE", {
    "method": "GET",
    "headers": {
        "x-rapidapi-key": "TOKEN",
        "x-rapidapi-host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/v1/emulation/totalcorner/match/schedule/?date=DATE",
  headers: {
   "x-rapidapi-key": "TOKEN",
     "x-rapidapi-host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/v1/emulation/totalcorner/match/schedule/?date=DATE"

headers = {
    "x-rapidapi-key": "TOKEN",
      "x-rapidapi-host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/v1/emulation/totalcorner/match/schedule/?date=DATE \
    --header 'x-rapidapi-host: soccer-football-info.p.rapidapi.com' \
    --header 'x-rapidapi-key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/v1/emulation/totalcorner/match/schedule/?date=DATE"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("x-rapidapi-key", "TOKEN")
    req.Header.Add("x-rapidapi-host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info)


# match today

## View all live matches with totalcorner schema  ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/emulation/totalcorner/match/today/`

This endpoint returns with all live matches with totalcorner schema \
The parameters **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated \
\
**Different between totalcorner version:** \
➡️ The database is different. More up-to-date and accurate to the second. \
➡️ Over and under quote of goalline under ou\_odds value. The goal line value remains at the first place of i\_goal  to ensure compatibility with the original schema. (over under bet) \
➡️No esports event. Only real football.\
➡️ Fix some not working column Id is alphanumeric not numeric \
➡️ Add some data like team performance WWLLLD (Win Loss Draw) (from left to right)\
➡️ "est\_e" value that indicate estimate extra\_time ("0" as default)\
➡️Translated team name and championship name with bet365 translation ref (param **`l`** ) \
➡️ **Trend stats 15 minute and 5 minute!**\
➡️ Advance stats: avg goal in past match, over under percent, btts percent ecc.. see response \
➡️ Dropping odd counter (How many times does a quota dropping)\
➡️ Don't need to use a long url eg. \&type=inplay\&columns=events,odds,asian ecc all data will be always sent. No performance problem\
➡️Use this call due statistics use ? with **`o`** param to "yes" can get all matches that are in overtime (totalcorner main call don't show it, default value to "no"\
➡️[Dominance index](/dominance-index)\
➡️ Add `bet365_url` that contains bet365 url match. \
Please note, this is the link pointing to the match. After kickoff, the link may change but bet365 **should send** you back to the updated link.\
You have to replace .EXT with your needed extension ".com, .it etc..."\
\
**Why?**\
Because of our customers have written software/bots and applications based on the totalcorner scheme. Changing APIs would mean rewriting everything. This way our customers can access our data, and not change their software!

#### Query Parameters

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| t    | string | Your API Token  **`DIRECT API ONLY`**                   |
| o    | string | Show overtime matches yes or no (default value is "no") |
| l    | string | Language code (default value is "en\_US")               |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "success":1,
   "pagination":{
      "current":1,
      "prev":false,
      "next":false,
      "per_page":999999,
      "pages":1
   },
   "data":[
      {
         "id":"5ff9ed4173e45e0c", // match id
         "h":"7 de Abril",   // team A (home) name
         "h_id":"5fda6030d774e054", // team A (home) id
         "a":"Barra da Tijuca RJ", // team A (away) name
         "a_id":"5fda600303163b37", // team A (away) id
         "l":"Brasile - Campeonato Carioca B2", // league name
         "l_id":"5fda5fa85103d944", // league id
         "l_c": "BR", // league country code
         "start":"2021-01-09 18:00:00", // start match
         "status":"34", // timer of match only minute +xx if extra time("45:00+1"), "half" if match is in break
         "est_e": "0", // estimate extra time (when know) "0" default
         "hc":"0", // team A (home) corner
         "ac":"3", // team B (away) corner
         "hg":"0", // team A (home) goal
         "ag":"0", // team B (away) goal
         "hrc":"0", // team A (home) red card
         "arc":"0", // team B (away) red card
         "hyc":"0", // team A (home) yellow card
         "ayc":"0", // team B (away) yellow card
         "hd_avg2_5" : "10.5", // team A (home) dominance avg 2.5
         "ad_avg2_5" : "10.5", // team B (away) dominance avg 2.5
         "hf_hc":"0", // team A (home) half corner 0 if not in 2 h
         "hf_ac":"0", // team B (away) half corner 0 if not in 2 h
         "hf_hg":"0", // team A (home) half goal 0 if not in 2 h
         "hf_ag":"0", // team B (away) half goal 0 if not in 2 h
         "ish":"0", // 0 = 1 half 1 = 2 half
         "hp" : "2", // home position in champioship
         "ap" : "5", // away position in champioship
         "h_perf" : "WWLDL", // home past 5 match performance
         "a_perf" : "WWLDL", // away past 5 match performance
         "h_xG":[ // xG null if missing
            "1.08", // kickoff xG value
            "0.70" //  current xG value
         ], 
         "a_xG":[ // xG null if missing
            "1.08", // kickoff xG value
            "0.70" //  current xG value
         ],
         "events":[
            {
               "tp":"c", // type can be: c (corner), g (goal), rc (red_card), yc (yellow_card), su (substitution), pos (penalty overtime score), pom (penalty overtime miss), pm (penalty miss), ps (penalty score), gc (goal cancel)
               "h":"a",  // refe team h (home teamA), a (away teamB)
               "t":"26"  // time of events in minute
            },
            ...
         ],
         "d_index": [
            {
                "timer":"00:00", // timer of dominance index
                "teamA":"5",
                "teamB":"5"
             },
             ...
         ],
         "p_odds":[ // kickoff 1x2 odds
            "7.000", // 1 odd
            "3.900", // X odd
            "1.400"  // 2 odd
         ],
         "i_odds":[ // in play 1x2 odds
            "5.500", // 1 odd
            "3.100", // X odd
            "1.727"  // 2 odd
         ],
         "po_odds":[ // pre-match odds, opening
            "7.000", // 1 odd
            "3.900", // X odd
            "1.400" // 2 odd
         ],
         "h_odds_dropping":[
            "25", // number of dropping odds for home team
            "33" // last minute of dropping odds
         ],
         "a_odds_dropping":[
            "15", // number of dropping odds for away team
            "30" // last minute of dropping odds
         ],
         "x_odds_dropping":[
            "5", // number of dropping odds for draw result
            "34" // last minute of dropping odds
         ],
         "p_asian":[ // pre match asian handicap
            "+1.0,+1.5"
         ],
         "i_asian":[  // in play asian handicap
            "+0.75"
         ],
         "p_corner":[ // pre match corner line
            "9.5"
         ],
         "i_corner":[ // in play corner line
            "9"
         ],
         "p_corner_h":[ // pre match corner line half
            "9.5"
         ],
         "i_corner_h":[ // in play corner line half
            "9"
         ],
         "p_goal":[ // pre match goal line
            "3.0"
         ],
         "i_goal":[ // in play goal line
            "1.75"
         ],
         "p_goal":[ // pre match goal line half
            "3.0"
         ],
         "i_goal":[ // in play goal line half
            "1.75"
         ],
         "ou_odds":[ // in play goal line
            "2.000", // over odds
            "1.500", // under odds
            "1.75" // goal line
         ],
         "asian_corner":[ // in play asian corner handicap
            ""
         ],
         "attacks":[
            "37",  // teamA (home)
            "41"  // teamB (away)
         ],
         "attacks_h":[ // half time
            "37",
            "41"
         ],
         "attacks_15":[ // last 15 minute attacks
            "20",  
            "15"  
         ],
         "attacks_5":[ // last 5 minute attacks
            "6", 
            "3"  
         ],
         "dang_attacks":[
            "18",
            "34"
         ],
         "dang_attacks_h":[ // half time
            "18",
            "34"
         ],
         "dang_attacks_15":[ // last 15 minute dang attacks
            "12",  
            "20"  
         ],
         "dang_attacks_5":[ // last 5 minute dang attacks
            "3", 
            "7"  
         ],
         "shot_on":[
            "1",
            "0"
         ],
         "shot_on_h":[ // half time
            "0",
            "0"
         ],
         "shot_on_15":[ // last 15 minute shot on
            "0",  
            "0"  
         ],
         "shot_on_5":[ // last 5 minute shot on
            "1", 
            "0"  
         ],
         "shot_off":[
            "2",
            "1"
         ],
         "shot_off_h":[ // half time
            "2",
            "1"
         ],
         "shot_off_15":[ // last 15 minute shot off
            "0",  
            "0"  
         ],
         "shot_off_5":[ // last 5 minute shot off
            "1", 
            "1"  
         ],
         "corners_15":[ // last 15 minute corners
            "0",  
            "0"  
         ],
         "corners_5":[ // last 5 minute corners
            "1", 
            "1"  
         ],
         "possess":[
            "40", // teamA (home)
            "60" // teamB (away)
         ],
         "possess_h":[ // half time
            "40",
            "60"
         ],
         "g_a":[ // goal attemps
            "2", // teamA (home)
            "5" // teamB (away)
         ],
         "o_s":[ // off side
            "6",
            "7"
         ],
         "fo":[ // total fouls
             "30", // teamA (home)
             "22"  // teamB (away)
         ],
         "p_avg_g_g":[ // average game goals in past 5 matches
            "2.5", // teamA (home)
            "1"  // teamB (away)
         ],
         "p_avg_g_s":[ // average goals scored in past 5 matches
            "0.5",
            "0.5"
         ],
         "p_avg_g_c":[ // average goals conceded in past 5 matches
            "1",
            "0.5"
         ],
         "p_o_1_5_t":[ // percent of over 1.5 goal by team in past 5 matches
            "60",
            "30"
         ],
         "p_btts":[ // percent of BTTS (Goal/Goal) in past 5 matches
            "20",
            "80"
         ],
         "p_o_0_5_game":[ // percent of over 0.5 goal by game in past 5 matches
            "60",
            "30"
         ],
         "p_o_1_5_game":[ // percent of over 1.5 goal by game in past 5 matches
            "60",
            "30"
         ],
         "p_o_2_5_game":[ // percent of over 2.5 goal by game in past 5 matches
            "60",
            "30"
         ],
         "p_o_3_5_game":[ // percent of over 3.5 goal by game in past 5 matches
            "60",
            "30"
         ],
         "p_t_g_s":[ // total goals scored in last 5 matches
             "60", // teamA (home) number of goals
             "30"  // teamB (home) number of goals
         ],
         "p_g_s_0_15":[ // goals scored between 0 and 15 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_s_16_30":[ // goals scored between 16 and 30 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_s_31_45":[ // goals scored between 31 and end first half in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_s_46_60":[ // goals scored between 46 and 60 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_s_61_75":[ // goals scored between 61 and 75 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_s_76_90":[ // goals scored between 76 and end second half in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_t_g_c":[ // total goals conceded in last 5 matches
             "60", // teamA (home) number of goals
             "30"  // teamB (home) number of goals
         ],
         "p_g_c_0_15":[ // goals conceded between 0 and 15 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_c_16_30":[ // goals conceded between 16 and 30 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_c_31_45":[ // goals conceded between 31 and end first half in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_c_46_60":[ // goals conceded between 46 and 60 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_c_61_75":[ // goals conceded between 61 and 75 minute in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "p_g_c_76_90":[ // goals conceded between 76 and end second half in last 5 matches
             "1", // teamA (home) number of goals
             "2", // teamB (home) number of goals
             "10", // teamA (home) percent of total
             "20"  // teamB (home) percent of total
         ],
         "bet365_url" : "https://www.bet365.EXT/#/AC/B1/C1/D8/E130968528/F3/I0/"
      },
      ...
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/emulation/totalcorner/match/today/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/emulation/totalcorner/match/today/", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/emulation/totalcorner/match/today/'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/emulation/totalcorner/match/today/"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/emulation/totalcorner/match/today/'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/emulation/totalcorner/match/today/"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/emulation/totalcorner/match/today/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/emulation/totalcorner/match/today/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/emulation/totalcorner/match/today/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/emulation/totalcorner/match/today/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/emulation/totalcorner/match/today/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/emulation/totalcorner/match/today/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info)


# Languages

List of endpoints of Languages entity.

[**List**](/v1/countries/list) **-** */v1/languages/list*  ⬜ 🟨 🟦 🟩\
List of available languages with unique code


# list

## List of all languages  ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/languages/list/`

This endpoint returns with all languages available on this platform. You can use this call to get language code and use it in another endpoints.\
Format CSV is in MS excel compatible mode (double click open without import!)

#### Query Parameters

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                    |
| f    | string | Format response can be "json" or "csv" (Default "json") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
  "status": 200,
  "errors": [],
      "pagination": [],
      "result": [
          {
            "code":"en_US",    // unique language code
            "name" : "English",
            "native_name" : "English",
            "note":"Full translated (main)", 
            "source": "bet365,unibet,manual" // where we get the translate
          },
          ...
      ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
code;name;native_name;note;source
cs_CZ;Czech;Česky;"60% of translate";bet365,unibet,manual
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/languages/list/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/languages/list/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/languages/list/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/languages/list/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/languages/list/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/languages/list/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/languages/list/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/languages/list/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/languages/list/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/languages/list/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/languages/list/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/languages/list/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info)


# Live

List of endpoints of Live entity.

[**Full**](/v1/live/live-full) **-** */v1/live/full* 🟨 🟦 🟩\
List of all live events with stats, events and odds

[**Basic**](/v1/live/live-basic) **-** */v1/live/basic* 🟨 🟦 🟩\
List of all live events with stats and events

[**WS**](/v1/live/live-ws) **-** */v1/live/ws* 🟩\
List of all live events with WebSocket dual ID mapping (MEGA only)


# live full

## View all live matches (full) 🟨 ⬜ 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/live/full/`

This endpoint returns with all live matches \
The parameter **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated.\
Format CSV is in MS excel compatible mode (double click open without import!)

Add `bet365_url` that contains bet365 url match. \
Please note, this is the link pointing to the match. After kickoff, the link may change but bet365 **should send** you back to the updated link.\
You have to replace .EXT with your needed extension ".com, .it etc..."

#### Query Parameters

| Name | Type   | Description                                                |
| ---- | ------ | ---------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                       |
| f    | string | Format response can be "json" or "csv" (default "json")    |
| l    | string | Language code (default value is "en\_US")                  |
| e    | string | Returns match events "yes" \| "no" (default value is "no") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":"5ff7a0c8ceb4f157",
         "date":"2021-01-09 16:00:00",
         "timer":"90:00+04:36", // match timer if is in extra time there is +minute eg. 90:00+01:00
         "est_e_time" : "6", // estimate extra time false if unknown
         "in_play":false, // if match is in play or not (false if match is just ended or is in time break)
         "championship":{
            "id":"5fda5fa8541c9de5",
            "name":"Bahrain Premier League",
            "s_name": "Bahrain Premier League 20/21", // season name
            "country" : "BH"
         },
         "teamA":{
            "id":"5fda5fcd1aa9fae1",
            "name":"Al-Muharraq",
            "score":{
               "f":"2",
               "1h":"0",
               "2h":"2",
               "o":null,
               "p":null
            },
            "perf":{
                "l_5_matches" : "WLWLW", // last 5 match performance (from left to right)
                "avg_game_goals" : "2.5",
                "avg_goals_scored" : "1.5",
                "avg_goals_conceded" : "0.5",
                "o_1_5_team" : "50", // percent of over 1.5 by team in last 5 matches
                "btts" : "60", // percent of btts
                "o_0_5_game" : "100", // percent of over 0.5 by game in last 5 matches
                "o_1_5_game" : "100", // percent of over 1.5 by game in last 5 matches
                "o_2_5_game" : "100", // percent of over 2.5 by game in last 5 matches
                "o_3_5_game" : "100", // percent of over 3.5 by game in last 5 matches
                "tot_goals_scored" : "10", // total goals scored in last 5 matches
                "goals_scored_0_15": ["0","0"], // goals scored between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_16_30": ["1","10"], // goals scored between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_31_45": ["1","10"], // goals scored between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_46_60": ["1","10"], // goals scored between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_61_75": ["5","50"], // goals scored between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_76_90": ["2","20"], // goals scored between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "tot_goals_conceded": "10", // total goals conceded in last 5 matches
                "goals_conceded_0_15": ["0","0"], // goals conceded between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_16_30": ["1","10"], // goals conceded between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_31_45": ["1","10"], // goals conceded between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_46_60": ["1","10"], // goals conceded between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_61_75": ["5","50"], // goals conceded between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_76_90": ["2","20"] // goals conceded between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
            },
            "position" : "1", // position in championship (if)
            "stats":{
               "possession":"40",
               "attacks":{
                  "n":"125", // normal
                  "n_15": "30", // normal last 15 minutes
                  "n_5": "5", // normal last 5 minutes 
                  "d":"83", // dangerous
                  "d_15": "30", // dangerous last 15 minutes
                  "d_5": "5", // dangerous last 5 minutes
                  "o_s":"5" // off side
               },
               "shoots":{
                  "t":"3", // total
                  "off":"2", // off target shot
                  "off_15": "2", // off target last 15 minutes
                  "off_5": "1", // off target last 5 minutes
                  "on":"1", // on target shot
                  "on_15": "1", // on target last 15 minutes
                  "on_5": "1", // on target last 5 minutes
                  "g_a":"2" // goal attemps
               },
               "penalties":"0",
               "corners":{
                  "t":"4", // total
                  "f":"4",// final 
                  "h":"2" // 1 half
                  "c_15": "2", // corners last 15 minutes
                  "c_5": "1", // corners last 5 minutes
               },
               "fouls":{
                  "t":null, // total fouls
                  "y_c":"0", // yellow card
                  "y_t_r_c":null, // yellow to red card
                  "r_c":"0"  // red card
               },
               "substitutions":"2",
               "throwins":null,
               "injuries":null,
               "dominance_avg_2_5": "10.10", // average of last 2.5 minutes of dominance index
               "xG" : {
                 "kickoff" : "1.02", // Expected goal at kickoff
                 "live" : "0.88" // Current expected goal
               }
            }
         },
         "teamB":{
            ...
            // same as teamA
         },
         "events":[ // only if param "e" is "yes"
            {
               "type":"red_card", // can be: corner, goal, yellow_card, red_card, substitution, penalty_ot_score, penalty_ot_miss, cancel_goal
               "timer":"120+1", // event time if + it's overtime or null if is in penalties
               "team":"A" // ref team A or B
            },
            ...
         ],
         "dominance_index": [
            {
                "timer":"00:00", // timer of dominance index
                "teamA":"5",
                "teamB":"5"
             },
             ...
         ],
         "odds":{
             "starting" : {
               "1X2" :{
                  "bet365":{
                     "1":"1.364",
                     "2":"6.500",
                     "X":"5.000"
                  },
                  "unibet":{
                     "1":"1.3",
                     "2":"8.5",
                     "X":"5"
                  }
               },
               "over_under" : {
                  "bet365":{
                     "o":"1.925",
                     "u":"1.875",
                     "v":"3"
                  },
                  "unibet":{
                     "o":"2.33",
                     "u":"1.55",
                     "v":"3.5"
                  }
               },
               "asian_handicap":{
                  "bet365":{
                     "1":"1.775",
                     "2":"2.025",
                     "v":"0.0,-0.5"
                  },
                  "unibet":{
                     "1":"1.775",
                     "2":"2.025",
                     "v":"0.0,-0.5"
                  }   
               },
            },
            "kickoff":{
               "1X2":{
                  "bet365":{
                     "1":"2.300",
                     "2":"2.700",
                     "X":"3.250"
                  },
                  "unibet":{
                     "1":"2.25",
                     "2":"2.65",
                     "X":"3.1"
                  }
               },
               "asian_handicap":{
                  "bet365":{
                     "1":"1.775",
                     "2":"2.025",
                     "v":"0.0,-0.5"
                  }
               },
               "over_under":{
                  "bet365":{
                     "o":"1.950",
                     "u":"1.850",
                     "v":"2.5"
                  },
                  "unibet":{
                     "o":"1.86",
                     "u":"1.86",
                     "v":"2.5"
                  }
               },
               "asian_corner":{
                  "bet365":{
                     "o":"1.900",
                     "u":"1.900",
                     "v":"10.5"
                  }
               },
               "1h_asian_handicap":{
                  "bet365":{
                     "1":"2.150",
                     "2":"1.675",
                     "v":"0.0,-0.5"
                  }
               },
               "1h_goalline":{
                  "bet365":{
                     "o":"1.900",
                     "u":"1.900",
                     "v":"1.0"
                  }
               },
               "1h_asian_corner":{
                  "bet365":{
                     "o":"1.975",
                     "u":"1.825",
                     "v":"5"
                  }
               },
               "1h_result":{
                  "bet365":{
                     "1":"3.000",
                     "2":"3.400",
                     "X":"2.100"
                  }
               }
            },
            "live":{
               ...
               // same kickoff
            },
            "dropping":{
               "1": [
                  "25", // number of dropping odds
                  "33:30" // timer of last dropping
               ],
               "2" : [
                  "20", // number of dropping odds
                  "29:30" // timer of last dropping
               ],
               "X" : [
                  "15", // number of dropping odds
                  "30:30" // timer of last dropping
               ]
            }
         },
         "bet365_url" : "https://www.bet365.EXT/#/AC/B1/C1/D8/E128998076/F3"
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
id;date;timer;est_e_time;in_play;championship_id;championship_name;season_name;teamA_id;teamA_name;teamB_id;teamB_name;teamA_score_f;teamB_score_f;teamA_score_1h;teamB_score_1h;teamA_score_2h;teamB_score_2h;teamA_score_o;teamB_score_o;teamA_score_p;teamB_score_p;teamA_possession;teamB_possession;teamA_attacks_n;teamB_attacks_n;teamA_attacks_n_15;teamB_attacks_n_15;teamA_attacks_n_5;teamB_attacks_n_5;teamA_attacks_d;teamB_attacks_d;teamA_attacks_d_15;teamB_attacks_d_15;teamA_attacks_d_5;teamB_attacks_d_5;teamA_off_sides;teamB_off_sides;teamA_shoots;teamB_shoots;teamA_shoots_on_target;teamB_shoots_on_target;teamA_shoots_on_target_15;teamB_shoots_on_target_15;teamA_shoots_on_target_5;teamB_shoots_on_target_5;teamA_shoots_off_target;teamB_shoots_off_target;teamA_shoots_off_target_15;teamB_shoots_off_target_15;teamA_shoots_off_target_5;teamB_shoots_off_target_5;teamA_goal_attemps;teamB_goal_attemps;teamA_penalties;teamB_penalties;teamA_corners;teamB_corners;teamA_corners_f;teamB_corners_f;teamA_corners_h;teamB_corners_h;teamA_corners_15;teamB_corners_15;teamA_corners_5;teamB_corners_5;teamA_fouls;teamB_fouls;teamA_yellow_cards;teamB_yellow_cards;teamA_yellow_t_red_cards;teamB_yellow_t_red_cards;teamA_red_cards;teamB_red_cards;teamA_substitutions;teamB_substitutions;teamA_throwins;teamB_throwins;teamA_injuries;teamB_injuries;teamA_d_index_avg_2_5;teamB_d_index_avg_2_5;teamA_kickoff_xG;teamB_kickoff_xG;teamA_xG;teamB_xG;odd_starting_1x2_bet365_1;odd_starting_1x2_bet365_X;odd_starting_1x2_bet365_2;odd_starting_1x2_unibet_1;odd_starting_1x2_unibet_X;odd_starting_1x2_unibet_2;odd_starting_over_under_bet365_o;odd_starting_over_under_bet365_u;odd_starting_over_under_bet365_v;odd_starting_over_under_unibet_o;odd_starting_over_under_unibet_u;odd_starting_over_under_unibet_v;odd_starting_asian_handicap_bet365_1;odd_starting_asian_handicap_bet365_2;odd_starting_asian_handicap_bet365_v;odd_starting_asian_handicap_unibet_1;odd_starting_asian_handicap_unibet_2;odd_starting_asian_handicap_unibet_v;odd_kickoff_1x2_bet365_1;odd_kickoff_1x2_bet365_X;odd_kickoff_1x2_bet365_2;odd_kickoff_1x2_unibet_1;odd_kickoff_1x2_unibet_X;odd_kickoff_1x2_unibet_2;odd_dropping_count_1;odd_dropping_count_X;odd_dropping_count_2;odd_dropping_timer_1;odd_dropping_timer_X;odd_dropping_timer_2;odd_kickoff_asian_handicap_bet365_1;odd_kickoff_asian_handicap_bet365_2;odd_kickoff_asian_handicap_bet365_v;odd_kickoff_asian_handicap_unibet_1;odd_kickoff_asian_handicap_unibet_2;odd_kickoff_asian_handicap_unibet_v;odd_kickoff_over_under_bet365_o;odd_kickoff_over_under_bet365_u;odd_kickoff_over_under_bet365_v;odd_kickoff_over_under_unibet_o;odd_kickoff_over_under_unibet_u;odd_kickoff_over_under_unibet_v;odd_kickoff_asian_corner_bet365_o;odd_kickoff_asian_corner_bet365_u;odd_kickoff_asian_corner_bet365_v;odd_kickoff_asian_corner_unibet_o;odd_kickoff_asian_corner_unibet_u;odd_kickoff_asian_corner_unibet_v;odd_kickoff_1h_asian_handicap_bet365_1;odd_kickoff_1h_asian_handicap_bet365_2;odd_kickoff_1h_asian_handicap_bet365_v;odd_kickoff_1h_asian_handicap_unibet_1;odd_kickoff_1h_asian_handicap_unibet_2;odd_kickoff_1h_asian_handicap_unibet_v;odd_kickoff_1h_goal_line_bet365_o;odd_kickoff_1h_goal_line_bet365_u;odd_kickoff_1h_goal_line_bet365_v;odd_kickoff_1h_goal_line_unibet_o;odd_kickoff_1h_goal_line_unibet_u;odd_kickoff_1h_goal_line_unibet_v;odd_kickoff_1h_asian_corner_bet365_o;odd_kickoff_1h_asian_corner_bet365_u;odd_kickoff_1h_asian_corner_bet365_v;odd_kickoff_1h_asian_corner_unibet_o;odd_kickoff_1h_asian_corner_unibet_u;odd_kickoff_1h_asian_corner_unibet_v;odd_kickoff_1h_result_bet365_1;odd_kickoff_1h_result_bet365_X;odd_kickoff_1h_result_bet365_2;odd_kickoff_1h_result_unibet_1;odd_kickoff_1h_result_unibet_X;odd_kickoff_1h_result_unibet_2;odd_live_1x2_bet365_1;odd_live_1x2_bet365_X;odd_live_1x2_bet365_2;odd_live_1x2_unibet_1;odd_live_1x2_unibet_X;odd_live_1x2_unibet_2;odd_live_asian_handicap_bet365_1;odd_live_asian_handicap_bet365_2;odd_live_asian_handicap_bet365_v;odd_live_asian_handicap_unibet_1;odd_live_asian_handicap_unibet_2;odd_live_asian_handicap_unibet_v;odd_live_over_under_bet365_o;odd_live_over_under_bet365_u;odd_live_over_under_bet365_v;odd_live_over_under_unibet_o;odd_live_over_under_unibet_u;odd_live_over_under_unibet_v;odd_live_asian_corner_bet365_o;odd_live_asian_corner_bet365_u;odd_live_asian_corner_bet365_v;odd_live_asian_corner_unibet_o;odd_live_asian_corner_unibet_u;odd_live_asian_corner_unibet_v;odd_live_1h_asian_handicap_bet365_1;odd_live_1h_asian_handicap_bet365_2;odd_live_1h_asian_handicap_bet365_v;odd_live_1h_asian_handicap_unibet_1;odd_live_1h_asian_handicap_unibet_2;odd_live_1h_asian_handicap_unibet_v;odd_live_1h_goal_line_bet365_o;odd_live_1h_goal_line_bet365_u;odd_live_1h_goal_line_bet365_v;odd_live_1h_goal_line_unibet_o;odd_live_1h_goal_line_unibet_u;odd_live_1h_goal_line_unibet_v;odd_live_1h_asian_corner_bet365_o;odd_live_1h_asian_corner_bet365_u;odd_live_1h_asian_corner_bet365_v;odd_live_1h_asian_corner_unibet_o;odd_live_1h_asian_corner_unibet_u;odd_live_1h_asian_corner_unibet_v;odd_live_1h_result_bet365_1;odd_live_1h_result_bet365_X;odd_live_1h_result_bet365_2;odd_live_1h_result_unibet_1;odd_live_1h_result_unibet_X;odd_live_1h_result_unibet_2;teamA_position;teamB_position;teamA_past_perfomance;teamB_past_perfomance;teamA_avg_game_goals;teamB_avg_game_goals;teamA_avg_goals_scored;teamB_avg_goals_scored;teamA_avg_goals_conceded;teamB_avg_goals_conceded;teamA_o_1_5_team;teamB_o_1_5_team;teamA_btts;teamB_btts;teamA_o_0_5_game;teamB_o_0_5_game;teamA_o_1_5_game;teamB_o_1_5_game;teamA_o_2_5_game;teamB_o_2_5_game;teamA_o_3_5_game;teamB_o_3_5_game;teamA_t_g_scored;teamB_t_g_scored;teamA_g_scored_0_15_numb;teamB_g_scored_0_15_numb;teamA_g_scored_0_15_perc;teamB_g_scored_0_15_perc;teamA_g_scored_16_30_numb;teamB_g_scored_16_30_numb;teamA_g_scored_16_30_perc;teamB_g_scored_16_30_perc;teamA_g_scored_31_45_numb;teamB_g_scored_31_45_numb;teamA_g_scored_31_45_perc;teamB_g_scored_31_45_perc;teamA_g_scored_46_60_numb;teamB_g_scored_46_60_numb;teamA_g_scored_46_60_perc;teamB_g_scored_46_60_perc;teamA_g_scored_61_75_numb;teamB_g_scored_61_75_numb;teamA_g_scored_61_75_perc;teamB_g_scored_61_75_perc;teamA_g_scored_76_90_numb;teamB_g_scored_76_90_numb;teamA_g_scored_76_90_perc;teamB_g_scored_76_90_perc;teamA_t_g_conceded;teamB_t_g_conceded;teamA_g_conceded_0_15_numb;teamB_g_conceded_0_15_numb;teamA_g_conceded_0_15_perc;teamB_g_conceded_0_15_perc;teamA_g_conceded_16_30_numb;teamB_g_conceded_16_30_numb;teamA_g_conceded_16_30_perc;teamB_g_conceded_16_30_perc;teamA_g_conceded_31_45_numb;teamB_g_conceded_31_45_numb;teamA_g_conceded_31_45_perc;teamB_g_conceded_31_45_perc;teamA_g_conceded_46_60_numb;teamB_g_conceded_46_60_numb;teamA_g_conceded_46_60_perc;teamB_g_conceded_46_60_perc;teamA_g_conceded_61_75_numb;teamB_g_conceded_61_75_numb;teamA_g_conceded_61_75_perc;teamB_g_conceded_61_75_perc;teamA_g_conceded_76_90_numb;teamB_g_conceded_76_90_numb;teamA_g_conceded_76_90_perc;teamB_g_conceded_76_90_perc;bet365_url
5b41f242cbaaf4fa;"2024-03-15 10:30:00";83:08;no;yes;fe3e394a6128e50b;"Australia Queensland Premier League 2";;2648f60d07d31673;"North Lakes United";6dd95985f12c4d15;"North Star";2;4;1;2;2;4;;;;;;;39;28;5;5;2;2;46;44;5;4;1;2;;;9;9;7;7;1;0;1;0;2;2;0;0;0;0;;;0;0;6;5;;;5;4;0;0;0;0;;;0;2;;;0;0;0;0;;;;;0.67;0.67;;;;;4.000;4.333;1.571;;;;1.900;1.900;3.0,3.5;;;;1.825;1.975;1;;;;6.000;6.000;1.333;;;;77;51;86;80;80;82;1.900;1.900;+0.75;;;;1.950;1.850;5;;;;1.900;1.900;10.5;;;;1.950;1.850;+0.25;;;;1.775;2.025;2.5;;;;2.000;1.800;5;;;;9.000;4.750;1.250;;;;34.000;21.000;1.015;131;30;0;2.100;1.700;0;1.26;3.8;2.5;2.025;1.775;6.5;1.92;1.85;6.5;1.625;2.250;12;;;;2.150;1.675;0;;;;3.800;1.250;3.5;;;;2.200;1.650;8.5;;;;41.000;11.000;1.050;;;;;;WWLLL;WWWWD;4.6;3.8;1.6;2.4;3;1.4;20;80;80;80;100;100;80;80;80;80;80;40;8;12;1;1;13;8;;3;;25;4;2;50;17;1;2;13;17;2;1;25;8;;3;;25;15;7;3;2;19;29;3;2;19;29;4;2;25;29;;;;;2;;13;;4;1;25;14;https://www.bet365.EXT/#/AC/B1/C1/D8/E152052371/F3/I0/
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/live/full/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/live/full/", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/live/full/'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/live/full/"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/live/full/'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/live/full/"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/live/full/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/live/full/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/live/full/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/live/full/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/live/full/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/live/full/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# live basic

## View all live matches (basic) ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/live/basic/`

This endpoint returns with all live matches \
The parameter **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated.\
Format CSV is in MS excel compatible mode (double click open without import!)

Add `bet365_url` that contains bet365 url match. \
Please note, this is the link pointing to the match. After kickoff, the link may change but bet365 **should send** you back to the updated link.\
You have to replace .EXT with your needed extension ".com, .it etc..."

#### Query Parameters

| Name | Type   | Description                                                |
| ---- | ------ | ---------------------------------------------------------- |
| t    | string | You API Token **`DIRECT API ONLY`**                        |
| f    | string | Format response can be "json" or "csv" (default "json")    |
| l    | string | Language code (default value is "en\_US")                  |
| e    | string | Returns match events "yes" \| "no" (default value is "no") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":"5ff7a0c8ceb4f157",
         "date":"2021-01-09 16:00:00",
         "timer":"90:00+04:36", // match timer if is in extra time there is +minute eg. 90:00+01:00
         "in_play":false, // if match is in play or not (false if match is just ended or is in time break)
         "est_e_time" : "6", // estimate extra time false if unknown
         "championship":{
            "id":"5fda5fa8541c9de5",
            "name":"Bahrain Premier League",
            "s_name": "Bahrain Premier League 20/21", // season name
            "country" : "BH"
         },
         "teamA":{
            "id":"5fda5fcd1aa9fae1",
            "name":"Al-Muharraq",
            "score":{
               "f":"2",
               "1h":"0",
               "2h":"2",
               "o":null,
               "p":null
            },
            "position" : "1", // position in championship (if)
            "perf":{
                "l_5_matches" : "WLWLW", // last 5 match performance (from left to right)
                "avg_game_goals" : "2.5",
                "avg_goals_scored" : "1.5",
                "avg_goals_conceded" : "0.5",
                "o_1_5_team" : "50", // percent of over 1.5 by team in last 5 matches
                "btts" : "60", // percent of btts
                "o_0_5_game" : "100", // percent of over 0.5 by game in last 5 matches
                "o_1_5_game" : "100", // percent of over 1.5 by game in last 5 matches
                "o_2_5_game" : "100", // percent of over 2.5 by game in last 5 matches
                "o_3_5_game" : "100", // percent of over 3.5 by game in last 5 matches
                "tot_goals_scored" : "10", // total goals scored in last 5 matches
                "goals_scored_0_15": ["0","0"], // goals scored between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_16_30": ["1","10"], // goals scored between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_31_45": ["1","10"], // goals scored between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_46_60": ["1","10"], // goals scored between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_61_75": ["5","50"], // goals scored between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_76_90": ["2","20"], // goals scored between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "tot_goals_conceded": "10", // total goals conceded in last 5 matches
                "goals_conceded_0_15": ["0","0"], // goals conceded between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_16_30": ["1","10"], // goals conceded between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_31_45": ["1","10"], // goals conceded between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_46_60": ["1","10"], // goals conceded between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_61_75": ["5","50"], // goals conceded between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_76_90": ["2","20"] // goals conceded between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
            },
            "stats":{
               "possession":"40",
               "attacks":{
                  "n":"125", // normal
                  "n_15": "30", // normal last 15 minutes
                  "n_5": "5", // normal last 5 minutes 
                  "d":"83", // dangerous
                  "d_15": "30", // dangerous last 15 minutes
                  "d_5": "5", // dangerous last 5 minutes
                  "o_s":"5" // off side
               },
               "shoots":{
                  "t":"3", // total
                  "off":"2", // off target shot
                  "off_15": "2", // off target last 15 minutes
                  "off_5": "1", // off target last 5 minutes
                  "on":"1", // on target shot
                  "on_15": "1", // on target last 15 minutes
                  "on_5": "1", // on target last 5 minutes
                  "g_a":"2" // goal attemps
               },
               "penalties":"0",
               "corners":{
                  "t":"4", // total
                  "f":"4",// final 
                  "h":"2" // 1 half
                  "c_15": "2", // corners last 15 minutes
                  "c_5": "1", // corners last 5 minutes
               },
               "fouls":{
                  "t":null, // total fouls
                  "y_c":"0", // yellow card
                  "y_t_r_c":null, // yellow to red card
                  "r_c":"0"  // red card
               },
               "substitutions":"2",
               "throwins":null,
               "injuries":null,
               "dominance_avg_2_5": "10.10", // average of last 2.5 minutes of dominance index
               "xG" : {
                 "kickoff" : "1.02", // Expected goal at kickoff
                 "live" : "0.88" // Current expected goal
               }
            }
         },
         "teamB":{
            ...
            // same as teamA
         },
         "events":[ // only if param "e" is "yes"
            {
               "type":"red_card", // can be: corner, goal, yellow_card, red_card, substitution, penalty_ot_score, penalty_ot_miss
               "timer":"120+1", // event time if + it's overtime or null if is in penalties
               "team":"A" // ref team A or B
            },
            ...
         ],
         "dominance_index": [
            {
                "timer":"00:00", // timer of dominance index
                "teamA":"5",
                "teamB":"5"
             },
             ...
         ],
         "bet365_url" : "https://www.bet365.EXT/#/AC/B1/C1/D8/E128998076/F3"
      },
      ...
   ]

```

{% endtab %}

{% tab title="CSV" %}

```
id;date;timer;est_e_time;in_play;championship_id;championship_name;season_name;teamA_id;teamA_name;teamB_id;teamB_name;teamA_score_f;teamB_score_f;teamA_score_1h;teamB_score_1h;teamA_score_2h;teamB_score_2h;teamA_score_o;teamB_score_o;teamA_score_p;teamB_score_p;teamA_possession;teamB_possession;teamA_attacks_n;teamB_attacks_n;teamA_attacks_n_15;teamB_attacks_n_15;teamA_attacks_n_5;teamB_attacks_n_5;teamA_attacks_d;teamB_attacks_d;teamA_attacks_d_15;teamB_attacks_d_15;teamA_attacks_d_5;teamB_attacks_d_5;teamA_off_sides;teamB_off_sides;teamA_shoots;teamB_shoots;teamA_shoots_on_target;teamB_shoots_on_target;teamA_shoots_on_target_15;teamB_shoots_on_target_15;teamA_shoots_on_target_5;teamB_shoots_on_target_5;teamA_shoots_off_target;teamB_shoots_off_target;teamA_shoots_off_target_15;teamB_shoots_off_target_15;teamA_shoots_off_target_5;teamB_shoots_off_target_5;teamA_goal_attemps;teamB_goal_attemps;teamA_penalties;teamB_penalties;teamA_corners;teamB_corners;teamA_corners_f;teamB_corners_f;teamA_corners_h;teamB_corners_h;teamA_corners_15;teamB_corners_15;teamA_corners_5;teamB_corners_5;teamA_fouls;teamB_fouls;teamA_yellow_cards;teamB_yellow_cards;teamA_yellow_t_red_cards;teamB_yellow_t_red_cards;teamA_red_cards;teamB_red_cards;teamA_substitutions;teamB_substitutions;teamA_throwins;teamB_throwins;teamA_injuries;teamB_injuries;teamA_d_index_avg_2_5;teamB_d_index_avg_2_5;teamA_kickoff_xG;teamB_kickoff_xG;teamA_xG;teamB_xG;teamA_position;teamB_position;teamA_past_perfomance;teamB_past_perfomance;teamA_avg_game_goals;teamB_avg_game_goals;teamA_avg_goals_scored;teamB_avg_goals_scored;teamA_avg_goals_conceded;teamB_avg_goals_conceded;teamA_o_1_5_team;teamB_o_1_5_team;teamA_btts;teamB_btts;teamA_o_0_5_game;teamB_o_0_5_game;teamA_o_1_5_game;teamB_o_1_5_game;teamA_o_2_5_game;teamB_o_2_5_game;teamA_o_3_5_game;teamB_o_3_5_game;teamA_t_g_scored;teamB_t_g_scored;teamA_g_scored_0_15_numb;teamB_g_scored_0_15_numb;teamA_g_scored_0_15_perc;teamB_g_scored_0_15_perc;teamA_g_scored_16_30_numb;teamB_g_scored_16_30_numb;teamA_g_scored_16_30_perc;teamB_g_scored_16_30_perc;teamA_g_scored_31_45_numb;teamB_g_scored_31_45_numb;teamA_g_scored_31_45_perc;teamB_g_scored_31_45_perc;teamA_g_scored_46_60_numb;teamB_g_scored_46_60_numb;teamA_g_scored_46_60_perc;teamB_g_scored_46_60_perc;teamA_g_scored_61_75_numb;teamB_g_scored_61_75_numb;teamA_g_scored_61_75_perc;teamB_g_scored_61_75_perc;teamA_g_scored_76_90_numb;teamB_g_scored_76_90_numb;teamA_g_scored_76_90_perc;teamB_g_scored_76_90_perc;teamA_t_g_conceded;teamB_t_g_conceded;teamA_g_conceded_0_15_numb;teamB_g_conceded_0_15_numb;teamA_g_conceded_0_15_perc;teamB_g_conceded_0_15_perc;teamA_g_conceded_16_30_numb;teamB_g_conceded_16_30_numb;teamA_g_conceded_16_30_perc;teamB_g_conceded_16_30_perc;teamA_g_conceded_31_45_numb;teamB_g_conceded_31_45_numb;teamA_g_conceded_31_45_perc;teamB_g_conceded_31_45_perc;teamA_g_conceded_46_60_numb;teamB_g_conceded_46_60_numb;teamA_g_conceded_46_60_perc;teamB_g_conceded_46_60_perc;teamA_g_conceded_61_75_numb;teamB_g_conceded_61_75_numb;teamA_g_conceded_61_75_perc;teamB_g_conceded_61_75_perc;teamA_g_conceded_76_90_numb;teamB_g_conceded_76_90_numb;teamA_g_conceded_76_90_perc;teamB_g_conceded_76_90_perc;bet365_url
5b41f242cbaaf4fa;"2024-03-15 10:30:00";85:51;no;yes;fe3e394a6128e50b;"Australia Queensland Premier League 2";;2648f60d07d31673;"North Lakes United";6dd95985f12c4d15;"North Star";2;4;1;2;2;4;;;;;;;41;29;6;5;3;2;48;44;6;3;3;1;;;9;9;7;7;1;0;0;0;2;2;0;0;0;0;;;0;0;6;5;;;5;4;0;0;0;0;;;0;2;;;0;0;0;0;;;;;1.83;0.17;;;;;;;WWLLL;WWWWD;4.6;3.8;1.6;2.4;3;1.4;20;80;80;80;100;100;80;80;80;80;80;40;8;12;1;1;13;8;;3;;25;4;2;50;17;1;2;13;17;2;1;25;8;;3;;25;15;7;3;2;19;29;3;2;19;29;4;2;25;29;;;;;2;;13;;4;1;25;14;https://www.bet365.EXT/#/AC/B1/C1/D8/E152052371/F3/I0/
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/live/basic/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/live/basic/", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/live/basic/'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/live/basic/"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/live/basic/'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/live/basic/"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/live/basic/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/live/basic/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/live/basic/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/live/basic/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/live/basic/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/live/basic/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# live ws

## View all live matches with WebSocket ID mapping 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/live/ws/`

This endpoint returns all currently live matches with the dual ID mapping system for the **MAIN\_REALTIME** WebSocket channel.\
Each ID field (match, team, championship) is an object containing two identifiers:\
**`ws_realtime`**: the ID used exclusively in the **MAIN\_REALTIME** channel messages\
**`rest_releated`**: the ID used in standard REST API endpoints and in all other WebSocket channels (MAIN, STATS, ODDS, STATS\_REALTIME, ODDS\_REALTIME)\
This mapping allows you to bridge between MAIN\_REALTIME events and the rest of the API.\
The parameter **`l`** must be a language code getted from languages/list endpoint.\
Format CSV is in MS excel compatible mode (double click open without import!)

{% hint style="warning" %}
**MAIN\_REALTIME only** — This endpoint is needed only if you subscribe to the **MAIN\_REALTIME** channel (MEGA plan 🟩). All other WebSocket channels already use REST IDs, so no mapping is required for them.
{% endhint %}

#### Query Parameters

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                    |
| f    | string | Format response can be "json" or "csv" (default "json") |
| l    | string | Language code (default value is "en\_US")               |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":{
            "ws_realtime":"a1b2c3d4e5f6a7b8", // WebSocket real-time match ID
            "rest_releated":"5ff7a0c8ceb4f157" // REST API match ID
         },
         "date":"2024-09-15 16:00:00",
         "timer":"45:00+02:10", // match timer, if in extra time: 90:00+01:00
         "est_e_time":"3", // estimated extra time, false if unknown
         "in_play":true, // if match is currently in play
         "championship":{
            "id":{
               "ws_realtime":"b2c3d4e5f6a7b8c9", // WebSocket championship ID
               "rest_releated":"5fda5fa8541c9de5" // REST API championship ID
            },
            "name":"Premier League",
            "country":"GB"
         },
         "teamA":{
            "id":{
               "ws_realtime":"c3d4e5f6a7b8c9d0", // WebSocket team ID
               "rest_releated":"5fda5fcd1aa9fae1" // REST API team ID
            },
            "name":"Manchester United",
            "score":{
               "f":"2", // final/current score
               "1h":"1", // first half score
               "2h":"1", // second half score
               "o":null, // overtime score
               "p":null // penalties score
            }
         },
         "teamB":{
            "id":{
               "ws_realtime":"d4e5f6a7b8c9d0e1",
               "rest_releated":"5fda5fcd1aa9fae2"
            },
            "name":"Liverpool",
            "score":{
               "f":"1",
               "1h":"0",
               "2h":"1",
               "o":null,
               "p":null
            }
         }
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
id_ws_realtime;id_rest_releated;date;timer;est_e_time;in_play;championship_id_ws_realtime;championship_id_rest_releated;championship_name;championship_country;teamA_id_ws_realtime;teamA_id_rest_releated;teamA_name;teamA_score_f;teamA_score_1h;teamA_score_2h;teamA_score_o;teamA_score_p;teamB_id_ws_realtime;teamB_id_rest_releated;teamB_name;teamB_score_f;teamB_score_1h;teamB_score_2h;teamB_score_o;teamB_score_p
a1b2c3d4e5f6a7b8;5ff7a0c8ceb4f157;"2024-09-15 16:00:00";45:00+02:10;3;yes;b2c3d4e5f6a7b8c9;5fda5fa8541c9de5;"Premier League";GB;c3d4e5f6a7b8c9d0;5fda5fcd1aa9fae1;"Manchester United";2;1;1;;;d4e5f6a7b8c9d0e1;5fda5fcd1aa9fae2;"Liverpool";1;0;1;;
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/live/ws/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/live/ws/", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/live/ws/'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/live/ws/"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/live/ws/'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/live/ws/"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/live/ws/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/live/ws/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/live/ws/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/live/ws/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/live/ws/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/live/ws/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info)


# Managers

List of endpoints of Managers entity.

[**List**](/v1/managers/list) **-** */v1/managers/list*  ⬜ 🟨 🟦 🟩\
List of managers with relented entity

[**View**](/v1/managers/view) **-** */v1/managers/view* ⬜ 🟨 🟦 🟩\
*View* of single manager with all its data


# list

## List of all managers ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/managers/list/`

This endpoint return with all managers and its data.\
This is a paginate call, see instruction inside FAQ\
If this entity has **`has_image`** to true, you can access/download the entity media, see the instruction in the FAQ.\
The parameter **`c`** must be a country code getted from coutries/list endpoint.\
Format CSV is in MS excel compatible mode (double click open without import!)\
The latest data are on the last page

#### Query Parameters

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                    |
| f    | string | Format response can be "json" or "csv" (default "json") |
| p    | string | Page number (default value is 1)                        |
| c    | string | Country code or "all" (default value is "all")          |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[
      {
         "page":1, // current page
         "per_page":100, // items per page
         "items":10197 // total items number
      }
   ],
   "result":[
      {
         "id":"5fb962e4a82c690a", // unique manager ID
         "name":"Barak Bakhar",
         "country":"IL",
         "has_image":false
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
page_1_perPage_100_items_10232;id;name;country;has_image
;5fb962e4a82c690a;"Barak Bakhar";IL;no
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/managers/list/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/managers/list/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/managers/list/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/managers/list/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/managers/list/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/managers/list/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/managers/list/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/managers/list/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/managers/list/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/managers/list/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/managers/list/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/managers/list/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# view

## View manager with its data ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/managers/view/?i=ID`

This endpoint returns with manager data a and last 5 matches \
if this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ. \
The parameter **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**      |
| i    | string | Manager ID                                |
| l    | string | Language code (default value is "en\_US") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":"5fb962e4cf4aaa11",
         "name":"Stefano Pioli",
         "country":"IT",
         "has_image":false,
         "current_team":{
            "public_id":"5fda5fcad92584cd",
            "name":"AC Milan"
         },
         "history_teams":[
            {
               "team":{
                  "id":"5fda5fcad92584cd",
                  "name":"AC Milan"
               },
               "from":"2019-10-27",
               "to":"now"
            },
            ...
         ],
         "last_matches":[  // last 5 matches
            {
               "id":"5febc3461e382392",
               "date_match":"2021-01-06 19:45:00",
               "championship":{
                  "id":"5fda5fab11fbd288",
                  "name":"Italy Serie A",
                  "s_name":"Serie A 20/21"
               },
               "teamA":{
                  "id":"5fda5fcad92584cd",
                  "name":"AC Milan",
                  "score":"1"
               },
               "teamB":{
                  "id":"5fda603ef024cb64",
                  "name":"Juventus",
                  "score":"3"
               }
            },
            ...
         ]
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/managers/view/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/managers/view/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/managers/view/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/managers/view/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/managers/view/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/managers/view/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/managers/view/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/managers/view/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/managers/view/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/managers/view/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/managers/view/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/managers/view/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# Matches

List of endpoints of Match entity.

[**Day basic**](/v1/matches/day-basic) **-** */v1/matches/day/basic*  ⬜ 🟨 🟦 🟩\
List of *matches in a day* with relented entity

[**Day full**](/v1/matches/day-full) **-** */v1/matches/day/full*  ⬜ 🟨 🟦 🟩\
List of *matches in a day* with relented entity and odds

[**View basic**](/v1/matches/view-basic) **-** */v1/matches/view/basic*  ⬜ 🟨 🟦 🟩\
*View* of *match with stats events and lineup*

[**View full**](/v1/matches/view-full) **-** */v1/matches/view/full*  ⬜ 🟨 🟦 🟩\
*View* of *match with stats events lineup and odds*

[**Odds**](/v1/matches/odds) **-** */v1/matches/odds*  ⬜ 🟦 🟩\
*View* of *all odds live and pre-match of a specific match*

[**View progressive**](/v1/matches/view-progressive) **-** */v1/matches/view/progressive*  ⬜ 🟦 🟩\
*View* of all match stats and odds trend displayed every 30 seconds


# day basic

## View all matches of a specific day ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/matches/day/basic/?d=DATE`

This endpoint returns with all matches of as specific day \
The parameter **`d`** must be a valid date format in ISO without separator eg. 20201225 (25 December 2020)\
If this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ. \
The parameter **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated.\
This endpoint is paginated **only** for present and future days with your subscribe page number, so the parameter **`p`** works only in this case.\
Format CSV is MS excel compatible mode (double click open without data import!)

Add `bet365_url` that contains bet365 url match. \
Please note, this is the link pointing to the match. After kickoff, the link may change but bet365 **should send** you back to the updated link.\
You have to replace .EXT with your needed extension ".com, .it etc..."

#### Query Parameters

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                    |
| d    | string | Date ISO format without separator                       |
| p    | string | Page number (default value is "1")                      |
| l    | string | Language code (default value is "en\_US")               |
| f    | string | Format response can be "json" or "csv" (default "json") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[ // only if d is today or a future days
      {
         "page":1, // current page
         "per_page":100, // items per page
         "items":54 // number of items
      }
   ],
   "result":[
      {
         "id":"5fb9682ab4fbd853",
         "date":"2020-01-02 08:06:10",
         "status":"ENDED", // can be: IN_PLAY, BREAK, ENDED, CANCELLED, POSTPONE AND NOT_STARTED
         "timer":"90:00", // match timer if is in extra time there is +minute eg. 90:00+01:00
         "championship":{
            "id":"5fda5fab10354812",
            "name":"India Bangalore Super Division",
            "s_name": "India Bangalore Super Division 20" // seson name
         },
         "teamA":{
            "id":"5fda6013de647f33",
            "name":"Bangalore Dream United FC",
            "score":{
               "f":"1", // final score
               "1h":"0", // 1 half
               "2h":"1", // 2 half
               "o":null, // overtime 
               "p":null // penalties
            },
            "perf":{ // only in present and future match
                "l_5_matches" : "WLWLW", // last 5 match performance (from left to right)
                "avg_game_goals" : "2.5",
                "avg_goals_scored" : "1.5",
                "avg_goals_conceded" : "0.5",
                "o_1_5_team" : "50", // percent of over 1.5 by team in last 5 matches
                "btts" : "60", // percent of btts
                "o_0_5_game" : "100", // percent of over 0.5 by game in last 5 matches
                "o_1_5_game" : "100", // percent of over 1.5 by game in last 5 matches
                "o_2_5_game" : "100", // percent of over 2.5 by game in last 5 matches
                "o_3_5_game" : "100", // percent of over 3.5 by game in last 5 matches
                "tot_goals_scored" : "10", // total goals scored in last 5 matches
                "goals_scored_0_15": ["0","0"], // goals scored between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_16_30": ["1","10"], // goals scored between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_31_45": ["1","10"], // goals scored between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_46_60": ["1","10"], // goals scored between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_61_75": ["5","50"], // goals scored between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_76_90": ["2","20"], // goals scored between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "tot_goals_conceded": "10", // total goals conceded in last 5 matches
                "goals_conceded_0_15": ["0","0"], // goals conceded between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_16_30": ["1","10"], // goals conceded between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_31_45": ["1","10"], // goals conceded between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_46_60": ["1","10"], // goals conceded between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_61_75": ["5","50"], // goals conceded between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_76_90": ["2","20"] // goals conceded between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
            },
            "position" : "1", // position in championship (if)
            "stats":{
               "possession":"40",
               "attacks":{
                  "n":"125", // normal
                  "d":"83", // dangerous
                  "o_s":"5" // off side
               },
               "shoots":{
                  "t":"3", // total
                  "off":"2", // off target shot
                  "on":"1", // on target shot
                  "g_a":"2" // goal attemps
               },
               "penalties":"0",
               "corners":{
                  "t":"4", // total
                  "f":"4",// final 
                  "h":"2" // 1 half
               },
               "fouls":{
                  "t":null, // total fouls
                  "y_c":"0", // yellow card
                  "y_t_r_c":null, // yellow to red card
                  "r_c":"0"  // red card
               },
               "substitutions":"2",
               "throwins":null,
               "injuries":null,
               "dominance_avg_2_5": "10.10", // average of last 2.5 minutes of dominance index
               "xG" : {
                 "kickoff" : "1.02", // Expected goal at kickoff
                 "live" : "0.88" // Current expected goal
               }
            },
            "manager":{
               "id":"5fb962e92066c1b6",
               "name":"Gama"
            }
         },
         "teamB":{
            // same as teamA
         },
         "events":[
            {
               "type":"goal", // can be: corner, goal, yellow_card, red_card, substitution, penalty_ot_score, penalty_ot_miss
               "timer":"90+1", // event time if + it's overtime or null if is in penalties
               "team":"B" // ref team A or B
            },
            ...
         ],
         "dominance_index": [
            {
                "timer":"00:00", // timer of dominance index
                "teamA":"5",
                "teamB":"5"
             },
             ...
         ],
         "referee":{ // or null
            "id":"5fb96963d60bb8bc",
            "name":"Jesus Gil Manzano"
         },
         "stadium":{
            "id":"5fb96978c6a5b482",
            "name":"Estadio dos Arcos"
         },
         "bet365_url" : "https://www.bet365.EXT/#/AC/B1/C1/D8/E128998076/F3"
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV today" %}

```
page_1_perPage_100_items_517;id;date;status;timer;championship_id;championship_name;season_name;teamA_id;teamA_name;teamB_id;teamB_name;teamA_score_f;teamB_score_f;teamA_score_1h;teamB_score_1h;teamA_score_2h;teamB_score_2h;teamA_score_o;teamB_score_o;teamA_score_p;teamB_score_p;teamA_possession;teamB_possession;teamA_attacks_n;teamB_attacks_n;teamA_attacks_d;teamB_attacks_d;teamA_off_sides;teamB_off_sides;teamA_shoots;teamB_shoots;teamA_shoots_on_target;teamB_shoots_on_target;teamA_shoots_off_target;teamB_shoots_off_target;teamA_goal_attemps;teamB_goal_attemps;teamA_penalties;teamB_penalties;teamA_corners;teamB_corners;teamA_corners_f;teamB_corners_f;teamA_corners_h;teamB_corners_h;teamA_fouls;teamB_fouls;teamA_yellow_cards;teamB_yellow_cards;teamA_yellow_t_red_cards;teamB_yellow_t_red_cards;teamA_red_cards;teamB_red_cards;teamA_substitutions;teamB_substitutions;teamA_throwins;teamB_throwins;teamA_injuries;teamB_injuries;teamA_manager_id;teamA_manager_name;teamB_manager_id;teamB_manager_name;referee_id;referee_name;stadium_id;stadium_name;teamA_kickoff_xG;teamB_kickoff_xG;teamA_xG;teamB_xG;teamA_position;teamB_position;teamA_past_perfomance;teamB_past_perfomance;teamA_avg_game_goals;teamB_avg_game_goals;teamA_avg_goals_scored;teamB_avg_goals_scored;teamA_avg_goals_conceded;teamB_avg_goals_conceded;teamA_o_1_5_team;teamB_o_1_5_team;teamA_btts;teamB_btts;teamA_o_0_5_game;teamB_o_0_5_game;teamA_o_1_5_game;teamB_o_1_5_game;teamA_o_2_5_game;teamB_o_2_5_game;teamA_o_3_5_game;teamB_o_3_5_game;teamA_t_g_scored;teamB_t_g_scored;teamA_g_scored_0_15_numb;teamB_g_scored_0_15_numb;teamA_g_scored_0_15_perc;teamB_g_scored_0_15_perc;teamA_g_scored_16_30_numb;teamB_g_scored_16_30_numb;teamA_g_scored_16_30_perc;teamB_g_scored_16_30_perc;teamA_g_scored_31_45_numb;teamB_g_scored_31_45_numb;teamA_g_scored_31_45_perc;teamB_g_scored_31_45_perc;teamA_g_scored_46_60_numb;teamB_g_scored_46_60_numb;teamA_g_scored_46_60_perc;teamB_g_scored_46_60_perc;teamA_g_scored_61_75_numb;teamB_g_scored_61_75_numb;teamA_g_scored_61_75_perc;teamB_g_scored_61_75_perc;teamA_g_scored_76_90_numb;teamB_g_scored_76_90_numb;teamA_g_scored_76_90_perc;teamB_g_scored_76_90_perc;teamA_t_g_conceded;teamB_t_g_conceded;teamA_g_conceded_0_15_numb;teamB_g_conceded_0_15_numb;teamA_g_conceded_0_15_perc;teamB_g_conceded_0_15_perc;teamA_g_conceded_16_30_numb;teamB_g_conceded_16_30_numb;teamA_g_conceded_16_30_perc;teamB_g_conceded_16_30_perc;teamA_g_conceded_31_45_numb;teamB_g_conceded_31_45_numb;teamA_g_conceded_31_45_perc;teamB_g_conceded_31_45_perc;teamA_g_conceded_46_60_numb;teamB_g_conceded_46_60_numb;teamA_g_conceded_46_60_perc;teamB_g_conceded_46_60_perc;teamA_g_conceded_61_75_numb;teamB_g_conceded_61_75_numb;teamA_g_conceded_61_75_perc;teamB_g_conceded_61_75_perc;teamA_g_conceded_76_90_numb;teamB_g_conceded_76_90_numb;teamA_g_conceded_76_90_perc;teamB_g_conceded_76_90_perc;bet365_url
;bf07533542292d17;"2024-03-15 00:00:00";ENDED;90:00;fb2bbcb1297555cd;"Bolivia Apertura";"Division Profesional 2024";26bb6623d0f875a7;Bolivar;8179e8ec29799f3;"Jorge Wilstermann";2;1;2;0;2;1;;;;;62;38;89;57;81;44;;;23;14;12;10;11;4;;;0;1;3;9;3;9;1;4;;;4;3;0;0;0;0;4;5;;;;;;;;;;;8766ffcf6e4ac00c;"Estadio Hernando Siles";0.05;0;1.20;1.67;1;2;WLWDW;LDDLL;3.8;1.8;2.2;0.6;1.6;1.2;80;0;80;60;100;80;100;60;80;40;20;0;11;3;0;3;0;33;2;1;17;11;3;1;25;11;2;0;17;0;1;2;8;22;4;2;33;22;8;6;0;5;0;45;3;1;30;9;0;1;0;9;0;1;0;9;3;0;30;0;4;3;40;27;https://www.bet365.EXT/#/AC/B1/C1/D8/E151690228/F3/I0/
...
```

{% endtab %}

{% tab title="CSV future" %}

```
page_1_perPage_100_items_1416;id;date;status;championship_id;championship_name;season_name;teamA_id;teamA_name;teamB_id;teamB_name;teamA_manager_id;teamA_manager_name;teamB_manager_id;teamB_manager_name;referee_id;referee_name;stadium_id;stadium_name;teamA_kickoff_xG;teamB_kickoff_xG;teamA_xG;teamB_xG;teamA_position;teamB_position;teamA_past_perfomance;teamB_past_perfomance;teamA_avg_game_goals;teamB_avg_game_goals;teamA_avg_goals_scored;teamB_avg_goals_scored;teamA_avg_goals_conceded;teamB_avg_goals_conceded;teamA_o_1_5_team;teamB_o_1_5_team;teamA_btts;teamB_btts;teamA_o_0_5_game;teamB_o_0_5_game;teamA_o_1_5_game;teamB_o_1_5_game;teamA_o_2_5_game;teamB_o_2_5_game;teamA_o_3_5_game;teamB_o_3_5_game;teamA_t_g_scored;teamB_t_g_scored;teamA_g_scored_0_15_numb;teamB_g_scored_0_15_numb;teamA_g_scored_0_15_perc;teamB_g_scored_0_15_perc;teamA_g_scored_16_30_numb;teamB_g_scored_16_30_numb;teamA_g_scored_16_30_perc;teamB_g_scored_16_30_perc;teamA_g_scored_31_45_numb;teamB_g_scored_31_45_numb;teamA_g_scored_31_45_perc;teamB_g_scored_31_45_perc;teamA_g_scored_46_60_numb;teamB_g_scored_46_60_numb;teamA_g_scored_46_60_perc;teamB_g_scored_46_60_perc;teamA_g_scored_61_75_numb;teamB_g_scored_61_75_numb;teamA_g_scored_61_75_perc;teamB_g_scored_61_75_perc;teamA_g_scored_76_90_numb;teamB_g_scored_76_90_numb;teamA_g_scored_76_90_perc;teamB_g_scored_76_90_perc;teamA_t_g_conceded;teamB_t_g_conceded;teamA_g_conceded_0_15_numb;teamB_g_conceded_0_15_numb;teamA_g_conceded_0_15_perc;teamB_g_conceded_0_15_perc;teamA_g_conceded_16_30_numb;teamB_g_conceded_16_30_numb;teamA_g_conceded_16_30_perc;teamB_g_conceded_16_30_perc;teamA_g_conceded_31_45_numb;teamB_g_conceded_31_45_numb;teamA_g_conceded_31_45_perc;teamB_g_conceded_31_45_perc;teamA_g_conceded_46_60_numb;teamB_g_conceded_46_60_numb;teamA_g_conceded_46_60_perc;teamB_g_conceded_46_60_perc;teamA_g_conceded_61_75_numb;teamB_g_conceded_61_75_numb;teamA_g_conceded_61_75_perc;teamB_g_conceded_61_75_perc;teamA_g_conceded_76_90_numb;teamB_g_conceded_76_90_numb;teamA_g_conceded_76_90_perc;teamB_g_conceded_76_90_perc;bet365_url
;9ae9ec0707dbab83;"2024-03-16 00:00:00";NOT_STARTED;fb2bbcb1297555cd;"Bolivia Apertura";"Division Profesional 2024";7458369661028f2d;Blooming;65661a5b7303295f;"Royal Pari FC";;;;;;;9757206ffae25cd5;"Estadio Ramon Tahuichi Aguilera";;;;;;;DWWDW;DLWLW;3;1.8;1.8;1;1.2;0.8;80;20;80;40;80;100;80;60;80;20;20;0;9;5;2;0;22;0;1;1;11;17;2;0;22;0;0;1;0;17;1;1;11;17;3;3;33;50;6;4;1;1;17;20;2;0;33;0;0;1;0;20;0;0;0;0;1;1;17;20;2;2;33;40;https://www.bet365.EXT/#/AC/B1/C1/D8/E151690232/F3/I0/
...
```

{% endtab %}

{% tab title="CSV past" %}

```
id;date;status;timer;championship_id;championship_name;season_name;teamA_id;teamA_name;teamB_id;teamB_name;teamA_score_f;teamB_score_f;teamA_score_1h;teamB_score_1h;teamA_score_2h;teamB_score_2h;teamA_score_o;teamB_score_o;teamA_score_p;teamB_score_p;teamA_possession;teamB_possession;teamA_attacks_n;teamB_attacks_n;teamA_attacks_d;teamB_attacks_d;teamA_off_sides;teamB_off_sides;teamA_shoots;teamB_shoots;teamA_shoots_on_target;teamB_shoots_on_target;teamA_shoots_off_target;teamB_shoots_off_target;teamA_goal_attemps;teamB_goal_attemps;teamA_penalties;teamB_penalties;teamA_corners;teamB_corners;teamA_corners_f;teamB_corners_f;teamA_corners_h;teamB_corners_h;teamA_fouls;teamB_fouls;teamA_yellow_cards;teamB_yellow_cards;teamA_yellow_t_red_cards;teamB_yellow_t_red_cards;teamA_red_cards;teamB_red_cards;teamA_substitutions;teamB_substitutions;teamA_throwins;teamB_throwins;teamA_injuries;teamB_injuries;teamA_manager_id;teamA_manager_name;teamB_manager_id;teamB_manager_name;referee_id;referee_name;stadium_id;stadium_name
52abd3f287466a68;"2024-03-14 00:00:00";ENDED;90:00;1b8759dd1001931d;"Nicaragua Clausura";"Primera Division 23/24";dd537f4a8e59a4d9;Diriangen;fea2ee56e1913ed;Jalapa;2;1;1;0;2;1;;;;;;;;;;;;;0;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;d349ba43a3c85c79;"Estadio Cacique Diriangen"
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/matches/day/basic/?t=TOKEN&d=DATE';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/matches/day/basic/?t=TOKEN&d=DATE", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/matches/day/basic/?t=TOKEN&d=DATE'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/matches/day/basic/?t=TOKEN&d=DATE"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/matches/day/basic/?t=TOKEN&d=DATE'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/matches/day/basic/?t=TOKEN&d=DATE"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/matches/day/basic/?d=DATE';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/matches/day/basic/?d=DATE", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/matches/day/basic/?d=DATE",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/matches/day/basic/?d=DATE"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/matches/day/basic/?d=DATE \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/matches/day/basic/?d=DATE"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info)


# day full

## View all matches of a specific day with full data 🟨 ⬜ 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/matches/day/full/?d=DATE`

This endpoint returns with all matches of as specific day with full data\
The parameter **`d`** must be a valid date format in ISO without separator eg. 20201225 (25 December 2020)\
If this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ. \
The parameter **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated\
This endpoint is paginated **only** for present and future days with your subscribe page number, so the parameter **`p`** works only in this case.\
Format CSV is MS excel compatible mode (double click open without data import!)

Add `bet365_url` that contains bet365 url match. \
Please note, this is the link pointing to the match. After kickoff, the link may change but bet365 **should send** you back to the updated link.\
You have to replace .EXT with your needed extension ".com, .it etc..."

#### Query Parameters

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                    |
| d    | string | Date ISO format without separator                       |
| p    | string | Page number (default value is "1")                      |
| l    | string | Language code (default value is "en\_US")               |
| f    | string | Format response can be "json" or "csv" (default "json") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[ // present only if d is today or a future days
      {
         "page":1, // current page
         "per_page":100, // items per page
         "items":54 // number of items
      }
   ],
   "result":[
      {
         "id":"5fb9682ab4fbd853",
         "date":"2020-01-02 08:06:10",
         "status":"ENDED", // can be: IN_PLAY, BREAK, ENDED, CANCELLED, POSTPONE AND NOT_STARTED
         "timer":"90:00", // match timer if is in extra time there is +minute eg. 90:00+01:00
         "championship":{
            "id":"5fda5fab10354812",
            "name":"India Bangalore Super Division",
            "s_name": "India Bangalore Super Division 20" // seson name
         },
         "teamA":{
            "id":"5fda6013de647f33",
            "name":"Bangalore Dream United FC",
            "score":{
               "f":"1", // final score
               "1h":"0", // 1 half
               "2h":"1", // 2 half
               "o":null, // overtime 
               "p":null // penalties
            },
            "perf":{ // only in present and future match
                "l_5_matches" : "WLWLW", // last 5 match performance (from left to right)
                "avg_game_goals" : "2.5",
                "avg_goals_scored" : "1.5",
                "avg_goals_conceded" : "0.5",
                "o_1_5_team" : "50", // percent of over 1.5 by team in last 5 matches
                "btts" : "60", // percent of btts
                "o_0_5_game" : "100", // percent of over 0.5 by game in last 5 matches
                "o_1_5_game" : "100", // percent of over 1.5 by game in last 5 matches
                "o_2_5_game" : "100", // percent of over 2.5 by game in last 5 matches
                "o_3_5_game" : "100", // percent of over 3.5 by game in last 5 matches
                "tot_goals_scored" : "10", // total goals scored in last 5 matches
                "goals_scored_0_15": ["0","0"], // goals scored between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_16_30": ["1","10"], // goals scored between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_31_45": ["1","10"], // goals scored between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_46_60": ["1","10"], // goals scored between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_61_75": ["5","50"], // goals scored between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_76_90": ["2","20"], // goals scored between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "tot_goals_conceded": "10", // total goals conceded in last 5 matches
                "goals_conceded_0_15": ["0","0"], // goals conceded between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_16_30": ["1","10"], // goals conceded between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_31_45": ["1","10"], // goals conceded between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_46_60": ["1","10"], // goals conceded between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_61_75": ["5","50"], // goals conceded between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_76_90": ["2","20"] // goals conceded between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
            },
            "position" : "1", // position in championship (if)
            "stats":{
               "possession":"40",
               "attacks":{
                  "n":"125", // normal
                  "d":"83", // dangerous
                  "o_s":"5" // off side
               },
               "shoots":{
                  "t":"3", // total
                  "off":"2", // off target shot
                  "on":"1", // on target shot
                  "g_a":"2" // goal attemps
               },
               "penalties":"0",
               "corners":{
                  "t":"4", // total
                  "f":"4",// final 
                  "h":"2" // 1 half
               },
               "fouls":{
                  "t":null, // total fouls
                  "y_c":"0", // yellow card
                  "y_t_r_c":null, // yellow to red card
                  "r_c":"0"  // red card
               },
               "substitutions":"2",
               "throwins":null,
               "injuries":null,
               "dominance_avg_2_5": "10.10", // average of last 2.5 minutes of dominance index
                "xG" : {
                 "kickoff" : "1.02", // Expected goal at kickoff
                 "live" : "0.88" // Current expected goal
               }
            },
            "manager":{
               "id":"5fb962e92066c1b6",
               "name":"Gama"
            }
         },
         "teamB":{
            // same as teamA
         },
         "events":[
            {
               "type":"goal", // can be: corner, goal, yellow_card, red_card, substitution, penalty_score, penalty_miss, penalty_ot_score, penalty_ot_miss
               "timer":"90+1", // event time if + it's overtime or null if is in penalties
               "team":"B" // ref team A or B
            },
            ...
         ],
          "dominance_index": [
            {
                "timer":"00:00", // timer of dominance index
                "teamA":"5",
                "teamB":"5"
             },
             ...
         ],
         "referee":{ // or null
            "id":"5fb96963d60bb8bc",
            "name":"Jesus Gil Manzano"
         },
         "stadium":{
            "id":"5fb96978c6a5b482",
            "name":"Estadio dos Arcos"
         },
         "odds":{
            "starting" : {
               "1X2" :{
                  "bet365":{
                     "1":"1.364",
                     "2":"6.500",
                     "X":"5.000"
                  },
                  "unibet":{
                     "1":"1.3",
                     "2":"8.5",
                     "X":"5"
                  }
               },
               "over_under" : {
                  "bet365":{
                     "o":"1.925",
                     "u":"1.875",
                     "v":"3"
                  },
                  "unibet":{
                     "o":"2.33",
                     "u":"1.55",
                     "v":"3.5"
                  }
               },
               "asian_handicap":{
                  "bet365":{
                     "1":"1.775",
                     "2":"2.025",
                     "v":"0.0,-0.5"
                  },
                  "unibet":{
                     "1":"2",
                     "2":"1.74",
                     "v":"-1.5"
                  }
               }
            },
            "kickoff":{
               "1X2":{
                  "bet365":{
                     "1":"1.364",
                     "2":"6.500",
                     "X":"5.000"
                  },
                  "unibet":{
                     "1":"1.3",
                     "2":"8.5",
                     "X":"5"
                  }
               },
               "asian_handicap":{
                  "bet365":{
                     "1":"1.950",
                     "2":"1.850",
                     "v":"-1.5"
                  },
                  "unibet":{
                     "1":"2",
                     "2":"1.74",
                     "v":"-1.5"
                  }
               },
               "over_under":{
                  "bet365":{
                     "o":"1.925",
                     "u":"1.875",
                     "v":"3"
                  },
                  "unibet":{
                     "o":"2.33",
                     "u":"1.55",
                     "v":"3.5"
                  }
               },
               "1h_asian_handicap":{
                  "bet365":{
                     "1":"1.825",
                     "2":"1.975",
                     "v":"-0.5"
                  }
               },
               "1h_goalline":{
                  "bet365":{
                     "o":"1.975",
                     "u":"1.825",
                     "v":"1.0,1.5"
                  }
               },
               "1h_asian_corner":{
                  "bet365":{
                     "o":"1.925",
                     "u":"1.875",
                     "v":"5"
                  }
               },
               "1h_result":{
                  "bet365":{
                     "1":"1.800",
                     "2":"6.000",
                     "X":"2.600"
                  }
               }
            }
         },
         "bet365_url" : "https://www.bet365.EXT/#/AC/B1/C1/D8/E128998076/F3"
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV today" %}

```
page_1_perPage_100_items_517;id;date;status;timer;championship_id;championship_name;season_name;teamA_id;teamA_name;teamB_id;teamB_name;teamA_score_f;teamB_score_f;teamA_score_1h;teamB_score_1h;teamA_score_2h;teamB_score_2h;teamA_score_o;teamB_score_o;teamA_score_p;teamB_score_p;teamA_possession;teamB_possession;teamA_attacks_n;teamB_attacks_n;teamA_attacks_d;teamB_attacks_d;teamA_off_sides;teamB_off_sides;teamA_shoots;teamB_shoots;teamA_shoots_on_target;teamB_shoots_on_target;teamA_shoots_off_target;teamB_shoots_off_target;teamA_goal_attemps;teamB_goal_attemps;teamA_penalties;teamB_penalties;teamA_corners;teamB_corners;teamA_corners_f;teamB_corners_f;teamA_corners_h;teamB_corners_h;teamA_fouls;teamB_fouls;teamA_yellow_cards;teamB_yellow_cards;teamA_yellow_t_red_cards;teamB_yellow_t_red_cards;teamA_red_cards;teamB_red_cards;teamA_substitutions;teamB_substitutions;teamA_throwins;teamB_throwins;teamA_injuries;teamB_injuries;teamA_manager_id;teamA_manager_name;teamB_manager_id;teamB_manager_name;referee_id;referee_name;stadium_id;stadium_name;odd_starting_1x2_bet365_1;odd_starting_1x2_bet365_X;odd_starting_1x2_bet365_2;odd_starting_1x2_unibet_1;odd_starting_1x2_unibet_X;odd_starting_1x2_unibet_2;odd_starting_over_under_bet365_o;odd_starting_over_under_bet365_u;odd_starting_over_under_bet365_v;odd_starting_over_under_unibet_o;odd_starting_over_under_unibet_u;odd_starting_over_under_unibet_v;odd_starting_asian_handicap_bet365_o;odd_starting_asian_handicap_bet365_u;odd_starting_asian_handicap_bet365_v;odd_starting_asian_handicap_unibet_o;odd_starting_asian_handicap_unibet_u;odd_starting_asian_handicap_unibet_v;odd_kickoff_1x2_bet365_1;odd_kickoff_1x2_bet365_X;odd_kickoff_1x2_bet365_2;odd_kickoff_1x2_unibet_1;odd_kickoff_1x2_unibet_X;odd_kickoff_1x2_unibet_2;odd_kickoff_asian_handicap_bet365_1;odd_kickoff_asian_handicap_bet365_2;odd_kickoff_asian_handicap_bet365_v;odd_kickoff_asian_handicap_unibet_1;odd_kickoff_asian_handicap_unibet_2;odd_kickoff_asian_handicap_unibet_v;odd_kickoff_over_under_bet365_o;odd_kickoff_over_under_bet365_u;odd_kickoff_over_under_bet365_v;odd_kickoff_over_under_unibet_o;odd_kickoff_over_under_unibet_u;odd_kickoff_over_under_unibet_v;odd_kickoff_asian_corner_bet365_o;odd_kickoff_asian_corner_bet365_u;odd_kickoff_asian_corner_bet365_v;odd_kickoff_asian_corner_unibet_o;odd_kickoff_asian_corner_unibet_u;odd_kickoff_asian_corner_unibet_v;odd_kickoff_1h_asian_handicap_bet365_1;odd_kickoff_1h_asian_handicap_bet365_2;odd_kickoff_1h_asian_handicap_bet365_v;odd_kickoff_1h_asian_handicap_unibet_1;odd_kickoff_1h_asian_handicap_unibet_2;odd_kickoff_1h_asian_handicap_unibet_v;odd_kickoff_1h_goal_line_bet365_o;odd_kickoff_1h_goal_line_bet365_u;odd_kickoff_1h_goal_line_bet365_v;odd_kickoff_1h_goal_line_unibet_o;odd_kickoff_1h_goal_line_unibet_u;odd_kickoff_1h_goal_line_unibet_v;odd_kickoff_1h_asian_corner_bet365_o;odd_kickoff_1h_asian_corner_bet365_u;odd_kickoff_1h_asian_corner_bet365_v;odd_kickoff_1h_asian_corner_unibet_o;odd_kickoff_1h_asian_corner_unibet_u;odd_kickoff_1h_asian_corner_unibet_v;odd_kickoff_1h_result_bet365_1;odd_kickoff_1h_result_bet365_X;odd_kickoff_1h_result_bet365_2;odd_kickoff_1h_result_unibet_1;odd_kickoff_1h_result_unibet_X;odd_kickoff_1h_result_unibet_2;odd_live_1x2_bet365_1;odd_live_1x2_bet365_X;odd_live_1x2_bet365_2;odd_live_1x2_unibet_1;odd_live_1x2_unibet_X;odd_live_1x2_unibet_2;odd_live_asian_handicap_bet365_1;odd_live_asian_handicap_bet365_2;odd_live_asian_handicap_bet365_v;odd_live_asian_handicap_unibet_1;odd_live_asian_handicap_unibet_2;odd_live_asian_handicap_unibet_v;odd_live_over_under_bet365_o;odd_live_over_under_bet365_u;odd_live_over_under_bet365_v;odd_live_over_under_unibet_o;odd_live_over_under_unibet_u;odd_live_over_under_unibet_v;odd_live_asian_corner_bet365_o;odd_live_asian_corner_bet365_u;odd_live_asian_corner_bet365_v;odd_live_asian_corner_unibet_o;odd_live_asian_corner_unibet_u;odd_live_asian_corner_unibet_v;odd_live_1h_asian_handicap_bet365_1;odd_live_1h_asian_handicap_bet365_2;odd_live_1h_asian_handicap_bet365_v;odd_live_1h_asian_handicap_unibet_1;odd_live_1h_asian_handicap_unibet_2;odd_live_1h_asian_handicap_unibet_v;odd_live_1h_goal_line_bet365_o;odd_live_1h_goal_line_bet365_u;odd_live_1h_goal_line_bet365_v;odd_live_1h_goal_line_unibet_o;odd_live_1h_goal_line_unibet_u;odd_live_1h_goal_line_unibet_v;odd_live_1h_asian_corner_bet365_o;odd_live_1h_asian_corner_bet365_u;odd_live_1h_asian_corner_bet365_v;odd_live_1h_asian_corner_unibet_o;odd_live_1h_asian_corner_unibet_u;odd_live_1h_asian_corner_unibet_v;odd_live_1h_result_bet365_1;odd_live_1h_result_bet365_X;odd_live_1h_result_bet365_2;odd_live_1h_result_unibet_1;odd_live_1h_result_unibet_X;odd_live_1h_result_unibet_2;teamA_kickoff_xG;teamB_kickoff_xG;teamA_xG;teamB_xG;teamA_position;teamB_position;teamA_past_perfomance;teamB_past_perfomance;teamA_avg_game_goals;teamB_avg_game_goals;teamA_avg_goals_scored;teamB_avg_goals_scored;teamA_avg_goals_conceded;teamB_avg_goals_conceded;teamA_o_1_5_team;teamB_o_1_5_team;teamA_btts;teamB_btts;teamA_o_0_5_game;teamB_o_0_5_game;teamA_o_1_5_game;teamB_o_1_5_game;teamA_o_2_5_game;teamB_o_2_5_game;teamA_o_3_5_game;teamB_o_3_5_game;teamA_t_g_scored;teamB_t_g_scored;teamA_g_scored_0_15_numb;teamB_g_scored_0_15_numb;teamA_g_scored_0_15_perc;teamB_g_scored_0_15_perc;teamA_g_scored_16_30_numb;teamB_g_scored_16_30_numb;teamA_g_scored_16_30_perc;teamB_g_scored_16_30_perc;teamA_g_scored_31_45_numb;teamB_g_scored_31_45_numb;teamA_g_scored_31_45_perc;teamB_g_scored_31_45_perc;teamA_g_scored_46_60_numb;teamB_g_scored_46_60_numb;teamA_g_scored_46_60_perc;teamB_g_scored_46_60_perc;teamA_g_scored_61_75_numb;teamB_g_scored_61_75_numb;teamA_g_scored_61_75_perc;teamB_g_scored_61_75_perc;teamA_g_scored_76_90_numb;teamB_g_scored_76_90_numb;teamA_g_scored_76_90_perc;teamB_g_scored_76_90_perc;teamA_t_g_conceded;teamB_t_g_conceded;teamA_g_conceded_0_15_numb;teamB_g_conceded_0_15_numb;teamA_g_conceded_0_15_perc;teamB_g_conceded_0_15_perc;teamA_g_conceded_16_30_numb;teamB_g_conceded_16_30_numb;teamA_g_conceded_16_30_perc;teamB_g_conceded_16_30_perc;teamA_g_conceded_31_45_numb;teamB_g_conceded_31_45_numb;teamA_g_conceded_31_45_perc;teamB_g_conceded_31_45_perc;teamA_g_conceded_46_60_numb;teamB_g_conceded_46_60_numb;teamA_g_conceded_46_60_perc;teamB_g_conceded_46_60_perc;teamA_g_conceded_61_75_numb;teamB_g_conceded_61_75_numb;teamA_g_conceded_61_75_perc;teamB_g_conceded_61_75_perc;teamA_g_conceded_76_90_numb;teamB_g_conceded_76_90_numb;teamA_g_conceded_76_90_perc;teamB_g_conceded_76_90_perc;bet365_url
;bf07533542292d17;"2024-03-15 00:00:00";ENDED;90:00;fb2bbcb1297555cd;"Bolivia Apertura";"Division Profesional 2024";26bb6623d0f875a7;Bolivar;8179e8ec29799f3;"Jorge Wilstermann";2;1;2;0;2;1;;;;;62;38;89;57;81;44;;;23;14;12;10;11;4;;;0;1;3;9;3;9;1;4;;;4;3;0;0;0;0;4;5;;;;;;;;;;;8766ffcf6e4ac00c;"Estadio Hernando Siles";1.400;4.333;7.000;1.35;5.1;6.75;1.925;1.875;3.0;2.3;1.55;3.5;1.925;1.875;-1.25;;;;1.285;6.500;9.000;1.25;5.8;7.5;1.950;1.850;-1.75;;;;1.900;1.900;3.25;2.08;1.67;3.5;1.925;1.875;9;;;;1.975;1.825;-0.75;;;;1.800;2.000;1.25;;;;1.800;2.000;4;;;;1.666;2.750;7.500;;;;1.015;21.000;501.000;1.05;11.5;111;1.350;3.100;0;;;;9.500;1.065;3.5;2.7;1.45;2.5;2.000;1.800;8.5;;;;1.950;1.850;-0.5;;;;1.975;1.825;1.0,1.5;;;;1.975;1.825;4.0;;;;1.909;2.400;7.000;;;;0.05;0;1.20;1.67;1;2;WLWDW;LDDLL;3.8;1.8;2.2;0.6;1.6;1.2;80;0;80;60;100;80;100;60;80;40;20;0;11;3;0;3;0;33;2;1;17;11;3;1;25;11;2;0;17;0;1;2;8;22;4;2;33;22;8;6;0;5;0;45;3;1;30;9;0;1;0;9;0;1;0;9;3;0;30;0;4;3;40;27;https://www.bet365.EXT/#/AC/B1/C1/D8/E151690228/F3/I0/
```

{% endtab %}

{% tab title="CSV past" %}

```
page_1_perPage_100_items_1416;id;date;status;championship_id;championship_name;season_name;teamA_id;teamA_name;teamB_id;teamB_name;teamA_manager_id;teamA_manager_name;teamB_manager_id;teamB_manager_name;referee_id;referee_name;stadium_id;stadium_name;odd_starting_1x2_bet365_1;odd_starting_1x2_bet365_X;odd_starting_1x2_bet365_2;odd_starting_1x2_unibet_1;odd_starting_1x2_unibet_X;odd_starting_1x2_unibet_2;odd_starting_over_under_bet365_o;odd_starting_over_under_bet365_u;odd_starting_over_under_bet365_v;odd_starting_over_under_unibet_o;odd_starting_over_under_unibet_u;odd_starting_over_under_unibet_v;odd_starting_asian_handicap_bet365_o;odd_starting_asian_handicap_bet365_u;odd_starting_asian_handicap_bet365_v;odd_starting_asian_handicap_unibet_o;odd_starting_asian_handicap_unibet_u;odd_starting_asian_handicap_unibet_v;odd_live_1x2_bet365_1;odd_live_1x2_bet365_X;odd_live_1x2_bet365_2;odd_live_1x2_unibet_1;odd_live_1x2_unibet_X;odd_live_1x2_unibet_2;odd_live_asian_handicap_bet365_1;odd_live_asian_handicap_bet365_2;odd_live_asian_handicap_bet365_v;odd_live_asian_handicap_unibet_1;odd_live_asian_handicap_unibet_2;odd_live_asian_handicap_unibet_v;odd_live_over_under_bet365_o;odd_live_over_under_bet365_u;odd_live_over_under_bet365_v;odd_live_over_under_unibet_o;odd_live_over_under_unibet_u;odd_live_over_under_unibet_v;odd_live_asian_corner_bet365_o;odd_live_asian_corner_bet365_u;odd_live_asian_corner_bet365_v;odd_live_asian_corner_unibet_o;odd_live_asian_corner_unibet_u;odd_live_asian_corner_unibet_v;odd_live_1h_asian_handicap_bet365_1;odd_live_1h_asian_handicap_bet365_2;odd_live_1h_asian_handicap_bet365_v;odd_live_1h_asian_handicap_unibet_1;odd_live_1h_asian_handicap_unibet_2;odd_live_1h_asian_handicap_unibet_v;odd_live_1h_goal_line_bet365_o;odd_live_1h_goal_line_bet365_u;odd_live_1h_goal_line_bet365_v;odd_live_1h_goal_line_unibet_o;odd_live_1h_goal_line_unibet_u;odd_live_1h_goal_line_unibet_v;odd_live_1h_asian_corner_bet365_o;odd_live_1h_asian_corner_bet365_u;odd_live_1h_asian_corner_bet365_v;odd_live_1h_asian_corner_unibet_o;odd_live_1h_asian_corner_unibet_u;odd_live_1h_asian_corner_unibet_v;odd_live_1h_result_bet365_1;odd_live_1h_result_bet365_X;odd_live_1h_result_bet365_2;odd_live_1h_result_unibet_1;odd_live_1h_result_unibet_X;odd_live_1h_result_unibet_2;teamA_kickoff_xG;teamB_kickoff_xG;teamA_xG;teamB_xG;teamA_position;teamB_position;teamA_past_perfomance;teamB_past_perfomance;teamA_avg_game_goals;teamB_avg_game_goals;teamA_avg_goals_scored;teamB_avg_goals_scored;teamA_avg_goals_conceded;teamB_avg_goals_conceded;teamA_o_1_5_team;teamB_o_1_5_team;teamA_btts;teamB_btts;teamA_o_0_5_game;teamB_o_0_5_game;teamA_o_1_5_game;teamB_o_1_5_game;teamA_o_2_5_game;teamB_o_2_5_game;teamA_o_3_5_game;teamB_o_3_5_game;teamA_t_g_scored;teamB_t_g_scored;teamA_g_scored_0_15_numb;teamB_g_scored_0_15_numb;teamA_g_scored_0_15_perc;teamB_g_scored_0_15_perc;teamA_g_scored_16_30_numb;teamB_g_scored_16_30_numb;teamA_g_scored_16_30_perc;teamB_g_scored_16_30_perc;teamA_g_scored_31_45_numb;teamB_g_scored_31_45_numb;teamA_g_scored_31_45_perc;teamB_g_scored_31_45_perc;teamA_g_scored_46_60_numb;teamB_g_scored_46_60_numb;teamA_g_scored_46_60_perc;teamB_g_scored_46_60_perc;teamA_g_scored_61_75_numb;teamB_g_scored_61_75_numb;teamA_g_scored_61_75_perc;teamB_g_scored_61_75_perc;teamA_g_scored_76_90_numb;teamB_g_scored_76_90_numb;teamA_g_scored_76_90_perc;teamB_g_scored_76_90_perc;teamA_t_g_conceded;teamB_t_g_conceded;teamA_g_conceded_0_15_numb;teamB_g_conceded_0_15_numb;teamA_g_conceded_0_15_perc;teamB_g_conceded_0_15_perc;teamA_g_conceded_16_30_numb;teamB_g_conceded_16_30_numb;teamA_g_conceded_16_30_perc;teamB_g_conceded_16_30_perc;teamA_g_conceded_31_45_numb;teamB_g_conceded_31_45_numb;teamA_g_conceded_31_45_perc;teamB_g_conceded_31_45_perc;teamA_g_conceded_46_60_numb;teamB_g_conceded_46_60_numb;teamA_g_conceded_46_60_perc;teamB_g_conceded_46_60_perc;teamA_g_conceded_61_75_numb;teamB_g_conceded_61_75_numb;teamA_g_conceded_61_75_perc;teamB_g_conceded_61_75_perc;teamA_g_conceded_76_90_numb;teamB_g_conceded_76_90_numb;teamA_g_conceded_76_90_perc;teamB_g_conceded_76_90_perc;bet365_url
;9ae9ec0707dbab83;"2024-03-16 00:00:00";NOT_STARTED;fb2bbcb1297555cd;"Bolivia Apertura";"Division Profesional 2024";7458369661028f2d;Blooming;65661a5b7303295f;"Royal Pari FC";;;;;;;9757206ffae25cd5;"Estadio Ramon Tahuichi Aguilera";1.833;3.600;3.800;;;;1.900;1.900;2.5,3.0;;;;1.850;1.950;-0.5;;;;2.250;3.400;3.200;;;;1.950;1.850;-0.25;;;;2.000;1.800;2.5,3.0;;;;1.975;1.825;9.5;;;;2.000;1.800;-0.25;;;;1.700;2.100;1.0;;;;1.975;1.825;4.5;;;;2.500;2.250;4.333;;;;;;;;;;DWWDW;DLWLW;3;1.8;1.8;1;1.2;0.8;80;20;80;40;80;100;80;60;80;20;20;0;9;5;2;0;22;0;1;1;11;17;2;0;22;0;0;1;0;17;1;1;11;17;3;3;33;50;6;4;1;1;17;20;2;0;33;0;0;1;0;20;0;0;0;0;1;1;17;20;2;2;33;40;https://www.bet365.EXT/#/AC/B1/C1/D8/E151690232/F3/I0/
```

{% endtab %}

{% tab title="CSV future" %}

```
id;date;status;timer;championship_id;championship_name;season_name;teamA_id;teamA_name;teamB_id;teamB_name;teamA_score_f;teamB_score_f;teamA_score_1h;teamB_score_1h;teamA_score_2h;teamB_score_2h;teamA_score_o;teamB_score_o;teamA_score_p;teamB_score_p;teamA_possession;teamB_possession;teamA_attacks_n;teamB_attacks_n;teamA_attacks_d;teamB_attacks_d;teamA_off_sides;teamB_off_sides;teamA_shoots;teamB_shoots;teamA_shoots_on_target;teamB_shoots_on_target;teamA_shoots_off_target;teamB_shoots_off_target;teamA_goal_attemps;teamB_goal_attemps;teamA_penalties;teamB_penalties;teamA_corners;teamB_corners;teamA_corners_f;teamB_corners_f;teamA_corners_h;teamB_corners_h;teamA_fouls;teamB_fouls;teamA_yellow_cards;teamB_yellow_cards;teamA_yellow_t_red_cards;teamB_yellow_t_red_cards;teamA_red_cards;teamB_red_cards;teamA_substitutions;teamB_substitutions;teamA_throwins;teamB_throwins;teamA_injuries;teamB_injuries;teamA_manager_id;teamA_manager_name;teamB_manager_id;teamB_manager_name;referee_id;referee_name;stadium_id;stadium_name;odd_starting_1x2_bet365_1;odd_starting_1x2_bet365_X;odd_starting_1x2_bet365_2;odd_starting_1x2_unibet_1;odd_starting_1x2_unibet_X;odd_starting_1x2_unibet_2;odd_starting_over_under_bet365_o;odd_starting_over_under_bet365_u;odd_starting_over_under_bet365_v;odd_starting_over_under_unibet_o;odd_starting_over_under_unibet_u;odd_starting_over_under_unibet_v;odd_starting_asian_handicap_bet365_o;odd_starting_asian_handicap_bet365_u;odd_starting_asian_handicap_bet365_v;odd_starting_asian_handicap_unibet_o;odd_starting_asian_handicap_unibet_u;odd_starting_asian_handicap_unibet_v;odd_kickoff_1x2_bet365_1;odd_kickoff_1x2_bet365_X;odd_kickoff_1x2_bet365_2;odd_kickoff_1x2_unibet_1;odd_kickoff_1x2_unibet_X;odd_kickoff_1x2_unibet_2;odd_kickoff_asian_handicap_bet365_1;odd_kickoff_asian_handicap_bet365_2;odd_kickoff_asian_handicap_bet365_v;odd_kickoff_asian_handicap_unibet_1;odd_kickoff_asian_handicap_unibet_2;odd_kickoff_asian_handicap_unibet_v;odd_kickoff_over_under_bet365_o;odd_kickoff_over_under_bet365_u;odd_kickoff_over_under_bet365_v;odd_kickoff_over_under_unibet_o;odd_kickoff_over_under_unibet_u;odd_kickoff_over_under_unibet_v;odd_kickoff_asian_corner_bet365_o;odd_kickoff_asian_corner_bet365_u;odd_kickoff_asian_corner_bet365_v;odd_kickoff_asian_corner_unibet_o;odd_kickoff_asian_corner_unibet_u;odd_kickoff_asian_corner_unibet_v;odd_kickoff_1h_asian_handicap_bet365_1;odd_kickoff_1h_asian_handicap_bet365_2;odd_kickoff_1h_asian_handicap_bet365_v;odd_kickoff_1h_asian_handicap_unibet_1;odd_kickoff_1h_asian_handicap_unibet_2;odd_kickoff_1h_asian_handicap_unibet_v;odd_kickoff_1h_goal_line_bet365_o;odd_kickoff_1h_goal_line_bet365_u;odd_kickoff_1h_goal_line_bet365_v;odd_kickoff_1h_goal_line_unibet_o;odd_kickoff_1h_goal_line_unibet_u;odd_kickoff_1h_goal_line_unibet_v;odd_kickoff_1h_asian_corner_bet365_o;odd_kickoff_1h_asian_corner_bet365_u;odd_kickoff_1h_asian_corner_bet365_v;odd_kickoff_1h_asian_corner_unibet_o;odd_kickoff_1h_asian_corner_unibet_u;odd_kickoff_1h_asian_corner_unibet_v;odd_kickoff_1h_result_bet365_1;odd_kickoff_1h_result_bet365_X;odd_kickoff_1h_result_bet365_2;odd_kickoff_1h_result_unibet_1;odd_kickoff_1h_result_unibet_X;odd_kickoff_1h_result_unibet_2
52abd3f287466a68;"2024-03-14 00:00:00";ENDED;90:00;1b8759dd1001931d;"Nicaragua Clausura";"Primera Division 23/24";dd537f4a8e59a4d9;Diriangen;fea2ee56e1913ed;Jalapa;2;1;1;0;2;1;;;;;;;;;;;;;0;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;d349ba43a3c85c79;"Estadio Cacique Diriangen";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/matches/day/full/?t=TOKEN&d=DATE';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/matches/day/full/?t=TOKEN&d=DATE", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/matches/day/full/?t=TOKEN&d=DATE'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/matches/day/full/?t=TOKEN&d=DATE"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/matches/day/full/?t=TOKEN&d=DATE'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/matches/day/full/?t=TOKEN&d=DATE"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/matches/day/full/?d=DATE';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err  = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/matches/day/full/?d=DATE", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/matches/day/full/?d=DATE",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/matches/day/full/?d=DATE"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/matches/day/full/?d=DATE \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/matches/day/full/?d=DATE"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-info)


# view basic

## View match with its data (basic) ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/matches/view/basic/?i=ID`

This endpoint returns with match data\
The parameters **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated

Add `bet365_url` that contains bet365 url match. \
Please note, this is the link pointing to the match. After kickoff, the link may change but bet365 **should send** you back to the updated link.\
You have to replace .EXT with your needed extension ".com, .it etc..."

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**      |
| i    | string | Match ID                                  |
| l    | string | Language code (default value is "en\_US") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":"5fb96890388c2271",
         "date":"2020-10-01 19:00:00",
         "status":"ENDED",  // can be: IN_PLAY, BREAK, ENDED, CANCELLED, POSTPONE AND NOT_STARTED
         "timer":"90:00",  // match timer if is in extra time there is +minute eg. 90:00+01:00
         "est_e_time" : "6", // estimate extra time false if unknown
         "championship":{
            "id":"5fda5fa809f9d51b",
            "name":"UEFA Europa League - Qualificazioni",
            "s_name":"UEFA Europa League 20/21" // seson name
         },
         "teamA":{
            "id":"5fda603b651fccc9",
            "name":"Rio Ave",
            "score":{
               "f":"10", // final score
               "1h":"0", // 1 half
               "2h":"1", // 2 half
               "o":"2",  // overtime 
               "p":"8"   // penalties
            },
            "perf":{
                "l_5_matches" : "WLWLW", // last 5 match performance (from left to right)
                "avg_game_goals" : "2.5",
                "avg_goals_scored" : "1.5",
                "avg_goals_conceded" : "0.5",
                "o_1_5_team" : "50", // percent of over 1.5 by team in last 5 matches
                "btts" : "60", // percent of btts
                "o_0_5_game" : "100", // percent of over 0.5 by game in last 5 matches
                "o_1_5_game" : "100", // percent of over 1.5 by game in last 5 matches
                "o_2_5_game" : "100", // percent of over 2.5 by game in last 5 matches
                "o_3_5_game" : "100", // percent of over 3.5 by game in last 5 matches
                "tot_goals_scored" : "10", // total goals scored in last 5 matches
                "goals_scored_0_15": ["0","0"], // goals scored between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_16_30": ["1","10"], // goals scored between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_31_45": ["1","10"], // goals scored between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_46_60": ["1","10"], // goals scored between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_61_75": ["5","50"], // goals scored between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_76_90": ["2","20"], // goals scored between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "tot_goals_conceded": "10", // total goals conceded in last 5 matches
                "goals_conceded_0_15": ["0","0"], // goals conceded between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_16_30": ["1","10"], // goals conceded between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_31_45": ["1","10"], // goals conceded between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_46_60": ["1","10"], // goals conceded between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_61_75": ["5","50"], // goals conceded between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_76_90": ["2","20"] // goals conceded between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
            },
            "position" : "1", // position in championship (if)
            "stats":{
               "possession":"40",
               "attacks":{
                  "n":"111", // normal 
                  "d":"23",  // dangerous
                  "o_s":"0"  // off side
               },
               "shoots":{
                  "t":"6", // total 
                  "off":"3", // off target shot
                  "on":"3", // on target shot
                  "g_a":"4" // goal attemps 
               },
               "penalties":"0",
               "corners":{
                  "t":"1", // total
                  "f":"1", // final 
                  "h":"0" // 1 half
               },
               "fouls":{
                  "t":"21", // total fouls
                  "y_c":"5", // yellow card
                  "y_t_r_c":"1", // yellow to red card
                  "r_c":"1" // red card
               },
               "substitutions":"4",
               "throwins":null,
               "injuries":null,
               "dominance_avg_2_5": "10.10", // average of last 2.5 minutes of dominance index
                "xG" : {
                 "kickoff" : "1.02", // Expected goal at kickoff
                 "live" : "0.88" // Current expected goal
               }
            },
            "lineup":[
                 "start":[
                     {
                        "id":"5fb9692f65e3959a",
                        "name":"Gianluigi Donnarumma",
                        "s_n":"99" // shirt number
                     },
                     ...
                  ],
                  "substitutions":[
                     {
                        "id":"5fb9692f6831e7f2",
                        "name":"Antonio Donnarumma",
                        "s_n":"90"
                     },
                     ...
                  ]
            ],
            "manager":{
               "id":"5fb962e92066c1b6",
               "name":"Gama"
            }
         },
         "teamB":{
            ... // same teamA
         },
         "events":[
            {
               "type":"red_card", // can be: corner, goal, yellow_card, red_card, substitution, penalty_score, penalty_miss, penalty_ot_score, penalty_ot_miss
               "timer":"120+1", // eevent time if + it's overtime or null if is in penalties
               "team":"A"
            },
            ...
         ],
          "dominance_index": [
            {
                "timer":"00:00", // timer of dominance index
                "teamA":"5",
                "teamB":"5"
             },
             ...
         ],
         "referee":{
            "id":"5fb96963d60bb8bc",
            "name":"Jesus Gil Manzano"
         },
         "stadium":{
            "id":"5fb96978c6a5b482",
            "name":"Estadio dos Arcos"
         },
         ,
         "bet365_url" : "https://www.bet365.EXT/#/AC/B1/C1/D8/E128998076/F3"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/matches/view/basic/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/matches/view/basic/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/matches/view/basic/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/matches/view/basic/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/matches/view/basic/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/matches/view/basic/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/matches/view/basic/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/matches/view/basic/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccerfootballinfo.rapidapi.com/matches/view/basic/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/matches/view/basic/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/matches/view/basic/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/matches/view/basic/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# view full

## View match with its data and odds (full) 🟨 ⬜ 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/matches/view/full/?i=ID`

This endpoint returns with match data and its odds \
The parameters **`l`** must be a language code getted from languages/list endpoint. \
The odds bookmarkers are Bet365 and Unibet\
Some elements such as championship and team names can be translated

Add `bet365_url` that contains bet365 url match. \
Please note, this is the link pointing to the match. After kickoff, the link may change but bet365 **should send** you back to the updated link.\
You have to replace .EXT with your needed extension ".com, .it etc..."

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**      |
| i    | string | Match ID                                  |
| l    | string | Language code (default value is "en\_US") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":"5fb96890388c2271",
         "date":"2020-10-01 19:00:00",
         "status":"ENDED",  // can be: IN_PLAY, BREAK, ENDED, CANCELLED, POSTPONE AND NOT_STARTED
         "timer":"90:00",  // match timer if is in extra time there is +minute eg. 90:00+01:00
         "est_e_time" : "6", // estimate extra time false if unknown
         "championship":{
            "id":"5fda5fa809f9d51b",
            "name":"UEFA Europa League - Qualificazioni",
            "s_name":"UEFA Europa League 20/21" // seson name
         },
         "teamA":{
            "id":"5fda603b651fccc9",
            "name":"Rio Ave",
            "score":{
               "f":"10", // final score
               "1h":"0", // 1 half
               "2h":"1", // 2 half
               "o":"2",  // overtime 
               "p":"8"   // penalties
            },
            "perf":{
                "l_5_matches" : "WLWLW", // last 5 match performance (from left to right)
                "avg_game_goals" : "2.5",
                "avg_goals_scored" : "1.5",
                "avg_goals_conceded" : "0.5",
                "o_1_5_team" : "50", // percent of over 1.5 by team in last 5 matches
                "btts" : "60", // percent of btts
                "o_0_5_game" : "100", // percent of over 0.5 by game in last 5 matches
                "o_1_5_game" : "100", // percent of over 1.5 by game in last 5 matches
                "o_2_5_game" : "100", // percent of over 2.5 by game in last 5 matches
                "o_3_5_game" : "100", // percent of over 3.5 by game in last 5 matches
                "tot_goals_scored" : "10", // total goals scored in last 5 matches
                "goals_scored_0_15": ["0","0"], // goals scored between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_16_30": ["1","10"], // goals scored between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_31_45": ["1","10"], // goals scored between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_46_60": ["1","10"], // goals scored between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_61_75": ["5","50"], // goals scored between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_scored_76_90": ["2","20"], // goals scored between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "tot_goals_conceded": "10", // total goals conceded in last 5 matches
                "goals_conceded_0_15": ["0","0"], // goals conceded between 0 and 15 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_16_30": ["1","10"], // goals conceded between 16 and 30 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_31_45": ["1","10"], // goals conceded between 31 and end first half minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_46_60": ["1","10"], // goals conceded between 46 and 60 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_61_75": ["5","50"], // goals conceded between 61 and 75 minute in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
                "goals_conceded_76_90": ["2","20"] // goals conceded between 76 and end second half in last 5 matches format [NUMBER_GOAL ; PERCENT_OF_TOTAL]
            },
            "position" : "1", // position in championship (if)
            "stats":{
               "possession":"40",
               "attacks":{
                  "n":"111", // normal 
                  "d":"23",  // dangerous
                  "o_s":"0"  // off side
               },
               "shoots":{
                  "t":"6", // total 
                  "off":"3", // off target shot
                  "on":"3", // on target shot
                  "g_a":"4" // goal attemps 
               },
               "penalties":"0",
               "corners":{
                  "t":"1", // total
                  "f":"1", // final 
                  "h":"0" // 1 half
               },
               "fouls":{
                  "t":"21", // total fouls
                  "y_c":"5", // yellow card
                  "y_t_r_c":"1", // yellow to red card
                  "r_c":"1" // red card
               },
               "substitutions":"4",
               "throwins":null,
               "injuries":null,
               "dominance_avg_2_5": "10.10", // average of last 2.5 minutes of dominance index
                "xG" : {
                 "kickoff" : "1.02", // Expected goal at kickoff
                 "live" : "0.88" // Current expected goal
               }
            },
            "lineup":[
                 "start":[
                     {
                        "id":"5fb9692f65e3959a",
                        "name":"Gianluigi Donnarumma",
                        "s_n":"99" // shirt number
                     },
                     ...
                  ],
                  "substitutions":[
                     {
                        "id":"5fb9692f6831e7f2",
                        "name":"Antonio Donnarumma",
                        "s_n":"90"
                     },
                     ...
                  ]
            ],
            "manager":{
               "id":"5fb962e92066c1b6",
               "name":"Gama"
            }
         },
         "teamB":{
            ... // same teamA
         },
         "events":[
            {
               "type":"red_card", // can be: corner, goal, yellow_card, red_card, substitution, penalty_ot_score, penalty_ot_miss
               "timer":"120+1", // event time if + it's overtime or null if is in penalties
               "team":"A" // ref team A or B
            },
            ...
         ],
         "dominance_index": [
            {
                "timer":"00:00", // timer of dominance index
                "teamA":"5",
                "teamB":"5"
             },
             ...
         ],
         "referee":{
            "id":"5fb96963d60bb8bc",
            "name":"Jesus Gil Manzano"
         },
         "stadium":{
            "id":"5fb96978c6a5b482",
            "name":"Estadio dos Arcos"
         },
         "odds":{
             "starting" : { // opening odds
               "1X2" :{
                  "bet365":{
                     "1":"1.364",
                     "2":"6.500",
                     "X":"5.000"
                  },
                  "unibet":{
                     "1":"1.3",
                     "2":"8.5",
                     "X":"5"
                  }
               },
               "over_under" : {
                  "bet365":{
                     "o":"1.925",
                     "u":"1.875",
                     "v":"3"
                  },
                  "unibet":{
                     "o":"2.33",
                     "u":"1.55",
                     "v":"3.5"
                  }
               },
               "asian_handicap":{
                  "bet365":{
                     "1":"1.775",
                     "2":"2.025",
                     "v":"0.0,-0.5"
                  },
                  "unibet":{
                     "1":"2",
                     "2":"1.74",
                     "v":"-1.5"
                  }
               }
            },
            "kickoff":{ // odds at start match
               "1X2":{
                  "bet365":{
                     "1":"5.000",
                     "2":"1.615",
                     "X":"4.000"
                  },
                  "unibet":{
                     "1":"5.8",
                     "2":"1.56",
                     "X":"3.8"
                  }
               },
               "asian_handicap":{
                  "bet365":{
                     "1":"1.775",
                     "2":"2.025",
                     "v":"+1"
                  },
                  "unibet":{
                     "1":"2.35",
                     "2":"1.55",
                     "v":"0.5"
                  }
               },
               "over_under":{
                  "bet365":{
                     "o":"1.925",
                     "u":"1.875",
                     "v":"2.5"
                  },
                  "unibet":{
                     "o":"1.78",
                     "u":"1.97",
                     "v":"2.5"
                  }
               },
               "1h_asian_handicap":{
                  "bet365":{
                     "1":"2.000",
                     "2":"1.800",
                     "v":"+0.25"
                  }
               },
               "1h_goalline":{
                  "bet365":{
                     "o":"1.900",
                     "u":"1.900",
                     "v":"1"
                  }
               },
               "1h_asian_corner":{
                  "bet365":{
                     "o":"1.900",
                     "u":"1.900",
                     "v":"4.5"
                  }
               },
               "1h_result":{
                  "bet365":{
                     "1":"5.000",
                     "2":"2.200",
                     "X":"2.200"
                  }
               }
            },
            "live":{ // only if match is IN_PLAY or BREAK
              ... // same of kickoff
            }
         },
         "bet365_url" : "https://www.bet365.EXT/#/AC/B1/C1/D8/E128998076/F3"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/matches/view/full/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/matches/view/full/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/matches/view/full/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/matches/view/full/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/matches/view/full/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/matches/view/full/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/matches/view/full/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/matches/view/full/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/matches/view/full/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/matches/view/full/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/matches/view/full/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/matches/view/full/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# by basic

## View all matches of a specific filter with basic data ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/matches/by/basic/`

This endpoint returns with all matches of as specific filter with basic data.\
&#x20;You can filter by: **`c`** championship id, **`m`** manager id and **`s`** stadium id. If you use more filter will be use AND logic.\
You can get specific items id from other endpoints. \
if this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ. The parameters **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated

Add `bet365_url` that contains bet365 url match. \
Please note, this is the link pointing to the match. After kickoff, the link may change but bet365 **should send** you back to the updated link.\
You have to replace .EXT with your needed extension ".com, .it etc..."

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**      |
| c    | string | Championship ID                           |
| m    | string | Manager ID                                |
| s    | string | Stadium ID                                |
| p    | string | Page                                      |
| l    | string | Language code (default value is "en\_US") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| x-rapidapi-key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| x-rapidapi-host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
  "status": 200,
  "errors": [

  ],
  "pagination": [
    {
      "page": 1,
      "per_page": 100,
      "items": 327
    }
  ],
  "result": [
    {
      "id": "6050031284c7991a",
      "date": "2021-03-19 00:00:00",
      "status": "ENDED",
      "timer": "90:00",
      "championship": {
        "id": "5fda5fac01e49b16",
        "name": "Ecuador Primera B",
        "s_name": "LigaPro Primera B 2021"
      },
      "teamA": {
        "id": "5fda5fd7100d115f",
        "name": "America de Quito",
        "score": {
          "f": "1",
          "1h": "0",
          "2h": "1",
          "o": null,
          "p": null
        },
        "stats": {
          "possession": "51",
          "attacks": {
            "n": "101",
            "d": "46",
            "o_s": null
          },
          "shoots": {
            "t": "8",
            "off": "1",
            "on": "7",
            "g_a": null
          },
          "penalties": "0",
          "corners": {
            "t": "4",
            "f": "4",
            "h": "3"
          },
          "fouls": {
            "t": null,
            "y_c": "4",
            "y_t_r_c": "0",
            "r_c": "0"
          },
          "substitutions": "0",
          "throwins": null,
          "injuries": "1"
          "dominance_avg_2_5": "10.10", // average of last 2.5 minutes of dominance index
           "xG" : {
                 "kickoff" : "1.02", // Expected goal at kickoff
                 "live" : "0.88" // Current expected goal
            }
        },
        "manager": null
      },
      "teamB": {
        "id": "5fda60336dfb2746",
        "name": "El Nacional",
        "score": {
          "f": "1",
          "1h": "0",
          "2h": "1",
          "o": null,
          "p": null
        },
        "stats": {
          "possession": "49",
          "attacks": {
            "n": "100",
            "d": "51",
            "o_s": null
          },
          "shoots": {
            "t": "5",
            "off": "2",
            "on": "3",
            "g_a": null
          },
          "penalties": "0",
          "corners": {
            "t": "7",
            "f": "7",
            "h": "4"
          },
          "fouls": {
            "t": null,
            "y_c": "2",
            "y_t_r_c": "0",
            "r_c": "0"
          },
          "substitutions": "0",
          "throwins": null,
          "injuries": "1"
          "dominance_avg_2_5": "10.10", // average of last 2.5 minutes of dominance index
           "xG" : {
                 "kickoff" : "1.02", // Expected goal at kickoff
                 "live" : "0.88" // Current expected goal
            }
        },
        "manager": null
      },
      "events": [
        {
          "type": "yellow_card",
          "timer": "90+5",
          "team": "A"
        },
        {
          "type": "yellow_card",
          "timer": "90+2",
          "team": "A"
        },
        {
          "type": "yellow_card",
          "timer": "86",
          "team": "A"
        },
        {
          "type": "yellow_card",
          "timer": "80",
          "team": "A"
        },
        {
          "type": "goal",
          "timer": "72",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "70",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "65",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "63",
          "team": "B"
        },
        {
          "type": "goal",
          "timer": "59",
          "team": "A"
        },
        {
          "type": "corner",
          "timer": "58",
          "team": "A"
        },
        {
          "type": "yellow_card",
          "timer": "42",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "41",
          "team": "A"
        },
        {
          "type": "yellow_card",
          "timer": "33",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "24",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "21",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "17",
          "team": "A"
        },
        {
          "type": "corner",
          "timer": "12",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "9",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "6",
          "team": "A"
        }
      ],
      "dominance_index": [
            {
                "timer":"00:00", // timer of dominance index
                "teamA":"5",
                "teamB":"5"
             },
             ...
         ],
      "referee": null,
      "stadium": {
        "id": "5fb9697971d74bf8",
        "name": "Olimpico Atahualpa"
      },
         "bet365_url" : "https://www.bet365.EXT/#/AC/B1/C1/D8/E128998076/F3"

    },
    ...
  ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/matches/by/basic/?t=TOKEN&c=CHAMPIOSHIP_ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/matches/by/basic/?t=TOKEN&c=CHAMPIOSHIP_ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/matches/by/basic/?t=TOKEN&c=CHAMPIOSHIP_ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/matches/by/basic/?t=TOKEN&c=CHAMPIOSHIP_ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/matches/by/basic/?t=TOKEN&c=CHAMPIOSHIP_ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/matches/by/basic/?t=TOKEN&c=CHAMPIOSHIP_ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccerfootballinfo.rapidapi.com/v1/matches/by/basic/?c=CHAMPIOSHIP_ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "x-rapidapi-host: soccerfootballinfo.rapidapi.com",
        "x-rapidapi-key: TOKEN"
    ],
));

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://api.soccerfootball.info/v1/matches/by/basic/?c=CHAMPIOSHIP_ID", {
    "method": "GET",
    "headers": {
        "x-rapidapi-key": "TOKEN",
        "x-rapidapi-host": "soccerfootballinfo.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://api.soccerfootball.info/v1/matches/by/basic/?c=CHAMPIOSHIP_ID",
  headers: {
   "x-rapidapi-key": "TOKEN",
     "x-rapidapi-host": "soccerfootballinfo.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccerfootballinfo.rapidapi.com/v1/matches/by/basic/?c=CHAMPIOSHIP_ID"

headers = {
    "x-rapidapi-key": "TOKEN",
      "x-rapidapi-host": "soccerfootballinfo.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://api.soccerfootball.info/v1/matches/by/basic/?c=CHAMPIOSHIP_ID \
    --header 'x-rapidapi-host: soccerfootballinfo.rapidapi.com' \
    --header 'x-rapidapi-key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccerfootballinfo.rapidapi.com/v1/matches/by/basic/?c=CHAMPIOSHIP_ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("x-rapidapi-key", "TOKEN")
    req.Header.Add("x-rapidapi-host", "soccerfootballinfo.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# by full

## View all matches of a specific filter with full data 🟨 ⬜ 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/matches/by/full/`

This endpoint returns with all matches of as specific filter with full data. \
You can filter by: **`c`** championship id, **`m`** manager id and **`s`** stadium id. If you use more filter will be use AND logic \
You can get specific items id from other endpoints. if this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ.\
&#x20;The parameters **`l`** must be a language code getted from languages/list endpoint. Some elements such as championship and team names can be translated

Add `bet365_url` that contains bet365 url match. \
Please note, this is the link pointing to the match. After kickoff, the link may change but bet365 **should send** you back to the updated link.\
You have to replace .EXT with your needed extension ".com, .it etc..."

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**      |
| c    | string | Championship ID                           |
| m    | string | Manager ID                                |
| s    | string | Stadium ID                                |
| p    | string | Page                                      |
| l    | string | Language code (default value is "en\_US") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| x-rapidapi-key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| x-rapidapi-host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
  "status": 200,
  "errors": [

  ],
  "pagination": [
    {
      "page": 1,
      "per_page": 100,
      "items": 327
    }
  ],
  "result": [
    {
      "id": "6050031284c7991a",
      "date": "2021-03-19 00:00:00",
      "status": "ENDED",
      "timer": "90:00",
      "championship": {
        "id": "5fda5fac01e49b16",
        "name": "Ecuador Primera B",
        "s_name": "LigaPro Primera B 2021"
      },
      "teamA": {
        "id": "5fda5fd7100d115f",
        "name": "America de Quito",
        "score": {
          "f": "1",
          "1h": "0",
          "2h": "1",
          "o": null,
          "p": null
        },
        "stats": {
          "possession": "51",
          "attacks": {
            "n": "101",
            "d": "46",
            "o_s": null
          },
          "shoots": {
            "t": "8",
            "off": "1",
            "on": "7",
            "g_a": null
          },
          "penalties": "0",
          "corners": {
            "t": "4",
            "f": "4",
            "h": "3"
          },
          "fouls": {
            "t": null,
            "y_c": "4",
            "y_t_r_c": "0",
            "r_c": "0"
          },
          "substitutions": "0",
          "throwins": null,
          "injuries": "1"
          "dominance_avg_2_5": "10.10", // average of last 2.5 minutes of dominance index
           "xG" : {
                 "kickoff" : "1.02", // Expected goal at kickoff
                 "live" : "0.88" // Current expected goal
            }
      },
        "manager": null
      },
      "teamB": {
        "id": "5fda60336dfb2746",
        "name": "El Nacional",
        "score": {
          "f": "1",
          "1h": "0",
          "2h": "1",
          "o": null,
          "p": null
        },
        "stats": {
          "possession": "49",
          "attacks": {
            "n": "100",
            "d": "51",
            "o_s": null
          },
          "shoots": {
            "t": "5",
            "off": "2",
            "on": "3",
            "g_a": null
          },
          "penalties": "0",
          "corners": {
            "t": "7",
            "f": "7",
            "h": "4"
          },
          "fouls": {
            "t": null,
            "y_c": "2",
            "y_t_r_c": "0",
            "r_c": "0"
          },
          "substitutions": "0",
          "throwins": null,
          "injuries": "1"
          "dominance_avg_2_5": "10.10", // average of last 2.5 minutes of dominance index
           "xG" : {
                 "kickoff" : "1.02", // Expected goal at kickoff
                 "live" : "0.88" // Current expected goal
            }
        },
        "manager": null
      },
      "events": [
        {
          "type": "yellow_card",
          "timer": "90+5",
          "team": "A"
        },
        {
          "type": "yellow_card",
          "timer": "90+2",
          "team": "A"
        },
        {
          "type": "yellow_card",
          "timer": "86",
          "team": "A"
        },
        {
          "type": "yellow_card",
          "timer": "80",
          "team": "A"
        },
        {
          "type": "goal",
          "timer": "72",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "70",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "65",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "63",
          "team": "B"
        },
        {
          "type": "goal",
          "timer": "59",
          "team": "A"
        },
        {
          "type": "corner",
          "timer": "58",
          "team": "A"
        },
        {
          "type": "yellow_card",
          "timer": "42",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "41",
          "team": "A"
        },
        {
          "type": "yellow_card",
          "timer": "33",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "24",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "21",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "17",
          "team": "A"
        },
        {
          "type": "corner",
          "timer": "12",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "9",
          "team": "B"
        },
        {
          "type": "corner",
          "timer": "6",
          "team": "A"
        }
      ],
      "dominance_index": [
            {
                "timer":"00:00", // timer of dominance index
                "teamA":"5",
                "teamB":"5"
             },
             ...
         ],
      "referee": null,
      "stadium": {
        "id": "5fb9697971d74bf8",
        "name": "Olimpico Atahualpa"
      },
      "odds": {
        "starting": {
          "1X2": {
            "bet365": {
              "1": "2.500",
              "2": "2.500",
              "X": "3.200"
            },
            "unibet": {
              "1": "2.5",
              "2": "2.5",
              "X": "3.2"
            }
          },
          "over_under": {
            "bet365": {
              "o": "2.000",
              "u": "1.800",
              "v": "2.0,2.5"
            },
            "unibet": {
              "o": "2.2",
              "u": "1.6",
              "v": "2.5"
            }
          },
          "asian_handicap":{
                  "bet365":{
                     "1":"1.775",
                     "2":"2.025",
                     "v":"0.0,-0.5"
                  },
                  "unibet":{
                     "1":"2",
                     "2":"1.74",
                     "v":"-1.5"
             }
          }
        },
        "kickoff": {
          "1X2": {
            "bet365": {
              "1": "2.375",
              "2": "2.875",
              "X": "3.200"
            },
            "unibet": {
              "1": "2.48",
              "2": "2.7",
              "X": "3.3"
            }
          },
          "asian_handicap": {
            "bet365": {
              "1": "2.025",
              "2": "1.775",
              "v": "-0.25"
            }
          },
          "over_under": {
            "bet365": {
              "o": "1.725",
              "u": "1.975",
              "v": "2"
            }
          },
          "asian_corner": {
            "bet365": {
              "o": "1.975",
              "u": "1.825",
              "v": "9"
            }
          },
          "1h_asian_handicap": {
            "bet365": {
              "1": "1.750",
              "2": "2.050",
              "v": "0"
            }
          },
          "1h_goalline": {
            "bet365": {
              "o": "1.775",
              "u": "2.025",
              "v": "0.75"
            }
          },
          "1h_asian_corner": {
            "bet365": {
              "o": "1.825",
              "u": "1.975",
              "v": "4"
            }
          },
          "1h_result": {
            "bet365": {
              "1": "3.100",
              "2": "3.500",
              "X": "2.000"
            }
          }
        },
         "bet365_url" : "https://www.bet365.EXT/#/AC/B1/C1/D8/E128998076/F3"

      }
    },
    ...
  ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/matches/by/full/?t=TOKEN&c=CHAMPIOSHIP_ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/matches/by/full/?t=TOKEN&c=CHAMPIOSHIP_ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/matches/by/full/?t=TOKEN&c=CHAMPIOSHIP_ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/matches/by/full/?t=TOKEN&c=CHAMPIOSHIP_ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/matches/by/full/?t=TOKEN&c=CHAMPIOSHIP_ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/matches/by/full/?t=TOKEN&c=CHAMPIOSHIP_ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccerfootballinfo.rapidapi.com/v1/matches/by/full/?c=CHAMPIOSHIP_ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "x-rapidapi-host: soccerfootballinfo.rapidapi.com",
        "x-rapidapi-key: TOKEN"
    ],
));

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://api.soccerfootball.info/v1/matches/by/full/?c=CHAMPIOSHIP_ID", {
    "method": "GET",
    "headers": {
        "x-rapidapi-key": "TOKEN",
        "x-rapidapi-host": "soccerfootballinfo.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://api.soccerfootball.info/v1/matches/by/full/?c=CHAMPIOSHIP_ID",
  headers: {
   "x-rapidapi-key": "TOKEN",
     "x-rapidapi-host": "soccerfootballinfo.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccerfootballinfo.rapidapi.com/v1/matches/by/full/?c=CHAMPIOSHIP_ID"

headers = {
    "x-rapidapi-key": "TOKEN",
      "x-rapidapi-host": "soccerfootballinfo.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://api.soccerfootball.info/v1/matches/by/full/?c=CHAMPIOSHIP_ID \
    --header 'x-rapidapi-host: soccerfootballinfo.rapidapi.com' \
    --header 'x-rapidapi-key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccerfootballinfo.rapidapi.com/v1/matches/by/full/?c=CHAMPIOSHIP_ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("x-rapidapi-key", "TOKEN")
    req.Header.Add("x-rapidapi-host", "soccerfootballinfo.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/api-sports/api/api-football?endpoint=apiendpoint_2d5d829b-5827-4f72-973f-32d3c297e957)


# odds

## List of all odds match  ⬜ 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/matches/odds/?i=ID`

This endpoint return with all odds present and historical of a match\
The census markets are: \
➡️ 1x2 \[bet365.com, unibet.com]\
➡️ Over under (goal line) \[bet365.com, unibet.com]\
➡️ Asian handicap \[bet365.comm unibet.com]\
➡️ Asian corner (corner line) \[bet365.com]\
➡️ 1 half asian handicap  \[bet365.com]\
➡️ 1 half over under (goal line) \[bet365.com]\
➡️ 1 half asian corner (corner line) \[bet365.com]\
➡️ 1 half result (1x2) \[bet365.com]

#### Query Parameters

| Name | Type   | Description                          |
| ---- | ------ | ------------------------------------ |
| t    | string | Your API Token **`DIRECT API ONLY`** |
| i    | string | Match ID                             |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "kickoff":{
            "1X2":{
               "bet365":{
                  "1":"1.571",
                  "2":"5.500",
                  "X":"3.750"
               },
               "unibet":{
                  "1":"1.64",
                  "2":"6.3",
                  "X":"3.85"
               }
            },
            "asian_handicap":{
               "bet365":{
                  "1":"1.850",
                  "2":"2.050",
                  "v":"-0.75"
               },
               "unibet":{
                  "1":"1.57",
                  "2":"2.33",
                  "v":"-0.5"
               }
            },
            "over_under":{
               "bet365":{
                  "o":"1.750",
                  "u":"2.050",
                  "v":"2"
               },
               "unibet":{
                  "o":"2.28",
                  "u":"1.6",
                  "v":"2.5"
               }
            },
            "asian_corner":{
               "bet365":{
                  "o":"1.750",
                  "u":"2.050",
                  "v":"7.5"
               },
               "unibet":{
                  "o":"2.28",
                  "u":"1.6",
                  "v":"7.5"
               }
            },
            "1h_asian_handicap":{
               "bet365":{
                  "1":"1.750",
                  "2":"2.125",
                  "v":"-0.25"
               }
            },
            "1h_goalline":{
               "bet365":{
                  "o":"2.150",
                  "u":"1.675",
                  "v":"1"
               }
            },
            "1h_asian_corner":{
               "bet365":{
                  "o":"1.750",
                  "u":"2.050",
                  "v":"3.5"
               }
            },
            "1h_result":{
               "bet365":{
                  "1":"2.200",
                  "2":"6.500",
                  "X":"2.100"
               }
            }
         },
         "live":{ // live history if no data from bookmaker data missing
            "1X2":{
               "bet365":[
                  ...,
                  {
                     "1":"1.615",  // quote null if data suspended
                     "2":"5.500",  // quote null if data suspended
                     "X":"3.750",  // quote null if data suspended
                     "time":"2"    // time in minute, null if pre match or in break
                  },
                  ...
               ],
               "unibet" :[
                  ...,
                  {
                     "1":"1.65",
                     "2":"5.6",
                     "X":"3.6",
                     "time":"8"
                  },
                  ...
               ]
            },
            "asian_handicap":{
               "bet365":[
                  {
                     "1":"2.060",
                     "2":"1.870",
                     "v":"-1.0",
                     "time":null
                  },
                  ...
               ],
               "unibet":[
                  ...,
                  {
                     "1":"1.6",
                     "2":"2.28",
                     "v":"-0.5",
                     "time":"20"
                  },
                  ...

               ]
            },
            "over_under":{
               "bet365":[
                  ...,
                  {
                     "o":"2.090",
                     "u":"1.810",
                     "v":"2.0,2.5",
                     "time":null
                  },
                  ...
               ],
               "unibet":[
                  {
                     "o":"2.23",
                     "u":"1.65",
                     "v":"2.5",
                     "time":null
                  },
                  ...
               ]
            },
            "asian_corner":{
               "bet365":[
                  ...
                  {
                     "o":null,
                     "u":null,
                     "v":"7.5",
                     "time":null
                  },
                  ...
               ]
            },
            "1h_asian_handicap":{
               "bet365":[
                  ...,
                  {
                     "1":"1.850",
                     "2":"2.000",
                     "v":"-0.25",
                     "time":"2"
                  },
                  ...
               ]
            },
            "1h_goalline":{
               "bet365":[
                  ...,
                  {
                     "o":"1.800",
                     "u":"2.050",
                     "v":"0.75",
                     "time":null
                  },
                  ...
               ]
            },
            "1h_asian_corner":{
               "bet365":[
                  {
                     "o":"1.850",
                     "u":"1.950",
                     "v":"4",
                     "time":null
                  },
                  ...
               ]
            },
            "1h_result":{
               "bet365":[
                  ...
                  {
                     "1":"2.300",
                     "2":"6.500",
                     "X":"2.050",
                     "time":null
                  },
                  ...
               ]
            }
         }
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/matches/odds/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/matches/odds/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/matches/odds/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/matches/odds/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/matches/odds/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/matches/odds/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/matches/odds/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/matches/odds/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/matches/odds/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/matches/odds/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/matches/odds/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/matches/odds/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# view progressive

## View matches progressive (trend) data of stats and odds ⬜ 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/matches/view/progressive/?i=ID`

This endpoint returns with match data (stats and odds) every 30 seconds. \
**This endpoints has data since 2020-01-01** \
Live match can be view only by 🟩 ULTRA user plan\
This call is our killer features. \
You can test your strategy on historical data in live method.\
Format CSV is in MS excel compatible mode (double click open without import!)

#### Query Parameters

| Name | Type   | Description                                              |
| ---- | ------ | -------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                     |
| i    | string | Match ID                                                 |
| f    | string | Format response can be "json" or "csv" ( default "json") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[ 
      ...,
      {  // all stats may be null if 0 or not set
         "timer":"52:00", // start from "00:00" every 30 seconds (00:00 00:30 01:00 01:30)
         "teamA":{
            "goal": "1",
            "possession":"46",
            "attacks":{
               "n":"58", // normal
               "d":"10" // dangerous
            },
            "shoots":{
               "t":"1", // total
               "off":"0", // off target
               "on":"1", // on target
               "g_a":"1" // goal attemps
            },
            "penalties":null,
            "corners":null,
            "fouls":{
               "t":null, // total
               "y_c":"3", // yellow card
               "y_t_r_c":null, // yellow to red card
               "r_c":null // red card
            },
            "substitutions":null,
            "throwins":null,
            "injuries":null,
            "dominance":{
               "index": "10.22", // exact dominance index at this time
               "avg_2_5": "10.50" // avg last 2,5 minutes of d.index
            },
            "xG" : "0.88"
         },
         "teamB":{
           ... // same of teamA
         },
         "odds":{
            "1X2":{
               "1":"21.000",
               "2":"1.125",
               "X":"6.500"
            },
            "asian_handicap":{
               "1":"2.075",
               "2":"1.725",
               "v":"+0.25"
            },
            "over_under":{
               "o":"1.775",
               "u":"2.025",
               "v":"2"
            },
            "asian_corner":{
               "o":"1.825",
               "u":"1.975",
               "v":"6"
            },
            "1h_asian_handicap":{
               "1":"3.900",
               "2":"1.240",
               "v":"0"
            },
            "1h_goalline":{
               "o":"5.900",
               "u":"1.130",
               "v":"0.5"
            },
            "1h_asian_corner":{
               "o":"2.375",
               "u":"1.550",
               "v":"1.5"
            },
            "1h_result":{
               "1":"13.000",
               "2":"8.000",
               "X":"1.083"
            }
         }
      },
      ...
   ]
}


```

{% endtab %}

{% tab title="CSV" %}

```
timer;teamA_goal;teamB_goal;teamA_possession;teamB_possession;teamA_attacks_n;teamB_attacks_n;teamA_attacks_d;teamB_attacks_d;teamA_off_sides;teamB_off_sides;teamA_shoots;teamB_shoots;teamA_shoots_on_target;teamB_shoots_on_target;teamA_shoots_off_target;teamB_shoots_off_target;teamA_goal_attemps;teamB_goal_attemps;teamA_penalties;teamB_penalties;teamA_corners;teamB_corners;teamA_fouls;teamB_fouls;teamA_yellow_cards;teamB_yellow_cards;teamA_yellow_t_red_cards;teamB_yellow_t_red_cards;teamA_red_cards;teamB_red_cards;teamA_substitutions;teamB_substitutions;teamA_throwins;teamB_throwins;teamA_injuries;teamB_injuries;teamA_dominance_index;teamB_dominance_index;teamA_dominance_index_2_5;teamB_dominance_index_2_5;teamA_xG;teamB_xG;odd_1x2_1;odd_1x2_X;odd_1x2_2;odd_asian_handicap_1;odd_asian_handicap_2;odd_asian_handicap_v;odd_over_under_o;odd_over_under_u;odd_over_under_v;odd_asian_corner_o;odd_asian_corner_u;odd_asian_corner_v;odd_1h_asian_handicap_1;odd_1h_asian_handicap_2;odd_1h_asian_handicap_v;odd_1h_goalline_o;odd_1h_goalline_u;odd_1h_goalline_v;odd_1h_asian_corner_o;odd_1h_asian_corner_u;odd_1h_asian_corner_v;odd_1h_result_1;odd_1h_result_X;odd_1h_result_2
00:00;0;0;50;50;0;0;0;0;;;0;0;0;0;0;0;;;0;0;0;0;;;0;0;;;0;0;0;0;;;;;5.00;5.00;5.00;5.00;;;;;;;;;;;;;;;;;;;;;;;;;;
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/matches/view/progressive/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/matches/view/progressive/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/matches/view/progressive/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/matches/view/progressive/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/matches/view/progressive/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/matches/view/progressive/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/matches/view/progressive/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err  = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/matches/view/progressive/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/matches/view/progressive/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/matches/view/progressive/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/matches/view/progressive/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/matches/view/progressive/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# Players

List of endpoints of Player entity.

[**List**](/v1/players/list) **-** */v1/players/list*  ⬜ 🟨 🟦 🟩\
List of players with relented entity

[**View**](/v1/players/view) **-** */v1/players/view*  ⬜ 🟨 🟦 🟩\
*View* of single player and all its data


# list

## List of all players ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/players/list/`

This endpoint return with all players and its data. \
This is a paginate call, see instruction inside FAQ\
If this entity has **`has_image`** to true, you can access/download the entity media; see the instruction inside FAQ. \
The parameter **`c`** must be a country code getted from coutries/list endpoint.\
Format CSV is in MS excel compatible mode (double click open without import!)\
The latest data are on the last page

#### Query Parameters

| Name | Type   | Description                                    |
| ---- | ------ | ---------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**           |
| p    | string | Page number (default value is 1)               |
| c    | string | Country code or "all" (default value is "all") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[
      {
         "page":1,// current page
         "per_page":100, // items per page
         "items":83227 // total items number
      }
   ],
   "result":[
     {
         "id":"5fb9692a0a31736a", // unique player ID
         "name":"William Yarbrough",
         "country":"US",
         "has_image":false
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
page_1_perPage_100_items_83483;id;name;country;has_image
;5fb9692a053067d8;Tn;;no
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/players/list/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/players/list/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/players/list/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/players/list/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/players/list/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/players/list/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/players/list/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/players/list/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/players/list/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/players/list/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/players/list/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/players/list/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# view

## View player with its data ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/players/view/?i=ID`

This endpoint returns with player data. \
If this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ. \
The parameter **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**      |
| i    | string | Player ID                                 |
| l    | string | Language code (default value is "en\_US") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":"5fb9692a2e5a27c8",
         "name":"Zlatan Ibrahimovic",
         "country":"SE",
         "birth_date":"1981-10-03",
         "foot":"Both", // can be: Right, Left, Both or null
         "height":"196 cm",
         "has_image":false,
         "last_team":{
            "id":"5fda5fcad92584cd",
            "name":"AC Milan"
         },
         "trasfers":[
            {
               "team":{
                  "id":"5fda5fcad92584cd",
                  "name":"AC Milan"
               },
               "from":"2020-01-01 00:00:00",
               "to":null
            },
            ...
         ]
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/players/view/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/players/view/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/players/view/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/players/view/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/players/view/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/players/view/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/players/view/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/players/view/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/players/view/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/players/view/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/players/view/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/players/view/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# Referees

List of endpoints of Referee entity.

[**List**](/v1/referees/list) **-** */v1/referees/list*  ⬜ 🟨 🟦 🟩\
List of *referees* with relented entity

[**View**](/v1/referees/view) **-** */v1/referees/view* ⬜ 🟨 🟦 🟩\
*View* of single referee and all its data


# list

## List of all referees ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/referees/list/`

This endpoint return with all referees and its data. \
This is a paginate call, see instruction inside FAQ \
If this entity has **`has_image`** to true, you can access/download the entity media, see the instruction inside FAQ. \
The parameter **`c`** must be a country code getted from coutries/list endpoint.\
Format CSV is in MS excel compatible mode (double click open without import!)\
The latest data are on the last page

#### Query Parameters

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                    |
| f    | string | Format response can be "json" or "csv" (default "json") |
| p    | string | Page number (default value is 1)                        |
| c    | string | Country code or "all" (default value is "all")          |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[
      {
         "page":1,// current page
         "per_page":100, // items per page
         "items":3613 // total items number
      }
   ],
   "result":[
      {
         "id":"5fb96963cbcad15f", // unique referee ID
         "name":"Oren Siminyan",
         "country":"IL",
         "has_image":false
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
page_1_perPage_100_items_3619;id;name;country;has_image
;5fb96963cbcad15f;"Oren Siminyan";IL;no
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/referees/list/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/referees/list/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/referees/list/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/referees/list/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/referees/list/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/referees/list/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/referees/list/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/referees/list/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/referees/list/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/referees/list/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/referees/list/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/referees/list/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# view

## View referee with its data  ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/referees/view/?i=ID`

This endpoint returns with manager data a and last 5 matches \
If this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ.\
The parameter **`l`** must be a language code getted from languages/list endpoint. Some elements such as championship and team names can be translated

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**      |
| i    | string | Referee ID                                |
| l    | string | Language code (default value is "en\_US") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":"5fb96964385d308c",
         "name":"Damir Skomina",
         "country":"SI",
         "has_image":false,
         "last_matches":[  // last 5 matches
            {
               "id":"5fb968a291fbd218",
               "date_match":"2020-11-04 20:00:00",
               "championship":{
                  "id":"5fda5fab16e51885",
                  "name":"UEFA Champions League",
                  "s_name":false
               },
               "teamA":{
                  "id":"5fda5fb4746c841f",
                  "name":"Club Brugge",
                  "score":"0"
               },
               "teamB":{
                  "id":"5fda6037746da851",
                  "name":"Borussia Dortmund",
                  "score":"3"
               }
            },
            ...
         ]
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/referees/view/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/referees/view/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/referees/view/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/referees/view/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/referees/view/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/referees/view/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/referees/view/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/referees/view/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/referees/view/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/referees/view/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/referees/view/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/referees/view/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# Stadiums

List of endpoints of Stadium entity.

[**List**](/v1/stadiums/list) **-** */v1/stadiums/list*  ⬜ 🟨 🟦 🟩\
List of *stadiums* with relented entity

[**View**](/v1/stadiums/view) **-** */v1/stadiums/view*  ⬜ 🟨 🟦 🟩\
*View* of single stadium and all its data


# list

## List of all stadiums ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/stadiums/list/`

This endpoint return with all Stadiums and his data.\
This is a paginate call, see instruction inside FAQ\
If this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ\
The parameter **`c`** must be a country code get from /v1/countries/list endpoint.\
Format CSV is in MS excel compatible mode (double click open without import!)\
The latest data are on the last page

#### Query Parameters

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| t    | string | Your API token **`DIRECT API ONLY`**                    |
| f    | string | Format response can be "json" or "csv" (default "json") |
| p    | string | ***Page*** number (default value is 1)                  |
| c    | string | ***Country*** code or "all" (default value is "all")    |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
  "status": 200,
  "errors": [],
      "pagination": [
      {
          "page": 1,       // current page
          "per_page": 100, // items per page
          "items" : 6726   // total items number
      }
      ],
      "result": [
          {
            "id":"5fb969788aa64e3c",  // unique stadium ID
            "name":"Doha Stadium",  
            "city": "Sakhnin",
            "country" : "IS",
            "capacity" : "8500",
            "coordinates" : "32.866692,35.310850",
            "has_image": false   // if true can get media
          },
          ...
      ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
page_1_perPage_100_items_6842;id;name;country;capacity;geocoords;has_image
;5fb969788aa64e3c;"Doha Stadium";IL;8500;32.866692,35.310850;no
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/stadiums/list/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/stadiums/list/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/stadiums/list/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/stadiums/list/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/stadiums/list/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/stadiums/list/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/stadiums/list/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/stadiums/list/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/stadiums/list/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/stadiums/list"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/stadiums/list/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/stadiums/list/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# view

## View stadium with its data  ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/stadiums/view/?i=ID`

This endpoint returns with stadium data a and last 5 matches\
If this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ. \
The parameter **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**      |
| i    | string | Stadium ID                                |
| l    | string | Language code (default value is "en\_US") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":"5fb96978c469c28a",
         "name":"Giuseppe Meazza",
         "city":"Milan",
         "country":"IT",
         "capacity":"80018",
         "geocoords":"45.478025,9.124206",
         "has_image":false,
         "last_matches":[ // last 5 macthes
            {
               "id":"5febc3461e382392",
               "date_match":"2021-01-06 19:45:00",
               "championship":{
                  "id":"5fda5fab11fbd288",
                  "name":"Italy Serie A",
                  "s_name":"Serie A 20/21"
               },
               "teamA":{
                  "id":"5fda5fcad92584cd",
                  "name":"AC Milan",
                  "score":"1"
               },
               "teamB":{
                  "id":"5fda603ef024cb64",
                  "name":"Juventus",
                  "score":"3"
               }
            },
            ...
         ]
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/stadiums/view/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/stadiums/view/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/stadiums/view/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/stadiums/view/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/stadiums/view/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/stadiums/view/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/stadiums/view/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/stadiums/view/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/stadiums/view/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/stadiums/view/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/stadiums/view/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/stadiums/view/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# Teams

List of endpoints of Team entity.

[**List**](/v1/teams/list) **-** */v1/teams/list* ⬜ 🟨 🟦 🟩\
List of *teams* with relented entity

[**View**](/v1/teams/view) **-** */v1/teams/view* ⬜ 🟨 🟦 🟩\
*View* of single team and all its data

[**History**](/v1/teams/history) **-** */v1/teams/history* ⬜ 🟨 🟦 🟩\
*View* of all history matches of as specific teams

[**Versus**](/v1/teams/versus) **-** */v1/teams/versus* ⬜ 🟨 🟦 🟩\
*View* of all matches and its results with two teams X and Y

[**WS**](/v1/teams/ws) **-** */v1/teams/ws* 🟩\
List of teams with WebSocket dual ID mapping (MEGA only)


# list

## List of all teams ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/teams/list/`

This endpoint return with all teams and its data. \
This is a paginate call, see instruction inside FAQ .\
If this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ. \
The parameter **`c`** must be a country code getted from coutries/list endpoint. \
The parameter **`l`** must be a language code getted from languages/list endpoint.\
Format CSV is in MS excel compatible mode (double click open without import!)\
The latest data are on the last page<br>

#### Query Parameters

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API TOKEN`**                   |
| f    | string | Format response can be "json" or "csv" (default "json") |
| p    | string | Page number (default value is 1)                        |
| c    | string | Country code or "all" (default value is "all")          |
| l    | string | Language code (default value is "en\_US")               |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[
      {
         "page":1,// current page
         "per_page":100, // items per page
         "items":38127 // total items number
      }
   ],
   "result":[
      {
         "id":"5fda5faf06aa325e", // uinique teams ID
         "name":"ES Paulhan Pezenas",
         "country":"FR",
         "has_image":false
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
page_1_perPage_100_items_38240;id;name;country;has_image
;5fda5faf06aa325e;"ES Paulhan Pezenas";FR;no
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/teams/list/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/teams/list/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/teams/list/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/teams/list/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/teams/list/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/teams/list/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/teams/list/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/teams/list/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/teams/list/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/teams/list/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/teams/list/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/teams/list/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# view

## View team with its data ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/teams/view/?i=ID`

This endpoint returns with team data a and last 5 matches \
If this entity has **`has_image`** to true, you can access/download the entity media; see te instruction inside FAQ. \
The parameter **`l`** must be a language code getted from languages/list endpoint. \
Some elements such as championship and team names can be translated.

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**      |
| i    | string | Team ID                                   |
| l    | string | Language code (default value is "en\_US") |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "id":"5fda5fcad92584cd",
         "name":"AC Milan",
         "country":"IT",
         "manager":{
            "id":"5fb962e4cf4aaa11",
            "name":"Stefano Pioli"
         },
         "stadium":{
            "id":"5fb96978c469c28a",
            "name":"Giuseppe Meazza",
            "city":"Milan",
            "country":"IT",
            "capacity":"80018",
            "geocoords":"45.478025,9.124206"
         },
         "has_image":false,
         "last_matches":[ // last 5 matches
            {
               "id":"5febc3461e382392",
               "date_match":"2021-01-06 19:45:00",
               "championship":{
                  "id":"5fda5fab11fbd288",
                  "name":"Italy Serie A",
                  "s_name":"Serie A 20/21"
               },
               "teamA":{
                  "id":"5fda5fcad92584cd",
                  "name":"AC Milan",
                  "score":"1"
               },
               "teamB":{
                  "id":"5fda603ef024cb64",
                  "name":"Juventus",
                  "score":"3"
               },
               "team_result":"LOSS"
            },
            ...
         ],
         "last_lineup":{
            "start":[
               {
                  "id":"5fb9692f65e3959a",
                  "name":"Gianluigi Donnarumma",
                  "s_n":"99"
               },
               ...
            ],
            "substitutions":[
               {
                  "id":"5fb9692f6831e7f2",
                  "name":"Antonio Donnarumma",
                  "s_n":"90"
               },
               ...
            ]
         }
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/teams/view/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/teams/view/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/teams/view/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/teams/view/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/teams/view/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/teams/view/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/teams/view/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/teams/view/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/teams/view/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/teams/view/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/teams/view/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/teams/view/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# history

## View team history matches ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/teams/history/?i=ID`

This endpoint returns with team data and its history matches. \
With parameter **`w`** you can define the time lapse "all" (from 2017 01 01), "1y" last year, "6m" last 6 months. \
The parameter **`l`** must be a language code getted from languages/list endpoint. Some elements such as championship and team names can be translated.\
Format response can be "json" or "csv" (Default "json")

#### Query Parameters

| Name | Type   | Description                                                    |
| ---- | ------ | -------------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                           |
| f    | string | Format response can be "json" or "csv" (default "json")        |
| i    | string | Team ID                                                        |
| w    | string | When get time can be "all", "1y", "6m" (default value is "6m") |
| l    | string | Language code (default value is "en\_US")                      |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "lapse":"6m",
         "results":{
            "win":28, // number of win in lapse
            "loss":2, // number of loss in lapse
            "draw":7 // number of draw in lapse
         },
         "macthes":[
            {
               "id":"5ff1096066d98235",
               "date":"2021-01-09 19:45:00",
               "championship":{
                  "id":"5fda5fab11fbd288",
                  "name":"Italy Serie A",
                  "s_name":"Serie A 20/21"
               },
               "teamA":{
                  "id":"5fda5fcad92584cd",
                  "name":"AC Milan",
                  "score":"2",
                  "1h_score": "1"
               },
               "teamB":{
                  "id":"5fda5fc4a7cbddf2",
                  "name":"Torino",
                  "score":"0",
                  "1h_score": "0"
               }
            },
            ...
         ]
      }
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
time_6m;match_id;date_match;champipship;championship_id;season_name;teamA_name;teamA_id;teamA_score;teamA_1h_score;teamB_name;teamB_id;teamB_score;teamB_1h_score;result
;600772c53a14d889;"2021-01-26 19:45:00";"Coppa Italia";5fda5fa8d5514fc8;;"Inter Milan";5fda6034be4e9d6b;2;1;"AC Milan";5fda5fcad92584cd;1;1;LOSS
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/teams/history/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/teams/history/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/teams/history/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/teams/history/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/teams/history/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/teams/history/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err  = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# versus

## Versus results between two teams ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/teams/versus/?x=IDX&y=IDY`

This endpoint returns with all matches between two teams and its results \
You can define two teams, one with **`x`** and another with **`y`** \
With parameter **`w`** you can define the time lapse "all" (from 2017 01 01), "1y" last year, "6m" last 6 months. \
The parameter **`l`** must be a language code getted from languages/list endpoint.\
Some elements such as championship and team names can be translated.\
Format response can be "json" or "csv" (Default "json")

#### Query Parameters

| Name | Type   | Description                                                    |
| ---- | ------ | -------------------------------------------------------------- |
| t    | string | Your API Token **`DIRECT API ONLY`**                           |
| f    | string | Format response can be "json" or "csv" (default "csv")         |
| x    | string | ID of X TEAM                                                   |
| y    | string | ID of Y TEAM                                                   |
| w    | string | When get time can be "all", "1y", "6m" (default value is "6m") |
| l    | string | Language code (default value is "en\_US")                      |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "lapse":"all",
         "teamX":{
            "id":"5fda6034be4e9d6b",
            "name":"Inter"
         },
         "teamY":{
            "id":"5fda5fcad92584cd",
            "name":"Milan"
         },
         "results":{
            "teamX":5, // times of X wins
            "teamY":2, // times of Y wins
            "draw":2 // times of matces go draw
         },
         "macthes":[
            {
               "id":"5fb96897c83c9629",
               "date":"2020-10-17 16:00:00",
               "championship":{
                  "id":"5fda5fab11fbd288",
                  "name":"Italia - Serie A",
                  "s_name":"Serie A 20/21"
               },
               "teamA":{
                  "id":"5fda6034be4e9d6b",
                  "name":"Inter",
                  "score":"1"
               },
               "teamB":{
                  "id":"5fda5fcad92584cd",
                  "name":"Milan",
                  "score":"2"
               }
            },
            ...
         ]
      }
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
time_all;match_id;date_match;champipship;championship_id;season_name;teamA_name;teamA_id;teamA_score;teamB_name;teamB_id;teamB_score
;600772c53a14d889;"2021-01-26 19:45:00";"Italia - Coppa Italia";5fda5fa8d5514fc8;;Inter;5fda6034be4e9d6b;2;Milan;5fda5fcad92584cd;1
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/teams/versus/?t=TOKEN&x=IDX&y=IDY';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/teams/versus/?t=TOKEN&x=IDX&y=IDY", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/teams/versus/?t=TOKEN&x=IDX&y=IDY'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/teams/versus/?t=TOKEN&x=IDX&y=IDY"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/teams/versus/?t=TOKEN&x=IDX&y=IDY'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/teams/versus/?t=TOKEN&x=IDX&y=IDY"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/teams/versus/?x=IDX&y=IDY';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/teams/versus/?x=IDX&y=IDY", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/teams/versus/?x=IDX&y=IDY",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/teams/versus/?x=IDX&y=IDY"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/v1/teams/versus/?x=IDX&y=IDY \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/teams/versus/?x=IDX&y=IDY"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# ws

## List of all teams with WebSocket ID mapping 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/teams/ws/`

This endpoint returns a paginated list of teams with the dual ID mapping system for the **MAIN\_REALTIME** WebSocket channel.\
Each field (id, name, country) is an object containing two values:\
**`ws_realtime`**: the value used exclusively in **MAIN\_REALTIME** channel messages\
**`rest_releated`**: the value from the standard REST API and all other WebSocket channels (MAIN, STATS, ODDS, STATS\_REALTIME, ODDS\_REALTIME)\
This mapping allows you to match teams between MAIN\_REALTIME events and the rest of the API.\
You can search by name or look up a specific team by either ID type.\
The parameters **`find_id`** and **`find_ws_id`** are mutually exclusive.\
Format CSV is in MS excel compatible mode (double click open without import!)\
The latest data are on the last page.

{% hint style="warning" %}
**MAIN\_REALTIME only** — This endpoint is needed only if you subscribe to the **MAIN\_REALTIME** channel (MEGA plan 🟩). All other WebSocket channels already use REST IDs, so no mapping is required for them.
{% endhint %}

#### Query Parameters

| Name         | Type   | Description                                                |
| ------------ | ------ | ---------------------------------------------------------- |
| t            | string | Your API Token **`DIRECT API ONLY`**                       |
| f            | string | Format response can be "json" or "csv" (default is "json") |
| p            | string | Page number (default value is 1)                           |
| search\_ws   | string | Search by WebSocket team name (partial match)              |
| search       | string | Search by REST team name (partial match)                   |
| find\_id     | string | Find by REST team ID (exact match)                         |
| find\_ws\_id | string | Find by WebSocket team ID (exact match)                    |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
   "status":200,
   "errors":[],
   "pagination":[
      {
         "page":1,// current page
         "per_page":100, // items per page
         "items":1250 // total items number
      }
   ],
   "result":[
      {
         "id":{
            "ws_realtime":"a1b2c3d4e5f6a7b8", // WebSocket team ID
            "rest_releated":"5fda5faf06aa325e" // REST API team ID
         },
         "name":{
            "ws_realtime":"FC Internazionale Milano", // name from WebSocket data source
            "rest_releated":"Inter Milan" // name from REST API
         },
         "country":{
            "ws_realtime":null, // country from WebSocket data source (may be null)
            "rest_releated":"IT" // country from REST API
         }
      },
      ...
   ]
}
```

{% endtab %}

{% tab title="CSV" %}

```
page_1_perPage_100_items_1250;id_ws_realtime;id_rest_releated;name_ws_realtime;name_rest_releated;country_ws_realtime;country_rest_releated
;a1b2c3d4e5f6a7b8;5fda5faf06aa325e;"FC Internazionale Milano";"Inter Milan";;"IT"
...
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/teams/ws/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/teams/ws/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/teams/ws/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/teams/ws/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/teams/ws/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/teams/ws/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/teams/ws/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/teams/ws/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/teams/ws/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/teams/ws/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/teams/ws/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/teams/ws/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# Websocket

List of endpoints of Webscoket entity.

New **-** */v1/ws/new* 🟨 🟦 🟩\
Generate a new WebSocket token

Get **-** */v1/ws/get* 🟨 🟦 🟩\
Get active token information

Renew **-** */v1/ws/renew* 🟨 🟦 🟩\
Renew token expiration

Delete **-** */v1/ws/delete*  🟨 🟦 🟩\
Delete a WebSocket token


# new

## Create WebSocket Token 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/ws/new/`

Generate a new WebSocket token or return an existing active token.

#### Query Parameters

| Name | Type   | Description                           |
| ---- | ------ | ------------------------------------- |
| t    | string | Your API Token **`DIRECT API TOKEN`** |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
  "status": 200,
  "errors": [],
  "pagination": [],
  "result": [
    {
      "is_new": true,
      "token": "abc123xyz789...", // The WebSocket authentication token
      "server": "wss://ws-eu.soccerfootball.info/?token=abc123xyz789...", // Full WebSocket connection URL with token
      "max_connections": 2, // Maximum simultaneous client connections allowed
      "max_subscribe_per_connection" : 2,// Maximum subscribe allowed per connection
      "allowed_channels": ["MAIN"], // List of channels available for subscription MAIN, STATS, ODDS, STATS_REALTIME, ODDS_REALTIME
      "expires_at": "2024-01-15 14:30:00" // Token expiration timestamp (UTC)
    }
  ]
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/ws/new/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/ws/new/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/ws/new/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/ws/new/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/ws/new/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/ws/new/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/ws/new/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/ws/new/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/ws/new/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/ws/new/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/ws/new/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/ws/new/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# get

## Get WebSocket Token Info  🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/ws/get/`

Retrieve information about your active WebSocket token.

#### Query Parameters

| Name | Type   | Description                          |
| ---- | ------ | ------------------------------------ |
| t    | string | Your API Token **`DIRECT API ONLY`** |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
  "status": 200,
  "errors": [],
  "pagination": [],
  "result": [
    {
      "token": "abc123xyz789...",
      "server": "wss://ws.soccerfootball.info/?token=abc123xyz789...",
      "max_connections": 35,
      "max_subscribe_per_connection": 10,
      "allowed_channels": ["MAIN", "STATS", "ODDS"],
      "expires_at": "2024-01-15 14:30:00",
      "active_connections": 2
    }
  ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/ws/get/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/ws/get/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/ws/get/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/ws/get/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/ws/get/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/ws/get/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/ws/get/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/ws/get/", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/ws/get/",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/ws/get/"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/ws/get/ \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/ws/get/"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# renew

## Renew WebSocket Token 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/ws/renew/?wid=ID`

Extend the expiration time of an existing WebSocket token.

#### Query Parameters

| Name | Type   | Description                          |
| ---- | ------ | ------------------------------------ |
| t    | string | Your API Token **`DIRECT API ONLY`** |
| wid  | string | The WebSocket token to renew         |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
  "status": 200,
  "errors": [],
  "pagination": [],
  "result": [
    {
      "renewed": true,
      "token": "abc123xyz789...",
      "expires_at": "2024-01-15 15:00:00",
      "message": "WebSocket token renewed successfully"
    }
  ]
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/ws/renew/?t=TOKEN&wid=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/ws/renew/?t=TOKEN&wid=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/ws/renew/?t=TOKEN&wid=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/ws/renew/?t=TOKEN&wid=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/ws/renew/?t=TOKEN&wid=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/ws/renew/?t=TOKEN&wid=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/ws/renew/?wid=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err  = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/teams/history/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# delete

## Delete WebSocket Token  🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/ws/delete/?wid=ID`

Delete an existing WebSocket token and terminate all associated connections.

#### Query Parameters

| Name | Type   | Description                          |
| ---- | ------ | ------------------------------------ |
| t    | string | Your API Token **`DIRECT API ONLY`** |
| wid  | string | he WebSocket token to delete         |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| X-RapidAPI-Key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| X-RapidAPI-Host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
  "status": 200,
  "errors": [],
  "pagination": [],
  "result": [
    {
      "deleted": true,
      "message": "WebSocket token deleted successfully"
    }
  ]
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/ws/delete/?t=TOKEN&wid=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/ws/delete/?t=TOKEN&wid=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/ws/delete/?t=TOKEN&wid=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/ws/delete/?t=TOKEN&wid=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/ws/delete/?t=TOKEN&wid=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/ws/delete/?t=TOKEN&wid=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccer-football-info.p.rapidapi.com/ws/delete/?wid=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
        "X-RapidAPI-Key: TOKEN"
    ],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccer-football-info.p.rapidapi.com/ws/delete/?wid=ID", {
    "method": "GET",
    "headers": {
        "X-RapidAPI-Key": "TOKEN",
        "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccer-football-info.p.rapidapi.com/ws/delete/?wid=ID",
  headers: {
   "X-RapidAPI-Key": "TOKEN",
     "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccer-football-info.p.rapidapi.com/ws/delete/?wid=ID"

headers = {
    "X-RapidAPI-Key": "TOKEN",
      "X-RapidAPI-Host": "soccer-football-info.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccer-football-info.p.rapidapi.com/ws/delete/?wid=ID \
    --header 'X-RapidAPI-Host: soccer-football-info.p.rapidapi.com' \
    --header 'X-RapidAPI-Key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccer-football-info.p.rapidapi.com/ws/delete/?wid=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-RapidAPI-Key", "TOKEN")
    req.Header.Add("X-RapidAPI-Host", "soccer-football-info.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/soccerfootball-info-soccerfootball-info-default/api/soccer-football-)


# Custom

## Custom endpoints  🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/custom/`

With our service you can request the development of a customized endpoint. \
That is, a call tailored to your needs. Just send an email to <info@soccerfootball.info> explaining what you need and we will get back to you with all the information you need to proceed. \
At this endpoint, as well as passing your unique ID via the parameter **`i`**, you will have to pass all the additional parameters necessary for the operation of your call.\
The return can be JSON, CSV or HTML

#### Query Parameters

| Name | Type   | Description                          |
| ---- | ------ | ------------------------------------ |
| t    | string | Your API Token **`DIRECT API ONLY`** |
| i    | string | Your endpoint unique ID              |

#### Headers

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| x-rapidapi-key  | string | Your API token **`RAPIDAPI ONLY`**                  |
| x-rapidapi-host | string | soccerfootballinfo.rapidapi.com **`RAPIDAPI ONLY`** |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
  "status": 200,
  "errors": [],
      "pagination": [],
      "result": [
          ...
      ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/custom/?t=TOKEN&i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/custom/?t=TOKEN&i=ID", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/custom/?t=TOKEN&i=ID'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/custom/?t=TOKEN&i=ID"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/custom/?t=TOKEN&i=ID'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/custom/?t=TOKEN&i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

## Example of code for RapidAPI

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://soccerfootballinfo.rapidapi.com/custom/?i=ID';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "x-rapidapi-host: soccerfootballinfo.rapidapi.com",
        "x-rapidapi-key: TOKEN"
    ],
));

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://soccerfootballinfo.rapidapi.com/custom/?i=ID", {
    "method": "GET",
    "headers": {
        "x-rapidapi-key": "TOKEN",
        "x-rapidapi-host": "soccerfootballinfo.rapidapi.com"
    }
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: "https://soccerfootballinfo.rapidapi.com/custom/?i=ID",
  headers: {
   "x-rapidapi-key": "TOKEN",
     "x-rapidapi-host": "soccerfootballinfo.rapidapi.com"
   useQueryString: true
  }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://soccerfootballinfo.rapidapi.com/custom/?i=ID"

headers = {
    "x-rapidapi-key": "TOKEN",
      "x-rapidapi-host": "soccerfootballinfo.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url https://soccerfootballinfo.rapidapi.com/custom/?i=ID \
    --header 'x-rapidapi-host: soccerfootballinfo.rapidapi.com' \
    --header 'x-rapidapi-key: TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://soccerfootballinfo.rapidapi.com/custom/?i=ID"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("x-rapidapi-key", "TOKEN")
    req.Header.Add("x-rapidapi-host", "soccerfootballinfo.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

More example of code on [rapidAPI](https://rapidapi.com/api-sports/api/api-football?endpoint=apiendpoint_2d5d829b-5827-4f72-973f-32d3c297e957)


# Token

List of endpoints of Token entity

[**Status** ](/v1/token/status)**-** */v1/token/status*  ⬜ 🟨 🟦 🟩\
Status of your token


# status

## View token status ⬜ 🟨 🟦 🟩

<mark style="color:blue;">`GET`</mark> `https://api.soccerfootball.info/v1/token/status`

This endpoint returns with token status, expire data and costs ecc..\
This call is for **`DIRECT API ONLY`**

#### Query Parameters

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| t    | string | Your API Token |

{% tabs %}
{% tab title="200 Success response" %}

```javascript
{
   "status":200,
   "errors":[

   ],
   "pagination":[

   ],
   "result":[
      {
         "token":"TOKEN",
         "allowed_ips":"all",
         "plan":"ULTRA",
         "expire_date":"2021-05-01 00:00:00",
         "status":"active",
         "reference":"example@example.com",
         "payment":{
            "cadence":"1m",
            "next_amount":"75.00",
            "next_payment":"2021-05-01 00:00:00"
         },
         "usage":{
            "requests_p_hour":3600,
            "pagination_items":50,
            "last_request_date":"2021-03-11 16:15:04",
            "last_hour_requests":164
         }
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/XJTQH8tCM5ZJYoj0jBag" %}

## Example of code for direct API

{% tabs %}
{% tab title="PHP" %}

```php
$url = 'https://api.soccerfootball.info/v1/token/status/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
    echo "cURL Error:" . $err;
}
```

{% endtab %}

{% tab title="Javascript" %}

```python
fetch("https://api.soccerfootball.info/v1/token/status/?t=TOKEN", {
    "method": "GET"
})
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.soccerfootball.info/v1/token/status/?t=TOKEN'
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
```

{% endtab %}

{% tab title="Phyton" %}

```python
import requests

url = "https://api.soccerfootball.info/v1/token/status/?t=TOKEN"

response = requests.get(url).json()

print(response)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/token/status/?t=TOKEN'
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.soccerfootball.info/v1/token/status/?t=TOKEN"

    req, _ := http.NewRequest("GET", url, nil)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}


# Getting started

This guide explains how to establish and maintain a WebSocket connection to the Soccer Football API real-time service.

## Connection URL

There is two connection urls:

`wss://ws-eu.soccerfootball.info/?token=YOUR_WEBSOCKET_TOKEN`

`wss://ws-as.soccerfootball.info/?token=YOUR_WEBSOCKET_TOKEN`

You must use the connection URL in response of [/v1/ws/new call.](/v1/ws)

{% hint style="warning" %}
**RapidAPI clients connecting from Asia: MAIN\_REALTIME is not available on the Asian node**

The `MAIN_REALTIME` channel is currently served **only** from the European node (`wss://ws-eu.soccerfootball.info`).

If you are a **RapidAPI** customer connecting from **Asia**, the `/v1/ws/new` response will route you to the Asian node and the `server` URL will point to `wss://ws-as.soccerfootball.info`. On that node the `MAIN_REALTIME` channel will \* *not*\* be available.

If you need `MAIN_REALTIME` in this situation, please email **<info@soccerfootball.info>**. We will set up a parallel, working token for you so you can connect to the European node and use the channel without issues.
{% endhint %}

## Connection flow

1. GET [/v1/ws/new](/v1/ws/new) → Obtain WebSocket token
2. Connect to WSS → Establish WebSocket connection
3. Subscribe to channels → Start receiving events
4. Handle events → Process incoming messages
5. Renew token → Before expiration (every \~25 minutes)

***

## Step-by-step guide

### Step 1 — Obtain a WebSocket token

Call the [/v1/ws/new](/v1/ws/new) endpoint to generate a new WebSocket token.

```bash
curl --request GET \
    --url 'https://api.soccerfootball.info/v1/ws/new/?t=YOUR_API_TOKEN'
```

The response contains everything you need to connect:

```json
{
  "status": 200,
  "errors": [],
  "pagination": [],
  "result": [
    {
      "is_new": true,
      "token": "abc123xyz789...",
      "server": "wss://ws-eu.soccerfootball.info/?token=abc123xyz789...",
      "max_connections": 2,
      "max_subscribe_per_connection": 2,
      "allowed_channels": ["MAIN"],
      "expires_at": "2024-01-15 14:30:00"
    }
  ]
}
```

Save the **`token`** and use the **`server`** URL to connect. Note the **`expires_at`** timestamp — you will need to renew the token before this time.

### Step 2 — Connect to WebSocket

Use the `server` URL from the previous response to establish a WebSocket connection:

```javascript
const ws = new WebSocket("wss://ws-eu.soccerfootball.info/?token=abc123xyz789...");

ws.onopen = () => {
  console.log("Connected!");
};
```

### Step 3 — Subscribe to a channel

Once connected, subscribe to the channels you need. For example, to receive all match events on the **MAIN** channel:

```javascript
ws.send(JSON.stringify({
  "action": "subscribe",
  "channel": "MAIN",
  "scope": "all"
}));
```

You can also subscribe to a specific match or league:

```javascript
// Subscribe to a specific match
ws.send(JSON.stringify({
  "action": "subscribe",
  "channel": "MAIN",
  "scope": "match",
  "id": "b01d28ac92221034"
}));

// Subscribe to a specific league
ws.send(JSON.stringify({
  "action": "subscribe",
  "channel": "MAIN",
  "scope": "league",
  "id": "f2b16fa54cb525d"
}));
```

The server confirms each subscription:

```json
{
  "type": "subscribed",
  "channel": "MAIN",
  "scope": "all",
  "id": null,
  "topicKey": "MAIN:all",
  "message": "Successfully subscribed"
}
```

### Step 4 — Handle events

Process incoming messages based on their `type`:

```javascript
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  switch (msg.type) {
    case 'match_start':
      console.log(`Match started: ${msg.data.teamA.name} vs ${msg.data.teamB.name}`);
      break;
    case 'goal':
      console.log(`GOAL! Score: ${msg.data.score} at ${msg.data.timer}'`);
      break;
    case 'halftime':
      console.log(`Halftime: ${msg.data.score}`);
      break;
    case 'match_end':
      console.log(`Full time: ${msg.data.finalScore}`);
      break;
    case 'pong':
      // Keep-alive response
      break;
    case 'subscribed':
      console.log(`Subscribed to: ${msg.topicKey}`);
      break;
    case 'error':
      console.error(`Error: ${msg.message}`);
      break;
  }
};
```

### Step 5 — Renew token before expiration

WebSocket tokens expire after approximately 25 minutes. You must call the [/v1/ws/renew](/v1/ws/renew) endpoint **before** the token expires to keep your connection alive.

Best practice: set a timer to renew **5 minutes before** the `expires_at` timestamp.

```javascript
// Renew the token via REST API
async function renewToken(apiToken, wsToken) {
  const response = await fetch(
    `https://api.soccerfootball.info/v1/ws/renew/?t=${apiToken}&wid=${wsToken}`
  );
  const data = await response.json();

  if (data.result[0].renewed) {
    console.log("Token renewed, new expiration:", data.result[0].expires_at);
  }
}

// Schedule renewal 5 minutes before expiration
const expiresAt = new Date("2024-01-15T14:30:00Z");
const renewAt = expiresAt.getTime() - (5 * 60 * 1000); // 5 minutes before
const delay = renewAt - Date.now();

setTimeout(() => {
  renewToken("YOUR_API_TOKEN", "abc123xyz789...");
}, delay);
```

***

## Complete example

A full working example combining all steps: obtain token, connect, subscribe, handle events, keep-alive ping, and token renewal.

```javascript
const API_TOKEN = "YOUR_API_TOKEN";

// Step 1 — Obtain token
async function start() {
  const res = await fetch(`https://api.soccerfootball.info/v1/ws/new/?t=${API_TOKEN}`);
  const json = await res.json();
  const { token, server, expires_at } = json.result[0];

  // Step 2 — Connect
  const ws = new WebSocket(server);

  ws.onopen = () => {
    console.log("Connected!");

    // Step 3 — Subscribe to MAIN channel
    ws.send(JSON.stringify({ action: "subscribe", channel: "MAIN", scope: "all" }));
  };

  // Step 4 — Handle events
  ws.onmessage = (event) => {
    const msg = JSON.parse(event.data);
    console.log(`[${msg.type}]`, msg.channel || "", msg.data || msg.message || "");
  };

  ws.onerror = (err) => console.error("WebSocket error:", err);

  ws.onclose = (event) => {
    console.log(`Connection closed: ${event.code} - ${event.reason}`);
    // Implement reconnection logic here if needed
  };

  // Keep-alive ping every 30 seconds
  const pingInterval = setInterval(() => {
    if (ws.readyState === WebSocket.OPEN) {
      ws.send(JSON.stringify({ action: "ping" }));
    }
  }, 30000);

  // Step 5 — Schedule token renewal 5 minutes before expiration
  const expiresAtMs = new Date(expires_at).getTime();
  const renewDelay = expiresAtMs - Date.now() - (5 * 60 * 1000);

  if (renewDelay > 0) {
    setTimeout(async () => {
      const renewRes = await fetch(
        `https://api.soccerfootball.info/v1/ws/renew/?t=${API_TOKEN}&wid=${token}`
      );
      const renewJson = await renewRes.json();
      console.log("Token renewed:", renewJson.result[0].expires_at);
    }, renewDelay);
  }
}

start();
```

***

{% hint style="info" %}
**MAIN\_REALTIME channel (MEGA plan 🟩 only)**

If you subscribe to the **MAIN\_REALTIME** channel, the messages contain IDs that are specific to the realtime data source and differ from the standard REST API IDs. To map these realtime IDs to the corresponding REST IDs, use the following endpoints:

* [/v1/live/ws](/v1/live/live-ws) — live matches with ID mapping
* [/v1/championships/ws](/v1/championships/ws) — championships with ID mapping
* [/v1/teams/ws](/v1/teams/ws) — teams with ID mapping

All other channels (MAIN, STATS, ODDS, STATS\_REALTIME, ODDS\_REALTIME) already use REST IDs — no mapping is needed.
{% endhint %}


# Commands

## Client Commands

This document describes the commands that clients can send to the WebSocket server.

### Command Format

All commands are JSON objects with an `action` field:

```json
{
  "action": "command_name",
  ...additional fields
}
```

### Available Commands

| Command     | Description                |
| ----------- | -------------------------- |
| subscribe   | Subscribe to a channel     |
| unsubscribe | Unsubscribe from a channel |
| ping        | Keep connection alive      |

***

### Subscribe

Subscribe to a channel to start receiving events.

#### Request

```json
{
  "action": "subscribe",
  "channel": "MAIN",
  "scope": "all"
}
```

#### Parameters

<table><thead><tr><th width="108.60009765625">Field</th><th width="106.5999755859375">Type</th><th width="114">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>action</code></td><td>string</td><td>Yes</td><td>Must be <code>"subscribe"</code></td></tr><tr><td><code>channel</code></td><td>string</td><td>Yes</td><td>Channel name (MAIN, MAIN_REALTIME, STATS, ODDS, STATS_REALTIME, ODDS_REALTIME)</td></tr><tr><td><code>scope</code></td><td>string</td><td>Yes</td><td>Subscription scope: <code>"all"</code>, <code>"match"</code>, or <code>"league"</code></td></tr><tr><td><code>id</code></td><td>string</td><td>Conditional</td><td>Required when scope is <code>"match"</code> or <code>"league"</code></td></tr></tbody></table>

#### Success Response

```json
{
  "type": "subscribed",
  "channel": "MAIN",
  "scope": "all",
  "id": null,
  "topicKey": "MAIN:all",
  "message": "Successfully subscribed"
}
```

When subscribing with a specific scope:

```json
{
  "type": "subscribed",
  "channel": "STATS",
  "scope": "match",
  "id": "12345",
  "topicKey": "STATS:match:12345",
  "message": "Successfully subscribed"
}
```

#### Error Response

```json
{
  "type": "error",
  "code": "CHANNEL_NOT_ALLOWED",
  "message": "Channel STATS_REALTIME is not available for your plan"
}
```

#### Error Codes

| Code                  | Description                            |
| --------------------- | -------------------------------------- |
| `CHANNEL_NOT_ALLOWED` | Your plan doesn't include this channel |
| `SUBSCRIPTION_LIMIT`  | Maximum subscriptions reached          |
| `INVALID_CHANNEL`     | Channel name is not valid              |
| `INVALID_SCOPE`       | Scope format is not valid              |

#### Examples

```json
// Subscribe to all main events
{"action": "subscribe", "channel": "MAIN", "scope": "all"}

// Subscribe to stats for a specific match
{"action": "subscribe", "channel": "STATS", "scope": "match", "id": "12345"}

// Subscribe to odds for an entire league
{"action": "subscribe", "channel": "ODDS", "scope": "league", "id": "67890"}

// Subscribe to real-time stats updates (MEGA plan only)
{"action": "subscribe", "channel": "STATS_REALTIME", "scope": "match", "id": "12345"}
```

***

### Unsubscribe

Unsubscribe from a channel to stop receiving events.

#### Request

```json
{
  "action": "unsubscribe",
  "channel": "MAIN",
  "scope": "all"
}
```

#### Parameters

<table><thead><tr><th width="112.5999755859375">Field</th><th width="125.4000244140625">Type</th><th width="111">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>action</code></td><td>string</td><td>Yes</td><td>Must be <code>"unsubscribe"</code></td></tr><tr><td><code>channel</code></td><td>string</td><td>Yes</td><td>Channel name to unsubscribe from</td></tr><tr><td><code>scope</code></td><td>string</td><td>Yes</td><td>Scope to unsubscribe from: <code>"all"</code>, <code>"match"</code>, or <code>"league"</code></td></tr><tr><td><code>id</code></td><td>string</td><td>Conditional</td><td>Required when scope is <code>"match"</code> or <code>"league"</code></td></tr></tbody></table>

#### Success Response

```json
{
  "type": "unsubscribed",
  "channel": "MAIN",
  "scope": "all",
  "id": null,
  "topicKey": "MAIN:all",
  "message": "Successfully unsubscribed"
}
```

#### Error Response

```json
{
  "type": "error",
  "code": "NOT_SUBSCRIBED",
  "message": "Not subscribed to this channel/scope"
}
```

#### Notes

* Unsubscribing frees up a subscription slot
* You must specify the exact channel and scope used when subscribing
* Unsubscribing from a non-existent subscription returns an error but doesn't affect other subscriptions

***

### Ping

Send a ping to keep the connection alive and verify connectivity.

#### Request

```json
{
  "action": "ping"
}
```

#### Response

```json
{
  "type": "pong",
  "ts": 1705312800000
}
```

#### Response Fields

| Field  | Type    | Description                      |
| ------ | ------- | -------------------------------- |
| `type` | string  | Always `"pong"`                  |
| `ts`   | integer | Server timestamp in milliseconds |

#### Best Practices

* Send a ping every 30 seconds to maintain the connection
* Use the response timestamp to measure latency
* If no pong is received within 10 seconds, consider the connection dead and reconnect

#### Example Implementation

```javascript
// JavaScript ping implementation
setInterval(() => {
  if (ws.readyState === WebSocket.OPEN) {
    ws.send(JSON.stringify({ action: 'ping' }));
  }
}, 30000);
```

```python
# Python ping implementation
async def keep_alive(ws):
    while True:
        await asyncio.sleep(30)
        await ws.send(json.dumps({"action": "ping"}))
```

***

### Invalid Command Handling

If you send an unrecognized command, the server responds with:

```json
{
  "type": "error",
  "code": "INVALID_ACTION",
  "message": "Unknown action: foobar"
}
```

### Rate Limiting

* Commands are rate-limited to prevent abuse
* Maximum 10 commands per second per connection
* Exceeding the limit results in temporary throttling


# Channels

This document provides an overview of all available WebSocket channels and their purposes.

### Available Channels

| Channel         | Description                       | Update Frequency                           | Plans            |
| --------------- | --------------------------------- | ------------------------------------------ | ---------------- |
| MAIN            | Key match events                  | Event-driven                               | PRO, ULTRA, MEGA |
| MAIN\_REALTIME  | Key match events (lowest latency) | Event-driven (ultra-low latency)           | MEGA             |
| STATS           | Full statistics snapshots         | Immediate (match/league) · 30s batch (all) | ULTRA, MEGA      |
| ODDS            | Full odds snapshots               | Immediate (match/league) · 30s batch (all) | ULTRA, MEGA      |
| STATS\_REALTIME | Statistics deltas                 | Real-time                                  | MEGA             |
| ODDS\_REALTIME  | Odds deltas                       | Real-time                                  | MEGA             |

### Channel Details

#### MAIN Channel

The MAIN channel delivers key match events as they happen:

* Match start
* Goals
* Halftime
* Second half start
* Match end

**Best for:** Applications that need to track match progress and key events without full statistics.

**Update frequency:** Event-driven (only when events occur)

#### MAIN\_REALTIME Channel

The MAIN\_REALTIME channel delivers the same key match events as MAIN but with the lowest possible latency:

* Match start
* Goals
* Halftime
* Second half start
* Match end

**Best for:** Applications that require the absolute fastest match event delivery, such as live betting platforms and real-time trading systems.

**Update frequency:** Event-driven with ultra-low latency (MEGA plan only)

#### STATS Channel

The STATS channel delivers complete statistics snapshots:

* All match statistics in a single message
* **match/league scope:** immediate delivery when data changes
* **all scope:** batched delivery every 30 seconds (`batch_update`)

**Best for:** Applications that need complete statistics data and don't require real-time updates.

**Update frequency:** Immediate for `match`/`league` scope · Every 30 seconds (batch) for `all` scope

#### ODDS Channel

The ODDS channel delivers complete odds snapshots:

* All odds markets in a single message
* **match/league scope:** immediate delivery when data changes
* **all scope:** batched delivery every 30 seconds (`batch_update`)

**Best for:** Applications that need complete odds data and don't require real-time updates.

**Update frequency:** Immediate for `match`/`league` scope · Every 30 seconds (batch) for `all` scope

#### STATS\_REALTIME Channel

The STATS\_REALTIME channel delivers only the statistics that changed:

* Delta updates (only changed values)
* Immediate delivery when changes occur
* Lower bandwidth than full snapshots

**Best for:** Applications that need instant statistics updates and can maintain local state.

**Update frequency:** Real-time (as changes occur)

#### ODDS\_REALTIME Channel

The ODDS\_REALTIME channel delivers only the odds that changed:

* Delta updates (only changed values)
* Immediate delivery when changes occur
* Lower bandwidth than full snapshots

**Best for:** Applications that need instant odds updates and can maintain local state.

**Update frequency:** Real-time (as changes occur)

### Channel Availability by Plan

| Plan  | MAIN | MAIN\_REALTIME | STATS | ODDS | STATS\_REALTIME | ODDS\_REALTIME |
| ----- | ---- | -------------- | ----- | ---- | --------------- | -------------- |
| BASIC | -    | -              | -     | -    | -               | -              |
| PRO   | Yes  | -              | -     | -    | -               | -              |
| ULTRA | Yes  | -              | Yes   | Yes  | -               | -              |
| MEGA  | Yes  | Yes            | Yes   | Yes  | Yes             | Yes            |

### Subscription Scopes

All channels support the following subscription scopes:

<table><thead><tr><th width="102.7999267578125">Scope</th><th width="111.4000244140625">Format</th><th width="120.5999755859375">id required</th><th>Description</th></tr></thead><tbody><tr><td>All</td><td><code>all</code></td><td>No</td><td>Receive events for all matches</td></tr><tr><td>Match</td><td><code>match</code></td><td>Yes</td><td>Receive events for a specific match (pass <code>id</code> separately)</td></tr><tr><td>League</td><td><code>league</code></td><td>Yes</td><td>Receive events for all matches in a league (pass <code>id</code> separately)</td></tr></tbody></table>

### Choosing the Right Channel

#### For basic match tracking

Use **MAIN** channel only. You'll receive goals, halftime, and match end events.

#### For detailed statistics

Use **STATS** channel for periodic full snapshots, or **STATS\_REALTIME** (MEGA only) for immediate updates.

#### For odds monitoring

Use **ODDS** channel for periodic full snapshots, or **ODDS\_REALTIME** (MEGA only) for immediate updates.

#### For real-time applications

Combine **MAIN** for events with **STATS\_REALTIME** and **ODDS\_REALTIME** for the most responsive experience. For the absolute fastest event delivery, use **MAIN\_REALTIME** instead of MAIN (MEGA plan only).

### Message Format

#### Event message (match/league scope)

Sent immediately to `match` and `league` scope subscribers:

```json
{
  "type": "event",
  "channel": "CHANNEL_NAME",
  "scope": "match",
  "id": "12345",
  "eventType": "stats_update",
  "eventId": "abc123",
  "ts": 1705312800000,
  "data": { ... }
}
```

| Field       | Type    | Description                                                    |
| ----------- | ------- | -------------------------------------------------------------- |
| `type`      | string  | Always `"event"`                                               |
| `channel`   | string  | Source channel name                                            |
| `scope`     | string  | Publish scope (`"match"`)                                      |
| `id`        | string  | Match public ID                                                |
| `eventType` | string  | Event type (e.g., `"stats_update"`, `"odds_update"`, `"goal"`) |
| `eventId`   | string  | Unique event ID for deduplication                              |
| `ts`        | integer | Event timestamp in milliseconds                                |
| `data`      | object  | Event-specific data                                            |

#### Batch message (all scope)

Sent every 30 seconds to `all` scope subscribers of STATS and ODDS channels:

```json
{
  "type": "batch_update",
  "channel": "CHANNEL_NAME",
  "scope": "all",
  "timestamp": 1705312800000,
  "matches": [
    { "matchId": "12345", "leagueId": "67890", "data": { ... } }
  ]
}
```

| Field                | Type    | Description                                          |
| -------------------- | ------- | ---------------------------------------------------- |
| `type`               | string  | Always `"batch_update"`                              |
| `channel`            | string  | Source channel name (`"STATS"` or `"ODDS"`)          |
| `scope`              | string  | Always `"all"`                                       |
| `timestamp`          | integer | Batch creation timestamp in milliseconds             |
| `matches`            | array   | Array of match updates accumulated since last batch  |
| `matches[].matchId`  | string  | Match public ID                                      |
| `matches[].leagueId` | string  | League/Championship public ID                        |
| `matches[].data`     | object  | Event-specific data (same structure as `event` data) |

### Best Practices

1. **Start with MAIN**: Always subscribe to MAIN for basic match events
2. **Add channels as needed**: Subscribe to STATS or ODDS only if you need that data
3. **Use REALTIME wisely**: REALTIME channels are powerful but require local state management
4. **Unsubscribe when done**: Free up subscription slots when matches end


# MAIN

## MAIN Channel

The MAIN channel delivers key match events in real-time as they occur.

### Availability

| Plan  | Available |
| ----- | --------- |
| BASIC | No        |
| PRO   | Yes       |
| ULTRA | Yes       |
| MEGA  | Yes       |

### Events

| Event               | Description         |
| ------------------- | ------------------- |
| match\_start        | Match has started   |
| goal                | A goal was scored   |
| halftime            | First half ended    |
| second\_half\_start | Second half started |
| match\_end          | Match has ended     |

***

### match\_start

Fired when a match kicks off.

#### Message

```json
{
  "type": "match_start",
  "channel": "MAIN",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705312800000,
  "data": {
    "teamA": {
      "id": "1001",
      "name": "Manchester United"
    },
    "teamB": {
      "id": "1002",
      "name": "Liverpool"
    },
    "championship": {
      "id": "67890",
      "name": "Premier League",
      "country": "England",
      "seasonName": "2023/2024"
    },
    "startDate": "2024-01-15T15:00:00Z"
  }
}
```

#### Data Fields

| Field                     | Type   | Description                 |
| ------------------------- | ------ | --------------------------- |
| `teamA`                   | object | Home team information       |
| `teamA.id`                | string | Team public ID              |
| `teamA.name`              | string | Team name                   |
| `teamB`                   | object | Away team information       |
| `teamB.id`                | string | Team public ID              |
| `teamB.name`              | string | Team name                   |
| `championship`            | object | Championship information    |
| `championship.id`         | string | Championship public ID      |
| `championship.name`       | string | Championship name           |
| `championship.country`    | string | Country                     |
| `championship.seasonName` | string | Season name                 |
| `startDate`               | string | Match start time (ISO 8601) |

***

### goal

Fired when a goal is scored.

#### Message

```json
{
  "type": "goal",
  "channel": "MAIN",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705314600000,
  "data": {
    "score": "1;0",
    "timer": "23",
    "team": "A"
  }
}
```

#### Data Fields

| Field   | Type   | Description                                |
| ------- | ------ | ------------------------------------------ |
| `score` | string | Current score in format "teamA;teamB"      |
| `timer` | string | Match minute when goal was scored          |
| `team`  | string | Team that scored: "A" (home) or "B" (away) |

#### Score Format

The score is formatted as `"X;Y"` where:

* `X` = Goals scored by Team A (home)
* `Y` = Goals scored by Team B (away)

Example: `"2;1"` means Team A is winning 2-1.

***

### halftime

Fired when the first half ends.

#### Message

```json
{
  "type": "halftime",
  "channel": "MAIN",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705315500000,
  "data": {
    "score": "1;1"
  }
}
```

#### Data Fields

| Field   | Type   | Description                               |
| ------- | ------ | ----------------------------------------- |
| `score` | string | Score at halftime in format "teamA;teamB" |

***

### second\_half\_start

Fired when the second half kicks off.

#### Message

```json
{
  "type": "second_half_start",
  "channel": "MAIN",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705316400000,
  "data": {
    "score": "1;1"
  }
}
```

#### Data Fields

| Field   | Type   | Description                        |
| ------- | ------ | ---------------------------------- |
| `score` | string | Current score at second half start |

***

### match\_end

Fired when the match ends (full time, or after extra time/penalties if applicable).

#### Message

```json
{
  "type": "match_end",
  "channel": "MAIN",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705318800000,
  "data": {
    "finalScore": "2;1",
    "score1h": "1;1"
  }
}
```

#### Data Fields

| Field        | Type   | Description                              |
| ------------ | ------ | ---------------------------------------- |
| `finalScore` | string | Final score in format "teamA;teamB"      |
| `score1h`    | string | First half score in format "teamA;teamB" |

***

### Subscription Examples

#### Subscribe to all MAIN events

```json
{"action": "subscribe", "channel": "MAIN", "scope": "all"}
```

#### Subscribe to a specific match

```json
{"action": "subscribe", "channel": "MAIN", "scope": "match", "id": "b01d28ac92221034"}
```

#### Subscribe to a league

```json
{"action": "subscribe", "channel": "MAIN", "scope": "league", "id": "f2b16fa54cb525d"}
```

***

### Example: Tracking a Match

```javascript
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.channel !== 'MAIN') return;

  switch (msg.type) {
    case 'match_start':
      console.log(`Match started: ${msg.data.teamA.name} vs ${msg.data.teamB.name}`);
      break;

    case 'goal':
      const [homeGoals, awayGoals] = msg.data.score.split(';');
      const scorer = msg.data.team === 'A' ? 'Home' : 'Away';
      console.log(`GOAL! ${scorer} team scores at ${msg.data.timer}'`);
      console.log(`Score: ${homeGoals} - ${awayGoals}`);
      break;

    case 'halftime':
      console.log(`Halftime: ${msg.data.score.replace(';', ' - ')}`);
      break;

    case 'second_half_start':
      console.log('Second half started');
      break;

    case 'match_end':
      console.log(`Full time: ${msg.data.finalScore.replace(';', ' - ')}`);
      console.log(`First half was: ${msg.data.score1h.replace(';', ' - ')}`);
      break;
  }
};
```


# MAIN REALTIME

## MAIN\_REALTIME Channel

The MAIN\_REALTIME channel delivers the same key match events as the MAIN channel, but with the lowest possible latency available in the market. This is the fastest channel for receiving soccer match events in real-time, designed for applications where milliseconds matter, such as live betting platforms, in-play trading systems, and real-time score trackers.

### Availability

| Plan  | Available |
| ----- | --------- |
| BASIC | No        |
| PRO   | No        |
| ULTRA | No        |
| MEGA  | Yes       |

{% hint style="warning" %}
**RapidAPI clients connecting from Asia: MAIN\_REALTIME is not available on the Asian node**

The `MAIN_REALTIME` channel is currently served **only** from the European node (`wss://ws-eu.soccerfootball.info`).

If you are a **RapidAPI** customer connecting from **Asia**, the `/v1/ws/new` response will route you to the Asian node and the `server` URL will point to `wss://ws-as.soccerfootball.info`. On that node the `MAIN_REALTIME` channel will \* *not*\* be available.

If you need `MAIN_REALTIME` in this situation, please email **<info@soccerfootball.info>**. We will set up a parallel, working token for you so you can connect to the European node and use the channel without issues.
{% endhint %}

### Events

| Event               | Description         |
| ------------------- | ------------------- |
| match\_start        | Match has started   |
| goal                | A goal was scored   |
| halftime            | First half ended    |
| second\_half\_start | Second half started |
| match\_end          | Match has ended     |

***

### match\_start

Fired when a match kicks off.

#### Message

```json
{
  "type": "match_start",
  "channel": "MAIN_REALTIME",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705312800000,
  "data": {
    "teamA": {
      "id": "1001",
      "name": "Manchester United"
    },
    "teamB": {
      "id": "1002",
      "name": "Liverpool"
    },
    "championship": {
      "id": "67890",
      "name": "Premier League",
      "country": "England",
      "seasonName": "2023/2024"
    },
    "startDate": "2024-01-15T15:00:00Z"
  }
}
```

#### Data Fields

| Field                     | Type   | Description                 |
| ------------------------- | ------ | --------------------------- |
| `teamA`                   | object | Home team information       |
| `teamA.id`                | string | Team public ID              |
| `teamA.name`              | string | Team name                   |
| `teamB`                   | object | Away team information       |
| `teamB.id`                | string | Team public ID              |
| `teamB.name`              | string | Team name                   |
| `championship`            | object | Championship information    |
| `championship.id`         | string | Championship public ID      |
| `championship.name`       | string | Championship name           |
| `championship.country`    | string | Country                     |
| `championship.seasonName` | string | Season name                 |
| `startDate`               | string | Match start time (ISO 8601) |

***

### goal

Fired when a goal is scored.

#### Message

```json
{
  "type": "goal",
  "channel": "MAIN_REALTIME",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705314600000,
  "data": {
    "score": "1;0",
    "timer": "23",
    "team": "A"
  }
}
```

#### Data Fields

| Field   | Type   | Description                                |
| ------- | ------ | ------------------------------------------ |
| `score` | string | Current score in format "teamA;teamB"      |
| `timer` | string | Match minute when goal was scored          |
| `team`  | string | Team that scored: "A" (home) or "B" (away) |

#### Score Format

The score is formatted as `"X;Y"` where:

* `X` = Goals scored by Team A (home)
* `Y` = Goals scored by Team B (away)

Example: `"2;1"` means Team A is winning 2-1.

***

### halftime

Fired when the first half ends.

#### Message

```json
{
  "type": "halftime",
  "channel": "MAIN_REALTIME",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705315500000,
  "data": {
    "score": "1;1"
  }
}
```

#### Data Fields

| Field   | Type   | Description                               |
| ------- | ------ | ----------------------------------------- |
| `score` | string | Score at halftime in format "teamA;teamB" |

***

### second\_half\_start

Fired when the second half kicks off.

#### Message

```json
{
  "type": "second_half_start",
  "channel": "MAIN_REALTIME",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705316400000,
  "data": {
    "score": "1;1"
  }
}
```

#### Data Fields

| Field   | Type   | Description                        |
| ------- | ------ | ---------------------------------- |
| `score` | string | Current score at second half start |

***

### match\_end

Fired when the match ends (full time, or after extra time/penalties if applicable).

#### Message

```json
{
  "type": "match_end",
  "channel": "MAIN_REALTIME",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705318800000,
  "data": {
    "finalScore": "2;1",
    "score1h": "1;1"
  }
}
```

#### Data Fields

| Field        | Type   | Description                              |
| ------------ | ------ | ---------------------------------------- |
| `finalScore` | string | Final score in format "teamA;teamB"      |
| `score1h`    | string | First half score in format "teamA;teamB" |

***

### MAIN vs MAIN\_REALTIME Comparison

| Feature           | MAIN                   | MAIN\_REALTIME                        |
| ----------------- | ---------------------- | ------------------------------------- |
| Events            | Same 5 event types     | Same 5 event types                    |
| Latency           | Standard               | Ultra-low (fastest available)         |
| Plan availability | PRO, ULTRA, MEGA       | MEGA only                             |
| Best for          | General match tracking | Live betting, trading, real-time apps |

***

### Subscription Examples

#### Subscribe to all MAIN\_REALTIME events

```json
{"action": "subscribe", "channel": "MAIN_REALTIME", "scope": "all"}
```

#### Subscribe to a specific match

```json
{"action": "subscribe", "channel": "MAIN_REALTIME", "scope": "match", "id": "b01d28ac92221034"}
```

#### Subscribe to a league

```json
{"action": "subscribe", "channel": "MAIN_REALTIME", "scope": "league", "id": "f2b16fa54cb525d"}
```

***

### Example: Tracking a Match

```javascript
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.channel !== 'MAIN_REALTIME') return;

  switch (msg.type) {
    case 'match_start':
      console.log(`Match started: ${msg.data.teamA.name} vs ${msg.data.teamB.name}`);
      break;

    case 'goal':
      const [homeGoals, awayGoals] = msg.data.score.split(';');
      const scorer = msg.data.team === 'A' ? 'Home' : 'Away';
      console.log(`GOAL! ${scorer} team scores at ${msg.data.timer}'`);
      console.log(`Score: ${homeGoals} - ${awayGoals}`);
      break;

    case 'halftime':
      console.log(`Halftime: ${msg.data.score.replace(';', ' - ')}`);
      break;

    case 'second_half_start':
      console.log('Second half started');
      break;

    case 'match_end':
      console.log(`Full time: ${msg.data.finalScore.replace(';', ' - ')}`);
      console.log(`First half was: ${msg.data.score1h.replace(';', ' - ')}`);
      break;
  }
};
```


# STATS

## STATS Channel

The STATS channel delivers complete statistics snapshots periodically during live matches.

### Availability

| Plan  | Available |
| ----- | --------- |
| BASIC | No        |
| PRO   | No        |
| ULTRA | Yes       |
| MEGA  | Yes       |

### Update Frequency

Update frequency depends on your subscription scope:

* **`match` / `league` scope:** statistics are delivered **immediately** when data changes
* **`all` scope:** statistics are accumulated and delivered as a **batch every 30 seconds** (`batch_update`)

### Events

| Event         | Scope             | Description                                    |
| ------------- | ----------------- | ---------------------------------------------- |
| stats\_update | `match`, `league` | Full statistics snapshot (immediate)           |
| batch\_update | `all`             | Batched statistics for all matches (every 30s) |

***

### stats\_update

Delivers a complete snapshot of all match statistics.

#### Message

```json
{
  "type": "event",
  "channel": "STATS",
  "scope": "match",
  "id": "12345",
  "eventType": "stats_update",
  "eventId": "abc123",
  "ts": 1705314600000,
  "data": {
    "timer": "35",
    "extraTimer": null,
    "status": "IN_PLAY",
    "score": "1;0",
    "score1h": null,
    "score2h": null,
    "possession": "55;45",
    "attacks": "48;32",
    "dangerousAttacks": "22;15",
    "shotsOnTarget": "4;2",
    "shotsOffTarget": "3;5",
    "totalShots": "7;7",
    "shotsBlocked": "2;1",
    "corners": "4;2",
    "corners1h": null,
    "fouls": "8;10",
    "yellowCards": "1;2",
    "redCards": "0;0",
    "yellowToRed": "0;0",
    "substitutions": "0;1",
    "throwIns": "12;9",
    "injuries": "0;1",
    "penalties": "0;0",
    "offsides": "2;1",
    "xg": "0.85;0.42"
  }
}
```

#### Data Fields

**Match State**

| Field        | Type        | Description                             |
| ------------ | ----------- | --------------------------------------- |
| `timer`      | string      | Current match minute                    |
| `extraTimer` | string/null | Extra time minutes (e.g., "3" for 45+3) |
| `status`     | string      | Match status                            |
| `score`      | string      | Current score "teamA;teamB"             |
| `score1h`    | string/null | First half score (after halftime)       |
| `score2h`    | string/null | Second half score (after full time)     |

**Statistics**

All statistics are in format `"teamA;teamB"`:

| Field              | Type        | Description                         |
| ------------------ | ----------- | ----------------------------------- |
| `possession`       | string      | Ball possession percentage          |
| `attacks`          | string      | Total attacks                       |
| `dangerousAttacks` | string      | Dangerous attacks                   |
| `shotsOnTarget`    | string      | Shots on target                     |
| `shotsOffTarget`   | string      | Shots off target                    |
| `totalShots`       | string      | Total shots                         |
| `shotsBlocked`     | string      | Blocked shots                       |
| `corners`          | string      | Total corners                       |
| `corners1h`        | string/null | First half corners                  |
| `fouls`            | string      | Fouls committed                     |
| `yellowCards`      | string      | Yellow cards                        |
| `redCards`         | string      | Red cards                           |
| `yellowToRed`      | string      | Second yellow (yellow to red) cards |
| `substitutions`    | string      | Substitutions made                  |
| `throwIns`         | string      | Throw-ins                           |
| `injuries`         | string      | Injuries                            |
| `penalties`        | string      | Penalties awarded                   |
| `offsides`         | string      | Offsides                            |
| `xg`               | string/null | Expected goals (xG)                 |

#### Match Status Values

| Status        | Description             |
| ------------- | ----------------------- |
| `NOT_STARTED` | Match hasn't started    |
| `IN_PLAY`     | First half in progress  |
| `HALFTIME`    | Halftime break          |
| `IN_PLAY_2H`  | Second half in progress |
| `EXTRA_TIME`  | Extra time in progress  |
| `PENALTIES`   | Penalty shootout        |
| `ENDED`       | Match finished          |
| `POSTPONED`   | Match postponed         |
| `CANCELLED`   | Match cancelled         |

***

### batch\_update

Delivers a batch of statistics snapshots for all live matches. Sent every 30 seconds to `all` scope subscribers only.

#### Message

```json
{
  "type": "batch_update",
  "channel": "STATS",
  "scope": "all",
  "timestamp": 1705314600000,
  "matches": [
    {
      "matchId": "12345",
      "leagueId": "67890",
      "data": {
        "timer": "35",
        "status": "IN_PLAY",
        "score": "1;0",
        "possession": "55;45",
        "..."
      }
    },
    {
      "matchId": "12346",
      "leagueId": "67890",
      "data": {
        "timer": "72",
        "status": "IN_PLAY_2H",
        "score": "2;2",
        "possession": "48;52",
        "..."
      }
    }
  ]
}
```

#### Fields

| Field                | Type    | Description                                              |
| -------------------- | ------- | -------------------------------------------------------- |
| `type`               | string  | Always `"batch_update"`                                  |
| `channel`            | string  | Always `"STATS"`                                         |
| `scope`              | string  | Always `"all"`                                           |
| `timestamp`          | integer | Batch creation timestamp in milliseconds                 |
| `matches`            | array   | Array of match updates accumulated since last batch      |
| `matches[].matchId`  | string  | Match public ID                                          |
| `matches[].leagueId` | string  | League/Championship public ID                            |
| `matches[].data`     | object  | Statistics snapshot (same fields as `stats_update` data) |

> **Note:** If a match has multiple updates within a 30-second window, only the latest data for that `matchId` is included in the batch.

***

### Subscription Examples

#### Subscribe to all stats updates

```json
{"action": "subscribe", "channel": "STATS", "scope": "all"}
```

#### Subscribe to a specific match

```json
{"action": "subscribe", "channel": "STATS", "scope": "match", "id": "b01d28ac92221034"}
```

#### Subscribe to a league

```json
{"action": "subscribe", "channel": "STATS", "scope": "league", "id": "f2b16fa54cb525d"}
```

***

### Example: Processing Stats

```javascript
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.type !== 'stats_update') return;

  const stats = msg.data;

  // Parse possession
  const [homePoss, awayPoss] = stats.possession.split(';').map(Number);
  console.log(`Possession: Home ${homePoss}% - Away ${awayPoss}%`);

  // Parse shots
  const [homeShots, awayShots] = stats.totalShots.split(';').map(Number);
  const [homeSoT, awaySoT] = stats.shotsOnTarget.split(';').map(Number);
  console.log(`Shots: Home ${homeShots} (${homeSoT} on target) - Away ${awayShots} (${awaySoT} on target)`);

  // Parse corners
  const [homeCorners, awayCorners] = stats.corners.split(';').map(Number);
  console.log(`Corners: Home ${homeCorners} - Away ${awayCorners}`);

  // Parse xG if available
  if (stats.xg) {
    const [homeXg, awayXg] = stats.xg.split(';').map(parseFloat);
    console.log(`xG: Home ${homeXg.toFixed(2)} - Away ${awayXg.toFixed(2)}`);
  }
};
```

### Example: Building a Stats Display

```javascript
function formatStats(stats) {
  const parseValue = (val) => val ? val.split(';') : ['-', '-'];

  return {
    timer: `${stats.timer}'${stats.extraTimer ? `+${stats.extraTimer}` : ''}`,
    score: parseValue(stats.score).join(' - '),
    possession: {
      home: parseValue(stats.possession)[0] + '%',
      away: parseValue(stats.possession)[1] + '%'
    },
    shots: {
      home: parseValue(stats.totalShots)[0],
      away: parseValue(stats.totalShots)[1]
    },
    shotsOnTarget: {
      home: parseValue(stats.shotsOnTarget)[0],
      away: parseValue(stats.shotsOnTarget)[1]
    },
    corners: {
      home: parseValue(stats.corners)[0],
      away: parseValue(stats.corners)[1]
    },
    fouls: {
      home: parseValue(stats.fouls)[0],
      away: parseValue(stats.fouls)[1]
    },
    cards: {
      home: `${parseValue(stats.yellowCards)[0]}Y ${parseValue(stats.redCards)[0]}R`,
      away: `${parseValue(stats.yellowCards)[1]}Y ${parseValue(stats.redCards)[1]}R`
    }
  };
}
```

***

### Notes

* Statistics are only sent while the match is live
* Null values indicate the statistic is not yet available
* The snapshot includes ALL available statistics, not just changed values
* For real-time delta updates, use the STATS\_REALTIME channel (MEGA plan only)


# STATS REALTIME

The STATS\_REALTIME channel delivers only the statistics that have changed, in real-time.

### Availability

| Plan  | Available |
| ----- | --------- |
| BASIC | No        |
| PRO   | No        |
| ULTRA | No        |
| MEGA  | Yes       |

### Update Frequency

Updates are sent **immediately** when statistics change (real-time).

### Events

| Event                   | Description             |
| ----------------------- | ----------------------- |
| stats\_update\_realtime | Changed statistics only |

***

### stats\_update\_realtime

Delivers only the statistics that have changed since the last update.

#### Message

```json
{
  "type": "stats_update_realtime",
  "channel": "STATS_REALTIME",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705314600000,
  "data": {
    "changedStats": [
      {
        "stat": "possession",
        "value": "56;44"
      },
      {
        "stat": "corners",
        "value": "5;2"
      },
      {
        "stat": "shotsOnTarget",
        "value": "5;2"
      }
    ]
  }
}
```

#### Data Fields

| Field                  | Type   | Description                       |
| ---------------------- | ------ | --------------------------------- |
| `changedStats`         | array  | Array of changed statistics       |
| `changedStats[].stat`  | string | Statistic name                    |
| `changedStats[].value` | string | New value in "teamA;teamB" format |

#### Available Statistics

| Stat Name          | Description          |
| ------------------ | -------------------- |
| `timer`            | Current match minute |
| `extraTimer`       | Extra time minutes   |
| `status`           | Match status         |
| `score`            | Current score        |
| `score1h`          | First half score     |
| `score2h`          | Second half score    |
| `possession`       | Ball possession %    |
| `attacks`          | Total attacks        |
| `dangerousAttacks` | Dangerous attacks    |
| `shotsOnTarget`    | Shots on target      |
| `shotsOffTarget`   | Shots off target     |
| `totalShots`       | Total shots          |
| `shotsBlocked`     | Blocked shots        |
| `corners`          | Total corners        |
| `corners1h`        | First half corners   |
| `fouls`            | Fouls committed      |
| `yellowCards`      | Yellow cards         |
| `redCards`         | Red cards            |
| `yellowToRed`      | Second yellow cards  |
| `substitutions`    | Substitutions        |
| `throwIns`         | Throw-ins            |
| `injuries`         | Injuries             |
| `penalties`        | Penalties awarded    |
| `offsides`         | Offsides             |
| `xg`               | Expected goals       |

***

### Subscription Examples

#### Subscribe to all real-time stats updates

NO scope "all" allowed

#### Subscribe to a specific match

```json
{"action": "subscribe", "channel": "STATS_REALTIME", "scope": "match", "id": "b01d28ac92221034"}
```

#### Subscribe to a league

```json
{"action": "subscribe", "channel": "STATS_REALTIME", "scope": "league", "id": "f2b16fa54cb525d"}
```

***

### Example: Maintaining Local State

```javascript
// Local state for match statistics
const matchStats = {};

function initializeStats(matchId) {
  matchStats[matchId] = {
    timer: '0',
    possession: '50;50',
    corners: '0;0',
    shotsOnTarget: '0;0',
    shotsOffTarget: '0;0',
    fouls: '0;0',
    yellowCards: '0;0',
    redCards: '0;0'
    // ... other stats initialized to defaults
  };
}

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.type !== 'stats_update_realtime') return;

  const matchId = msg.matchId;

  // Initialize if first update for this match
  if (!matchStats[matchId]) {
    initializeStats(matchId);
  }

  // Apply delta updates
  msg.data.changedStats.forEach(change => {
    const oldValue = matchStats[matchId][change.stat];
    matchStats[matchId][change.stat] = change.value;

    console.log(`[${matchId}] ${change.stat}: ${oldValue} → ${change.value}`);
  });

  // Now matchStats[matchId] contains the current state
  console.log('Current stats:', matchStats[matchId]);
};
```

### Example: Detecting Specific Changes

```javascript
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.type !== 'stats_update_realtime') return;

  msg.data.changedStats.forEach(change => {
    switch (change.stat) {
      case 'corners':
        const [homeCorners, awayCorners] = change.value.split(';').map(Number);
        console.log(`Corner! Home: ${homeCorners}, Away: ${awayCorners}`);
        break;

      case 'yellowCards':
        const [homeYellow, awayYellow] = change.value.split(';').map(Number);
        console.log(`Yellow card! Home: ${homeYellow}, Away: ${awayYellow}`);
        break;

      case 'redCards':
        const [homeRed, awayRed] = change.value.split(';').map(Number);
        if (homeRed > 0 || awayRed > 0) {
          console.log(`RED CARD! Home: ${homeRed}, Away: ${awayRed}`);
        }
        break;

      case 'possession':
        const [homePoss, awayPoss] = change.value.split(';').map(Number);
        console.log(`Possession update: ${homePoss}% - ${awayPoss}%`);
        break;
    }
  });
};
```

***

### Comparison: STATS vs STATS\_REALTIME

| Feature           | STATS         | STATS\_REALTIME |
| ----------------- | ------------- | --------------- |
| Update frequency  | 30-60 seconds | Real-time       |
| Data sent         | Full snapshot | Delta only      |
| Bandwidth usage   | Higher        | Lower           |
| State management  | Not required  | Required        |
| Plan availability | ULTRA, MEGA   | MEGA only       |

### Best Practices

1. **Maintain local state**: Keep a local copy of statistics and apply deltas
2. **Handle reconnections**: On reconnect, subscribe to STATS first for a full snapshot, then switch to STATS\_REALTIME
3. **Combine channels**: Use STATS for initial state and STATS\_REALTIME for updates
4. **Handle missing matches**: Initialize stats when you receive the first update for a match

### Notes

* Only changed statistics are included in each message
* An empty `changedStats` array means no changes (rare, but possible)
* For a complete snapshot, use the STATS channel
* This channel requires client-side state management


# ODDS

## ODDS Channel

The ODDS channel delivers complete odds snapshots periodically during live matches.

### Availability

| Plan  | Available |
| ----- | --------- |
| BASIC | No        |
| PRO   | No        |
| ULTRA | Yes       |
| MEGA  | Yes       |

### Update Frequency

Update frequency depends on your subscription scope:

* **`match` / `league` scope:** odds are delivered **immediately** when data changes
* **`all` scope:** odds are accumulated and delivered as a **batch every 30 seconds** (`batch_update`)

### Events

| Event         | Scope             | Description                              |
| ------------- | ----------------- | ---------------------------------------- |
| odds\_update  | `match`, `league` | Full odds snapshot (immediate)           |
| batch\_update | `all`             | Batched odds for all matches (every 30s) |

***

### odds\_update

Delivers a complete snapshot of all available betting odds.

#### Message

```json
{
  "type": "event",
  "channel": "ODDS",
  "scope": "match",
  "id": "12345",
  "eventType": "odds_update",
  "eventId": "def456",
  "ts": 1705314600000,
  "data": {
    "kickoff1x2": "2.10;3.40;3.50",
    "live1x2": "1.85;3.60;4.20",
    "starting1x2": "2.15;3.30;3.40",
    "kickoffOU": "1.90;1.90|2.5",
    "liveOU": "2.10;1.70|2.5",
    "startingOU": "1.85;1.95|2.5",
    "kickoffAH": "1.95;1.85|-0.5",
    "liveAH": "1.80;2.00|-0.5",
    "startingAH": "1.90;1.90|-0.5",
    "kickoffAsianCorners": "1.85;1.95|9.5",
    "liveAsianCorners": "1.90;1.90|9.5",
    "kickoff1hAH": "1.90;1.90|-0.25",
    "live1hAH": "1.85;1.95|-0.25",
    "kickoff1hGoals": "2.00;1.80|0.5",
    "live1hGoals": "2.20;1.65|0.5",
    "kickoff1hAsianCorners": "1.90;1.90|4.5",
    "live1hAsianCorners": "1.85;1.95|4.5",
    "kickoff1hResult": "2.50;2.20;3.00",
    "live1hResult": "2.30;2.40;3.20",
    "dropping1x2": "-0.05;+0.10;+0.15"
  }
}
```

#### Data Fields

**Full Time Markets**

| Field         | Format                  | Description                 |
| ------------- | ----------------------- | --------------------------- |
| `kickoff1x2`  | `"home;draw;away"`      | 1X2 odds at kickoff         |
| `live1x2`     | `"home;draw;away"`      | Current live 1X2 odds       |
| `starting1x2` | `"home;draw;away"`      | Opening 1X2 odds            |
| `kickoffOU`   | `"over;under\|line"`    | Over/Under at kickoff       |
| `liveOU`      | `"over;under\|line"`    | Current live Over/Under     |
| `startingOU`  | `"over;under\|line"`    | Opening Over/Under          |
| `kickoffAH`   | `"home;away\|handicap"` | Asian Handicap at kickoff   |
| `liveAH`      | `"home;away\|handicap"` | Current live Asian Handicap |
| `startingAH`  | `"home;away\|handicap"` | Opening Asian Handicap      |

**Asian Corners**

| Field                 | Format               | Description                |
| --------------------- | -------------------- | -------------------------- |
| `kickoffAsianCorners` | `"over;under\|line"` | Asian Corners at kickoff   |
| `liveAsianCorners`    | `"over;under\|line"` | Current live Asian Corners |

**First Half Markets**

| Field                   | Format                  | Description                    |
| ----------------------- | ----------------------- | ------------------------------ |
| `kickoff1hAH`           | `"home;away\|handicap"` | 1H Asian Handicap at kickoff   |
| `live1hAH`              | `"home;away\|handicap"` | Current 1H Asian Handicap      |
| `kickoff1hGoals`        | `"over;under\|line"`    | 1H Over/Under goals at kickoff |
| `live1hGoals`           | `"over;under\|line"`    | Current 1H Over/Under goals    |
| `kickoff1hAsianCorners` | `"over;under\|line"`    | 1H Asian Corners at kickoff    |
| `live1hAsianCorners`    | `"over;under\|line"`    | Current 1H Asian Corners       |
| `kickoff1hResult`       | `"home;draw;away"`      | 1H Result at kickoff           |
| `live1hResult`          | `"home;draw;away"`      | Current 1H Result              |

**Odds Movement**

| Field         | Format             | Description                  |
| ------------- | ------------------ | ---------------------------- |
| `dropping1x2` | `"home;draw;away"` | 1X2 odds change from opening |

***

### Odds Formats

#### 1X2 Format

```
"home;draw;away"
Example: "2.10;3.40;3.50"
- Home win: 2.10
- Draw: 3.40
- Away win: 3.50
```

#### Over/Under Format

```
"over;under|line"
Example: "1.90;1.90|2.5"
- Over 2.5: 1.90
- Under 2.5: 1.90
- Line: 2.5 goals
```

#### Asian Handicap Format

```
"home;away|handicap"
Example: "1.95;1.85|-0.5"
- Home -0.5: 1.95
- Away +0.5: 1.85
- Handicap: -0.5 for home team
```

#### Dropping Odds Format

```
"home;draw;away"
Example: "-0.05;+0.10;+0.15"
- Home: decreased by 0.05
- Draw: increased by 0.10
- Away: increased by 0.15
```

***

### batch\_update

Delivers a batch of odds snapshots for all live matches. Sent every 30 seconds to `all` scope subscribers only.

#### Message

```json
{
  "type": "batch_update",
  "channel": "ODDS",
  "scope": "all",
  "timestamp": 1705314600000,
  "matches": [
    {
      "matchId": "12345",
      "leagueId": "67890",
      "data": {
        "kickoff1x2": "2.10;3.40;3.50",
        "live1x2": "1.85;3.60;4.20",
        "liveOU": "2.10;1.70|2.5",
        "..."
      }
    },
    {
      "matchId": "12346",
      "leagueId": "67890",
      "data": {
        "kickoff1x2": "1.75;3.80;4.50",
        "live1x2": "1.60;4.00;5.00",
        "liveOU": "1.95;1.85|2.5",
        "..."
      }
    }
  ]
}
```

#### Fields

| Field                | Type    | Description                                         |
| -------------------- | ------- | --------------------------------------------------- |
| `type`               | string  | Always `"batch_update"`                             |
| `channel`            | string  | Always `"ODDS"`                                     |
| `scope`              | string  | Always `"all"`                                      |
| `timestamp`          | integer | Batch creation timestamp in milliseconds            |
| `matches`            | array   | Array of match updates accumulated since last batch |
| `matches[].matchId`  | string  | Match public ID                                     |
| `matches[].leagueId` | string  | League/Championship public ID                       |
| `matches[].data`     | object  | Odds snapshot (same fields as `odds_update` data)   |

> **Note:** If a match has multiple updates within a 30-second window, only the latest data for that `matchId` is included in the batch.

***

### Subscription Examples

#### Subscribe to all odds updates

```json
{"action": "subscribe", "channel": "ODDS", "scope": "all"}
```

#### Subscribe to a specific match

```json
{"action": "subscribe", "channel": "ODDS", "scope": "match", "id": "b01d28ac92221034"}
```

#### Subscribe to a league

```json
{"action": "subscribe", "channel": "ODDS", "scope": "league", "id": "f2b16fa54cb525d"}
```

***

### Example: Processing Odds

```javascript
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.type !== 'odds_update') return;

  const odds = msg.data;

  // Parse 1X2 odds
  if (odds.live1x2) {
    const [home, draw, away] = odds.live1x2.split(';').map(parseFloat);
    console.log(`1X2: Home ${home} | Draw ${draw} | Away ${away}`);
  }

  // Parse Over/Under
  if (odds.liveOU) {
    const [values, line] = odds.liveOU.split('|');
    const [over, under] = values.split(';').map(parseFloat);
    console.log(`O/U ${line}: Over ${over} | Under ${under}`);
  }

  // Parse Asian Handicap
  if (odds.liveAH) {
    const [values, handicap] = odds.liveAH.split('|');
    const [home, away] = values.split(';').map(parseFloat);
    console.log(`AH ${handicap}: Home ${home} | Away ${away}`);
  }
};
```

### Example: Detecting Odds Movement

```javascript
function parseDropping(dropping1x2) {
  if (!dropping1x2) return null;

  const [home, draw, away] = dropping1x2.split(';').map(parseFloat);

  return {
    home: { value: home, direction: home < 0 ? 'down' : 'up' },
    draw: { value: draw, direction: draw < 0 ? 'down' : 'up' },
    away: { value: away, direction: away < 0 ? 'down' : 'up' }
  };
}

// Usage
const movement = parseDropping(odds.dropping1x2);
if (movement.home.direction === 'down') {
  console.log(`Home odds dropping by ${Math.abs(movement.home.value)}`);
}
```

***

### Notes

* Odds are only sent while the match is live
* Null values indicate the market is not available
* The snapshot includes ALL available markets, not just changed values
* For real-time delta updates, use the ODDS\_REALTIME channel (MEGA plan only)
* Odds are in decimal (European) format


# ODDS REALTIME

## ODDS\_REALTIME Channel

The ODDS\_REALTIME channel delivers only the odds that have changed, in real-time.

### Availability

| Plan  | Available |
| ----- | --------- |
| BASIC | No        |
| PRO   | No        |
| ULTRA | No        |
| MEGA  | Yes       |

### Update Frequency

Updates are sent **immediately** when odds change (real-time).

### Events

| Event                  | Description       |
| ---------------------- | ----------------- |
| odds\_update\_realtime | Changed odds only |

***

### odds\_update\_realtime

Delivers only the odds that have changed since the last update.

#### Message

```json
{
  "type": "odds_update_realtime",
  "channel": "ODDS_REALTIME",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705314600000,
  "data": {
    "changedOdds": [
      {
        "market": "live1x2",
        "value": "1.75;3.80;4.50"
      },
      {
        "market": "liveOU",
        "value": "2.20;1.65|2.5"
      }
    ]
  }
}
```

#### Data Fields

| Field                  | Type   | Description           |
| ---------------------- | ------ | --------------------- |
| `changedOdds`          | array  | Array of changed odds |
| `changedOdds[].market` | string | Market name           |
| `changedOdds[].value`  | string | New odds value        |

#### Available Markets

| Market Name             | Format                  | Description                 |
| ----------------------- | ----------------------- | --------------------------- |
| `kickoff1x2`            | `"home;draw;away"`      | 1X2 at kickoff              |
| `live1x2`               | `"home;draw;away"`      | Live 1X2                    |
| `starting1x2`           | `"home;draw;away"`      | Opening 1X2                 |
| `kickoffOU`             | `"over;under\|line"`    | O/U at kickoff              |
| `liveOU`                | `"over;under\|line"`    | Live O/U                    |
| `startingOU`            | `"over;under\|line"`    | Opening O/U                 |
| `kickoffAH`             | `"home;away\|handicap"` | AH at kickoff               |
| `liveAH`                | `"home;away\|handicap"` | Live AH                     |
| `startingAH`            | `"home;away\|handicap"` | Opening AH                  |
| `kickoffAsianCorners`   | `"over;under\|line"`    | Asian Corners at kickoff    |
| `liveAsianCorners`      | `"over;under\|line"`    | Live Asian Corners          |
| `kickoff1hAH`           | `"home;away\|handicap"` | 1H AH at kickoff            |
| `live1hAH`              | `"home;away\|handicap"` | Live 1H AH                  |
| `kickoff1hGoals`        | `"over;under\|line"`    | 1H O/U at kickoff           |
| `live1hGoals`           | `"over;under\|line"`    | Live 1H O/U                 |
| `kickoff1hAsianCorners` | `"over;under\|line"`    | 1H Asian Corners at kickoff |
| `live1hAsianCorners`    | `"over;under\|line"`    | Live 1H Asian Corners       |
| `kickoff1hResult`       | `"home;draw;away"`      | 1H Result at kickoff        |
| `live1hResult`          | `"home;draw;away"`      | Live 1H Result              |
| `dropping1x2`           | `"home;draw;away"`      | 1X2 odds change             |

***

### Subscription Examples

#### Subscribe to all real-time odds updates

NO scope "all" allowed

#### Subscribe to a specific match

```json
{"action": "subscribe", "channel": "ODDS_REALTIME", "scope": "match", "id": "b01d28ac92221034"}
```

#### Subscribe to a league

```json
{"action": "subscribe", "channel": "ODDS_REALTIME", "scope": "league", "id": "f2b16fa54cb525d"}
```

***

### Example: Maintaining Local State

```javascript
// Local state for match odds
const matchOdds = {};

function initializeOdds(matchId) {
  matchOdds[matchId] = {
    live1x2: null,
    liveOU: null,
    liveAH: null,
    liveAsianCorners: null,
    live1hAH: null,
    live1hGoals: null
    // ... other markets initialized to null
  };
}

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.type !== 'odds_update_realtime') return;

  const matchId = msg.matchId;

  // Initialize if first update for this match
  if (!matchOdds[matchId]) {
    initializeOdds(matchId);
  }

  // Apply delta updates
  msg.data.changedOdds.forEach(change => {
    const oldValue = matchOdds[matchId][change.market];
    matchOdds[matchId][change.market] = change.value;

    console.log(`[${matchId}] ${change.market}: ${oldValue} → ${change.value}`);
  });

  // Now matchOdds[matchId] contains the current state
  console.log('Current odds:', matchOdds[matchId]);
};
```

### Example: Tracking 1X2 Movement

```javascript
const oddsHistory = {};

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.type !== 'odds_update_realtime') return;

  msg.data.changedOdds.forEach(change => {
    if (change.market === 'live1x2') {
      const matchId = msg.matchId;
      const [home, draw, away] = change.value.split(';').map(parseFloat);

      // Initialize history
      if (!oddsHistory[matchId]) {
        oddsHistory[matchId] = [];
      }

      // Record change with timestamp
      const lastEntry = oddsHistory[matchId][oddsHistory[matchId].length - 1];
      oddsHistory[matchId].push({
        ts: msg.ts,
        home,
        draw,
        away,
        homeChange: lastEntry ? (home - lastEntry.home).toFixed(2) : 0,
        awayChange: lastEntry ? (away - lastEntry.away).toFixed(2) : 0
      });

      // Detect significant movement
      if (lastEntry) {
        const homeMove = home - lastEntry.home;
        const awayMove = away - lastEntry.away;

        if (homeMove < -0.10) {
          console.log(`ALERT: Home odds dropping significantly (${homeMove.toFixed(2)})`);
        }
        if (awayMove < -0.10) {
          console.log(`ALERT: Away odds dropping significantly (${awayMove.toFixed(2)})`);
        }
      }
    }
  });
};
```

### Example: Real-time Odds Display

```javascript
function parse1x2(value) {
  if (!value) return { home: '-', draw: '-', away: '-' };
  const [home, draw, away] = value.split(';');
  return { home, draw, away };
}

function parseOU(value) {
  if (!value) return { over: '-', under: '-', line: '-' };
  const [odds, line] = value.split('|');
  const [over, under] = odds.split(';');
  return { over, under, line };
}

function parseAH(value) {
  if (!value) return { home: '-', away: '-', handicap: '-' };
  const [odds, handicap] = value.split('|');
  const [home, away] = odds.split(';');
  return { home, away, handicap };
}

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.type !== 'odds_update_realtime') return;

  msg.data.changedOdds.forEach(change => {
    switch (change.market) {
      case 'live1x2':
        const m1x2 = parse1x2(change.value);
        console.log(`1X2: ${m1x2.home} | ${m1x2.draw} | ${m1x2.away}`);
        break;

      case 'liveOU':
        const ou = parseOU(change.value);
        console.log(`O/U ${ou.line}: Over ${ou.over} | Under ${ou.under}`);
        break;

      case 'liveAH':
        const ah = parseAH(change.value);
        console.log(`AH (${ah.handicap}): ${ah.home} | ${ah.away}`);
        break;
    }
  });
};
```

***

### Comparison: ODDS vs ODDS\_REALTIME

| Feature           | ODDS          | ODDS\_REALTIME |
| ----------------- | ------------- | -------------- |
| Update frequency  | 15-30 seconds | Real-time      |
| Data sent         | Full snapshot | Delta only     |
| Bandwidth usage   | Higher        | Lower          |
| State management  | Not required  | Required       |
| Plan availability | ULTRA, MEGA   | MEGA only      |

### Best Practices

1. **Maintain local state**: Keep a local copy of odds and apply deltas
2. **Handle reconnections**: On reconnect, subscribe to ODDS first for a full snapshot, then switch to ODDS\_REALTIME
3. **Combine channels**: Use ODDS for initial state and ODDS\_REALTIME for updates
4. **Track history**: Store odds history if you need to analyze movement patterns
5. **Handle null values**: Some markets may not be available for all matches

### Notes

* Only changed markets are included in each message
* An empty `changedOdds` array means no changes (rare, but possible)
* For a complete snapshot, use the ODDS channel
* This channel requires client-side state management
* Odds changes can be frequent during live matches, especially near key events


# Code example

{% tabs %}
{% tab title="Javascript" %}

```javascript
class SoccerWebSocket {
  constructor(wsToken) {
    this.wsToken = wsToken;
    this.ws = null;
    this.subscriptions = new Set();
  }

  connect() {
    this.ws = new WebSocket(`wss://ws.soccerfootball.info/?token=${this.wsToken}`);

    this.ws.onopen = () => {
      console.log('Connected to Soccer Football WebSocket');
      // Resubscribe if reconnecting
      this.subscriptions.forEach(sub => {
        this.subscribe(sub.channel, sub.scope);
      });
    };

    this.ws.onmessage = (event) => {
      const message = JSON.parse(event.data);
      this.handleMessage(message);
    };

    this.ws.onclose = (event) => {
      console.log(`Connection closed: ${event.code} - ${event.reason}`);
      if (event.code !== 1000) {
        // Attempt reconnection after 5 seconds
        setTimeout(() => this.connect(), 5000);
      }
    };

    this.ws.onerror = (error) => {
      console.error('WebSocket error:', error);
    };
  }

  subscribe(channel, scope) {
    const message = {
      action: 'subscribe',
      channel: channel,
      scope: scope
    };
    this.ws.send(JSON.stringify(message));
    this.subscriptions.add({ channel, scope });
  }

  unsubscribe(channel, scope) {
    const message = {
      action: 'unsubscribe',
      channel: channel,
      scope: scope
    };
    this.ws.send(JSON.stringify(message));
    this.subscriptions.delete({ channel, scope });
  }

  ping() {
    this.ws.send(JSON.stringify({ action: 'ping' }));
  }

  handleMessage(message) {
    switch (message.type) {
      case 'match_start':
        console.log('Match started:', message.data);
        break;
      case 'goal':
        console.log('Goal!', message.data);
        break;
      case 'halftime':
        console.log('Halftime:', message.data);
        break;
      case 'match_end':
        console.log('Match ended:', message.data);
        break;
      case 'stats_update':
        console.log('Stats update:', message.data);
        break;
      case 'odds_update':
        console.log('Odds update:', message.data);
        break;
      case 'pong':
        console.log('Pong received');
        break;
      case 'subscribed':
        console.log('Subscribed to:', message.channel);
        break;
      case 'error':
        console.error('Error:', message.message);
        break;
    }
  }

  disconnect() {
    if (this.ws) {
      this.ws.close(1000, 'Client disconnect');
    }
  }
}

// Usage
const client = new SoccerWebSocket('your-websocket-token');
client.connect();

// Subscribe to all MAIN events
client.subscribe('MAIN', 'all');

// Subscribe to a specific match
client.subscribe('STATS', 'match:12345');

// Subscribe to a specific league
client.subscribe('ODDS', 'league:67890');

// Keep connection alive
setInterval(() => client.ping(), 30000);
```

{% endtab %}

{% tab title="Python" %}

```python
import asyncio
import websockets
import json

class SoccerWebSocket:
    def __init__(self, ws_token):
        self.ws_token = ws_token
        self.ws = None
        self.subscriptions = set()

    async def connect(self):
        uri = f"wss://ws.soccerfootball.info/?token={self.ws_token}"

        async with websockets.connect(uri) as websocket:
            self.ws = websocket
            print("Connected to Soccer Football WebSocket")

            # Start message handler
            await self.handle_messages()

    async def handle_messages(self):
        async for message in self.ws:
            data = json.loads(message)
            await self.process_message(data)

    async def process_message(self, message):
        msg_type = message.get('type')

        if msg_type == 'match_start':
            print(f"Match started: {message.get('data')}")
        elif msg_type == 'goal':
            print(f"Goal! {message.get('data')}")
        elif msg_type == 'halftime':
            print(f"Halftime: {message.get('data')}")
        elif msg_type == 'match_end':
            print(f"Match ended: {message.get('data')}")
        elif msg_type == 'stats_update':
            print(f"Stats update: {message.get('data')}")
        elif msg_type == 'odds_update':
            print(f"Odds update: {message.get('data')}")
        elif msg_type == 'pong':
            print("Pong received")
        elif msg_type == 'subscribed':
            print(f"Subscribed to: {message.get('channel')}")
        elif msg_type == 'error':
            print(f"Error: {message.get('message')}")

    async def subscribe(self, channel, scope):
        message = {
            "action": "subscribe",
            "channel": channel,
            "scope": scope
        }
        await self.ws.send(json.dumps(message))
        self.subscriptions.add((channel, scope))

    async def unsubscribe(self, channel, scope):
        message = {
            "action": "unsubscribe",
            "channel": channel,
            "scope": scope
        }
        await self.ws.send(json.dumps(message))
        self.subscriptions.discard((channel, scope))

    async def ping(self):
        await self.ws.send(json.dumps({"action": "ping"}))

# Usage
async def main():
    client = SoccerWebSocket("your-websocket-token")

    async with websockets.connect(
        f"wss://ws.soccerfootball.info/?token={client.ws_token}"
    ) as ws:
        client.ws = ws

        # Subscribe to channels
        await client.subscribe("MAIN", "all")
        await client.subscribe("STATS", "match:12345")

        # Handle messages
        async for message in ws:
            data = json.loads(message)
            await client.process_message(data)

if __name__ == "__main__":
    asyncio.run(main())
```

{% endtab %}
{% endtabs %}

## Best Practices

1. **Handle reconnections**: Implement automatic reconnection with exponential backoff
2. **Renew tokens proactively**: Renew tokens 5 minutes before expiration
3. **Use ping/pong**: Send ping every 30 seconds to detect connection issues
4. **Limit subscriptions**: Only subscribe to channels and scopes you need
5. **Process messages quickly**: Don't block the message handler with heavy operations


# Errors

There is some possibile errors:

## #404

*Not Found error*. The endpoint is missing or element not found

```javascript
{
	"status": 404,
	"errors": [
		{
			"code" : 6,
			"message" : "Not Found"
		}
	],
  	"pagination": [],
  	"result": []
}
```

## #400

*Bad Request.* Missing some variable in endpoint. Only one error at time

```javascript
{
	"status": 400,
	"errors": [
		{
			"code" : 1,
			"message" : "Missing XXX param"
		},
		{
			"code" : 7,
			"message" : "Wrong XXX param"
		}
	],
  	"pagination": [],
  	"result": []
}
```

## #401

*Unauthorized.* Your token don't have enough of privileges to access at this endpoint or is suspended/invalid

```javascript
{
	"status": 401,
	"errors": [
		{
			"code" : 2,
			"message" : "Token is invalid"
		},
		{
			"code" : 3,
			"message" : "Token is suspended"
		},
		{
			"code" : 4,
			"message" : "Token does not have permission"
		},
		{
			"code" : 5,
			"message" : "Token IP is invalid"
		}
	],
  	"pagination": [],
  	"result": []
}
```

## #429

*Too many requests.* Your token do too many requests due your plan limitation. Need to wait next hour

```javascript
{
	"status": 429,
	"errors": [
		{
			"code" : 7,
			"message" : "Too many requests"
		}
	],
  	"pagination": [],
  	"result": []
}
```


