# 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="<https://1849281761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MO7VPtH3yGUfnmbVIHd%2Fuploads%2F289e6TUQHD5HA6cyKgpP%2Fezgif-7-b4ccf70f18.gif?alt=media&token=80d7c09f-2a23-48cd-baeb-8aa29dcf4695>" %}

## 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-)
