# Make your first request

It's time to make your first API request. Maybe you've missed it, but we've explained how our API works on our [**Getting Started page**](/v2/get-started/get-started.md). For your convenience, we've copied the content on this page as well. Already followed all these steps? Then let's get started by setting your own time zone.

{% content-ref url="/pages/-MJXRO-ySDEZtMQltiyh" %}
[Getting Started](/v2/get-started/get-started.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MJXO8HQTOF7KL9HBJ4F" %}
[Set your time zone](/v2/tutorials/the-basics/time-zone.md)
{% endcontent-ref %}

## Authentication

To make our first request, we’ll need a way to get authenticated first.\
\
Football API 2.0 utilizes API tokens for the authentication of requests. You can obtain your free API token and manage your API tokens [**Mysportmonks.**](https://my.sportmonks.com/)\
\
For the sake of simplicity, we’ll be working with an API token from the free plan. The free plan only has the **Danish Superliga (league id: 271)** and the **Scottish Premiership (league id: 501)** included.

Example API token: \[HdoiD312ND….]

The API token is only meant for your eyes and, as such, should be stored away safely.

Our tokens have no expiration date and will remain valid until you manually delete them yourself.\
\
Football API 2.0 utilizes response codes to indicate successful and failed API requests.\
\
When making a request, a code response will always be returned. See below for a shortlist of possible code responses:

| Code number | Description                                                                         |
| ----------- | ----------------------------------------------------------------------------------- |
| `200`       | **Successful request and data was returned**                                        |
| `400`       | **Part of the request is malformed; the exact reason can be found in the response** |
| `401`       | **Request is not authenticated**                                                    |
| `403`       | **Unauthorized request to access data from an ineligible plan**                     |
| `429`       | **You have reached the response rate limit of your plan**                           |
| `500`       | **Internal error with our servers**                                                 |

\
With our token in hand, we can finally make the first request!

## Your first request

Now that all prerequisites have been fulfilled, we’re ready to send our first request to the API!

### Build the request

The request consists of the following components:

* The base URL
* A path parameter, in this example, we use \[leagues]
* A query string parameter, this is optional, so we leave this out for now
* And finally, your API token

{% tabs %}
{% tab title="Base URL" %}

```javascript
https://soccer.sportmonks.com/api/v2.0/
```

{% endtab %}
{% endtabs %}

An example of a correctly authenticated request would be:

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

```javascript
https://soccer.sportmonks.com/api/v2.0/leagues?api_token={API_TOKEN}
```

{% endtab %}

{% tab title="Response" %}

```javascript
"data": [
        {
            "id": 271,
            "active": true,
            "type": "domestic",
            "legacy_id": 43,
            "country_id": 320,
            "logo_path": "https://cdn.sportmonks.com/images/soccer/leagues/271.png",
            "name": "Superliga",
            "is_cup": false,
            "current_season_id": 17328,
            "current_round_id": 199450,
            "current_stage_id": 77447994,
            "live_standings": true,
            "coverage": {
                "predictions": true,
                "topscorer_goals": true,
                "topscorer_assists": true,
                "topscorer_cards": true
            }
```

{% endtab %}

{% tab title="Field description" %}

| Field                | Description                                                                                                                                                                  |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data`               | Opens an array of data you've requested                                                                                                                                      |
| `id`                 | A unique league id                                                                                                                                                           |
| `active`             | Indicates if the league is active or not. Possible values are 'true' or 'false'                                                                                              |
| `type`               | Indicates what kind of league this is. Possible values: 'domestic', 'cup', 'international'. More values can be found [here](/v2/api-references/statussus-and-definitions.md) |
| `legacy_id`          | This was for our API version 1.0. It's only of use for old users of our API                                                                                                  |
| `country_id`         | The unique country id the league is played in                                                                                                                                |
| `logo_path`          | The logo URL path of the league                                                                                                                                              |
| `name`               | The name of the league                                                                                                                                                       |
| `is_cup`             | Indicates if the league is a cup or not. Possible values are 'true' or 'false'                                                                                               |
| `current_season_id`  | The unique id of the current season                                                                                                                                          |
| `current_round_id`   | The unique id of the current round                                                                                                                                           |
| `current_stage_id`   | The unique id of the current stage                                                                                                                                           |
| `live_standings`     | Indicates if the league covers live standings                                                                                                                                |
| `coverage`           | Opens an array of partial coverage for the league                                                                                                                            |
| `predictions`        | Indicates if the league covers predictions                                                                                                                                   |
| `topscorers_goals`   | Indicates if the league covers goal topscorers                                                                                                                               |
| `topscorers_assists` | Indicates if the league covers assists topscorers                                                                                                                            |
| `topscorers_cards`   | Indicates if the league covers cards topscorers                                                                                                                              |
| {% endtab %}         |                                                                                                                                                                              |
| {% endtabs %}        |                                                                                                                                                                              |

This request will return all of the leagues eligible for our free plan, which are the **Danish Superliga (league id: 271)** and the **Scottish Premiership (league id: 501)**. You can view them by clicking on the second tab.&#x20;

## What can you do with the data?

The above example was the most basic of basic requests and our advanced and highly flexible football API 2.0 can handle much more than that.&#x20;

With the data that[ **our API**](https://sportmonks.com/football-api/) provides you, you too will be able to create excellent applications. Below are two examples of SportMonks’ partners who have made brilliant applications. Throughout all our documentation pages you will find more examples, ranging from betting and odds websites to fantasy games and live score tracking websites.

![](/files/-MPKPzlVxvBAnYYs_K5U)

![](/files/-MPKPsxnewc4xHN3cMd7)

## **Code libraries**

There are various options as to how you’d like to send the request. Our API is compatible with an incredible number of developer languages

![](/files/-MJWo-vO6Q1-DLn95k6V)

##


---

# 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://docs.sportmonks.com/v2/tutorials/the-basics/make-your-first-request.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.
