# 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="<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/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)
