# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://info.soccerfootball.info/v1/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
