# Overview

This page contains details for developers planing to use the Football Prediction API.

Football Prediction API is a REST API that offers predictions for upcoming football (soccer) matches.


# Setup

## Setup

#### Using Rapidapi.com

1. Log into your rapidapi.com account
2. Check the details for our [subscription plans](https://rapidapi.com/boggio-analytics/api/football-prediction/pricing) and click subscribe.
3. Go to the [endpoint documentation](https://rapidapi.com/boggio-analytics/api/football-prediction) page and click *Test Endpoint*
4. Click the panel on the left to change the request snippet to the technology you are familiar with.
5. Copy the example and run it in your favorite programming environment.

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LSzZRUTH-PoFP-uXwyY%2F-LSzbKvcG8wiQbvm3hWd%2Frapidapi.png?alt=media\&token=e908d749-8fff-44be-813b-dc767b304391)


# Making a first API call

After completing the [setup guide](/getting-started/setup#setup), you should verify that you are able to make a successful request.

{% hint style="success" %}
Use the **List available markets** endpoint to verify the markets you have access to based on your subscription type.
{% endhint %}

#### Test Request via Rapidapi

```javascript
curl --get --include 'https://football-prediction-api.p.rapidapi.com/api/v2/list-markets' \
  -H 'X-RapidAPI-Key: SIGN-UP-FOR-KEY'
```

A good request would return a HTTP Status code of **200** and a **JSON** response looking similar to the one bellow

```javascript
{
  "data": {
    "allowed_for_your_subscription": [
      "home_over_05",
      "btts",
      "over_35",
      "classic",
      "home_over_15",
      "over_25",
      "away_over_15",
      "away_over_05"
    ],
    "all": [
      "home_over_05",
      "btts",
      "over_35",
      "classic",
      "home_over_15",
      "over_25",
      "away_over_15",
      "away_over_05"
    ]
  }
}
```

The example above shows that all prediction markets can be accessed . (all markets listed in *allowed\_for\_your\_subscription*)

The market is a optional parameter that can be specified when requesting predictions.

## Available prediction markets

| Market           | Description                                                                         | Default |
| ---------------- | ----------------------------------------------------------------------------------- | ------- |
| *classic*        | Predictions for final match result (1 - home victory / X - draw / 2 - away victory) | Yes     |
| *over\_25*       | Predicts whether there will be more than 2.5 goals scored (yes / no)                | No      |
| *over\_35*       | Predicts whether there will be more than 3.5 goals scored (yes / no)                | No      |
| *btts*           | Predicts whether  both teams will score ( yes / no )                                | No      |
| *home\_over\_05* | Predicts whether the home team will score more than 0.5 goals (yes / no)            | No      |
| *home\_over\_15* | Predicts whether the home team will score more than 1.5 goals (yes / no)            | No      |
| *away\_over\_05* | Predicts whether the away team will score more than 0.5 goals (yes / no)            | No      |
| *away\_over\_15* | Predicts whether the away team will score more than 1.5 goals (yes / no)            | No      |


# API Endpoints

This endpoint returns by default the next non-expired football predictions.Parameters can be specified to filter by date, by federation, by prediction market

{% hint style="danger" %}
All requests must contain a valid authentication key in the headers.

***X-RapidAPI-Key***
{% endhint %}

## Predictions

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/predictions`

This endpoint returns a list of the football predictions scheduled to start in the next 48 hours. \
The default argument for market is "classic", which shows 1X2 predictions. \
Optional parameters can be specified to show past predictions (by providing `iso_date` in the past) or to filter by federation.<br>

#### Query Parameters

| Name       | Type   | Description                                                                                                                                                                                                      |
| ---------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| iso\_date  | string | <p>Date  in <strong>YYYY-MM-DD</strong> format  <br>Day starts at 00:00 London Timezone<br>If not provided returns next predictions for matches about to start in (12h/36h/48h - based on subscription type)</p> |
| market     | string | Check the table below for the accepted values and how it affects the response.                                                                                                                                   |
| federation | string | Football association, for accepted values check the **/api/v2/list-federations**                                                                                                                                 |

#### Headers

| Name           | Type   | Description                            |
| -------------- | ------ | -------------------------------------- |
| X-RapidAPI-Key | string | Provide this header for authentication |

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

```javascript
{
  "data": [
    {
      "id": 40838,
      "start_date": "2018-12-06T19:00:00",
      "season": "2018 - 2019",
      "status": "pending",
      "home_team": "Feyenoord",
      "prediction": "1",
      "probabilities": {
        "X2": 0.458,
        "2": 0.163,
        "1X": 0.837,
        "1": 0.542,
        "12": 0.704,
        "X": 0.296
      },
      "is_expired": false,
      "distance_between_teams": 131,
      "away_strength": 0.524973751312434,
      "federation": "UEFA",
      "market": "classic",
      "odds": {
        "X2": 4.03,
        "2": 12.205,
        "1X": 1.04,
        "1": 1.217,
        "12": 1.1,
        "X": 6.168
      },
      "competition_name": "Eredivisie",
      "field_length": 105,
      "stadium_capacity": 51117,
      "last_update_at": "2018-12-04T20:11:57.506000",
      "home_strength": 2.31326526289031,
      "field_width": 68,
      "away_team": "VVV-Venlo",
      "result": "",
      "competition_cluster": "Netherlands"
    },
    ...
}
```

{% endtab %}

{% tab title="404 When an invalid request is made the response will return an errors field with the query parameter that causes the error and the message.
" %}

```javascript
{
  "data": [],
  "errors": {
    "iso_date": "Date is 76 hours away. Your subscription allows seeing predictions up to 48 hours ahead."
  }
}
```

{% endtab %}
{% endtabs %}

| Market           | Description                                                                         | Default |
| ---------------- | ----------------------------------------------------------------------------------- | ------- |
| *classic*        | Predictions for final match result (1 - home victory / X - draw / 2 - away victory) | Yes     |
| *over\_25*       | Predicts whether there will be more than 2.5 goals scored (yes / no)                | No      |
| *over\_35*       | Predicts whether there will be more than 3.5 goals scored (yes / no)                | No      |
| *btts*           | Predicts whether  both teams will score ( yes / no )                                | No      |
| *home\_over\_05* | Predicts whether the home team will score more than 0.5 goals (yes / no)            | No      |
| *home\_over\_15* | Predicts whether the home team will score more than 1.5 goals (yes / no)            | No      |
| *away\_over\_05* | Predicts whether the away team will score more than 0.5 goals (yes / no)            | No      |
| *away\_over\_15* | Predicts whether the away team will score more than 1.5 goals (yes / no)            | No      |

## Prediction Details

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/predictions/:id`

Given a match`id` will grab all the predictions (all markets) for that single event.\
Useful when you want to see all predictions for a single game.\
Matches will have at least 1 prediction in the classic market and up to 8.\
Recommendation: use the prediction endpoint with the classic market to get a list of ids.

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | number | Fixture ID  |

#### Headers

| Name           | Type   | Description                            |
| -------------- | ------ | -------------------------------------- |
| X-RapidAPI-Key | string | Provide this header for authentication |

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

```javascript
{
  "data": [
    {
      "competition_name": "Eredivisie",
      "distance_between_teams": 131,
      "id": 40838,
      "competition_cluster": "Netherlands",
      "stadium_capacity": 51117,
      "start_date": "2018-12-06T19:00:00",
      "field_length": 105,
      "home_strength": 2.31326526289031,
      "available_markets": [
        "btts",
        "over_25",
        "away_over_15",
        "home_over_15",
        "classic",
        "home_over_05"
      ],
      "field_width": 68,
      "away_team": "VVV-Venlo",
      "season": "2018 - 2019",
      "last_update_at": "2018-12-04T20:11:57.506000",
      "result": "",
      "away_strength": 0.524973751312434,
      "federation": "UEFA",
      "home_team": "Feyenoord",
      "is_expired": false,
      "prediction_per_market": {
        "home_over_05": {
          "prediction": "yes",
          "status": "pending",
          "odds": {
            "no": null,
            "yes": null
          },
          "probabilities": {
            "no": 0.248,
            "yes": 0.752
          }
        },
        "away_over_15": {
          "prediction": "no",
          "status": "pending",
          "odds": {
            "no": null,
            "yes": null
          },
          "probabilities": {
            "no": 0.706,
            "yes": 0.294
          }
        },
        "over_25": {
          "prediction": "yes",
          "status": "pending",
          "odds": {
            "no": 2.497,
            "yes": 1.493
          },
          "probabilities": {
            "no": 0.377,
            "yes": 0.623
          }
        },
        "btts": {
          "prediction": "no",
          "status": "pending",
          "odds": {
            "no": 1.708,
            "yes": 2.047
          },
          "probabilities": {
            "no": 0.547,
            "yes": 0.453
          }
        },
        "home_over_15": {
          "prediction": "yes",
          "status": "pending",
          "odds": {
            "no": null,
            "yes": null
          },
          "probabilities": {
            "no": 0.238,
            "yes": 0.762
          }
        },
        "classic": {
          "prediction": "1",
          "status": "pending",
          "odds": {
            "X2": 4.03,
            "2": 12.205,
            "1X": 1.04,
            "1": 1.217,
            "12": 1.1,
            "X": 6.168
          },
          "probabilities": {
            "X2": 0.458,
            "2": 0.163,
            "1X": 0.837,
            "1": 0.542,
            "12": 0.704,
            "X": 0.296
          }
        }
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Performance stats (accuracy)

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/performance-stats`

This endpoint returns information about the accuracy of the past predictions. (in the last day, 7 days, 14 days and 30 days)\
Can be additionally filtered by federation and market.\
If no market filter is provided it defaults to **classic**

#### Query Parameters

| Name       | Type   | Description                                                                                |
| ---------- | ------ | ------------------------------------------------------------------------------------------ |
| federation | string | Football association, for accepted values check the /api/v2/list-federations the response. |
| market     | string | Check the table above for the accepted values and how it affects the response.             |

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

```javascript
{
  "data": {
    "market": "classic",
    "accuracy": {
      "last_30_days": 0.6819056785370549,
      "last_14_days": 0.6704653371320038,
      "yesterday": 0.78125,
      "last_7_days": 0.6799242424242424
    },
    "details": {
      "last_30_days": {
        "pending": 0,
        "lost": 661,
        "postponed": 26,
        "won": 1417,
        "total": 2104
      },
      "last_14_days": {
        "pending": 0,
        "lost": 347,
        "postponed": 14,
        "won": 706,
        "total": 1067
      },
      "yesterday": {
        "pending": 0,
        "lost": 7,
        "postponed": 0,
        "won": 25,
        "total": 32
      },
      "last_7_days": {
        "pending": 0,
        "lost": 169,
        "postponed": 7,
        "won": 359,
        "total": 535
      }
    }
  }
}

```

{% endtab %}
{% endtabs %}

## List Federations

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/list-federations`

Returns a list of the supported federations.\
Takes no parameter.

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

```javascript
{
  "data": [
    "UEFA",
    "AFC",
    "CAF",
    "CONCACAF",
    "OFC",
    "CONMEBOL"
  ]
}

```

{% endtab %}
{% endtabs %}

## List Markets

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/list-markets`

List all available markets and the ones that are enabled for your subscription plan.

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

```javascript
{
  "data": {
    "all": [
      "over_35",
      "away_over_15",
      "home_over_15",
      "classic",
      "home_over_05",
      "over_25",
      "away_over_05",
      "btts"
    ],
    "allowed_for_your_subscription": [
      "over_35",
      "away_over_15",
      "home_over_15",
      "classic",
      "home_over_05",
      "over_25",
      "away_over_05",
      "btts"
    ]
  }
}

```

{% endtab %}
{% endtabs %}

## League stats for home team

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/home-league-stats/:id`

Given a match`id` will grab the league stats for the team playing at home.\
**Does** **not** **support past results only upcoming matches** (with the start\_date in the future)

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | Fixture ID  |

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

```javascript
{
  "data": {
    "points_as_home_team": 13,
    "goals_scored": 26,
    "matches_played": 16,
    "won": 8,
    "lost": 5,
    "goals_scored_as_home_team": 15,
    "goals_conceived_as_home_team": 7,
    "matches_played_as_home_team": 7,
    "points": 27,
    "lost_as_home_team": 2,
    "won_as_home_team": 4,
    "draw_as_home_team": 1,
    "goals_conceived": 18,
    "team": "Real Sociedad",
    "draw": 3
  }
}
```

{% endtab %}
{% endtabs %}

## Head to Head&#x20;

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/head-to-head/:id`

Shows head to head stats and previous encounters for the home and away team of an upcoming match.

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | number | Fixture ID  |

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

```javascript
{
  "data": {
    "stats": {
      "overall": {
        "num_encounters": 10,
        "over_05": 10,
        "total_goals": 33,
        "over_35": 4,
        "over_25": 6,
        "both_teams_scored": 6,
        "over_15": 7,
        "avg_goals_per_match": 3.3
      },
      "away_team": {
        "goals_scored": 23,
        "team_name": "Barcelona",
        "clean_sheet": 3,
        "won": 8,
        "lost": 1,
        "first_half_draw": 2,
        "avg_goals_scored": 2.3,
        "avg_bookie_draw_chance": 0.161,
        "avg_bookie_lose_chance": 0.098,
        "avg_goals_conceived": 1,
        "first_half_lost": 3,
        "first_half_win": 5,
        "avg_bookie_win_chance": 0.751,
        "goals_conceived": 10,
        "draw": 1
      },
      "home_team": {
        "goals_scored": 10,
        "team_name": "Real Sociedad",
        "clean_sheet": 1,
        "won": 1,
        "lost": 8,
        "first_half_draw": 2,
        "avg_goals_scored": 1,
        "avg_bookie_draw_chance": 0.161,
        "avg_bookie_lose_chance": 0.751,
        "avg_goals_conceived": 2.3,
        "first_half_lost": 5,
        "first_half_win": 3,
        "avg_bookie_win_chance": 0.098,
        "goals_conceived": 23,
        "draw": 1
      }
    },
    "encounters": [
      {
        "first_half_result": "1 - 0",
        "competition_cluster": "Spain",
        "fulltime_result": "2 - 1",
        "start_date": "2019-04-20",
        "competition_name": "Primera Division",
        "season": "2018 - 2019",
        "away_team": "Real Sociedad",
        "home_team": "Barcelona"
      },
      {
        "first_half_result": "1 - 0",
        "competition_cluster": "Spain",
        "fulltime_result": "1 - 2",
        "start_date": "2018-09-15",
        "competition_name": "Primera Division",
        "season": "2018 - 2019",
        "away_team": "Barcelona",
        "home_team": "Real Sociedad"
      },
      {
        "first_half_result": "0 - 0",
        "competition_cluster": "Spain",
        "fulltime_result": "1 - 0",
        "start_date": "2018-05-20",
        "competition_name": "Primera Division",
        "season": "2017 - 2018",
        "away_team": "Real Sociedad",
        "home_team": "Barcelona"
      },
      {
        "first_half_result": "2 - 1",
        "competition_cluster": "Spain",
        "fulltime_result": "2 - 4",
        "start_date": "2018-01-14",
        "competition_name": "Primera Division",
        "season": "2017 - 2018",
        "away_team": "Barcelona",
        "home_team": "Real Sociedad"
      },
      {
        "first_half_result": "3 - 2",
        "competition_cluster": "Spain",
        "fulltime_result": "3 - 2",
        "start_date": "2017-04-15",
        "competition_name": "Primera Division",
        "season": "2016 - 2017",
        "away_team": "Real Sociedad",
        "home_team": "Barcelona"
      },
      {
        "first_half_result": "1 - 0",
        "competition_cluster": "Spain",
        "fulltime_result": "5 - 2",
        "start_date": "2017-01-26",
        "competition_name": "Copa del Rey",
        "season": "2016 - 2017",
        "away_team": "Real Sociedad",
        "home_team": "Barcelona"
      },
      {
        "first_half_result": "0 - 1",
        "competition_cluster": "Spain",
        "fulltime_result": "0 - 1",
        "start_date": "2017-01-19",
        "competition_name": "Copa del Rey",
        "season": "2016 - 2017",
        "away_team": "Barcelona",
        "home_team": "Real Sociedad"
      },
      {
        "first_half_result": "0 - 0",
        "competition_cluster": "Spain",
        "fulltime_result": "1 - 1",
        "start_date": "2016-11-27",
        "competition_name": "Primera Division",
        "season": "2016 - 2017",
        "away_team": "Barcelona",
        "home_team": "Real Sociedad"
      },
      {
        "first_half_result": "1 - 0",
        "competition_cluster": "Spain",
        "fulltime_result": "1 - 0",
        "start_date": "2016-04-09",
        "competition_name": "Primera Division",
        "season": "2015 - 2016",
        "away_team": "Barcelona",
        "home_team": "Real Sociedad"
      },
      {
        "first_half_result": "2 - 0",
        "competition_cluster": "Spain",
        "fulltime_result": "4 - 0",
        "start_date": "2015-11-28",
        "competition_name": "Primera Division",
        "season": "2015 - 2016",
        "away_team": "Real Sociedad",
        "home_team": "Barcelona"
      }
    ]
  }
}

```

{% endtab %}
{% endtabs %}

## League stats for away team

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/away-league-stats/:id`

Given a match `id` will grab the league stats for the team playing away.\
**Does not support past results only upcoming matches** (with the start\_date in the future)

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | Fixture ID  |

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

```javascript
{
  "data": {
    "points_as_away_team": 13,
    "won_as_away_team": 4,
    "goals_scored": 41,
    "matches_played": 15,
    "won": 11,
    "lost": 3,
    "lost_as_away_team": 3,
    "goals_conceived_as_away_team": 9,
    "draw_as_away_team": 1,
    "points": 34,
    "goals_scored_as_away_team": 11,
    "matches_played_as_away_team": 8,
    "goals_conceived": 18,
    "team": "Barcelona",
    "draw": 1
  }
```

{% endtab %}
{% endtabs %}

## Last 10 matches for Home team

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/home-last-10/`

Shows the last 10 encounters for the home team and statistics based on those last 10 matches.\
Less than 10 encounters are shown when more data is not available

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | number | Fixture ID  |

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

```javascript
{
  "data": {
    "stats": {
      "lost_as_away_team": 1,
      "goals_scored": 13,
      "wins_as_home_team": 2,
      "results_as_home_team": "WLDLW",
      "clean_sheets": 0,
      "goals_conceived_as_away_team": 4,
      "goals_scored_as_home_team": 9,
      "draws": 3,
      "results_as_away_team": "DWWLD",
      "wins": 4,
      "over_35": 3,
      "over_25": 5,
      "num_played_as_home_team": 5,
      "goals_conceived_first_half": 6,
      "lost_as_home_team": 2,
      "goals_scored_as_away_team": 4,
      "goals_scored_second_half": 8,
      "over_15": 6,
      "num_played_as_away_team": 5,
      "draws_as_away_team": 2,
      "lost": 3,
      "results": "DWWLWDLLWD",
      "draws_as_home_team": 1,
      "wins_as_away_team": 2,
      "over_05": 8,
      "goals_conceived_second_half": 4,
      "goals_conceived_as_home_team": 6,
      "goals_scored_first_half": 5,
      "both_teams_scored": 6,
      "goals_conceived": 10
    },
    "encounters": [
      {
        "odds_against": 3.37,
        "result": "D",
        "played_against": "Valladolid",
        "fulltime_result": "0 - 0",
        "odds_draw": 3.25,
        "goals_scored_first_half": 0,
        "position": 1,
        "start_date": "2019-12-08",
        "odds_for": 2.25,
        "played_away": true
      },
      {
        "odds_against": 5.4,
        "result": "W",
        "played_against": "Eibar",
        "fulltime_result": "4 - 1",
        "odds_draw": 3.87,
        "goals_scored_first_half": 1,
        "position": 2,
        "start_date": "2019-11-30",
        "odds_for": 1.66,
        "played_away": false
      },
      {
        "odds_against": 1.36,
        "result": "L",
        "played_against": "Real Madrid",
        "fulltime_result": "3 - 1",
        "odds_draw": 5.49,
        "goals_scored_first_half": 1,
        "position": 3,
        "start_date": "2019-11-23",
        "odds_for": 7.65,
        "played_away": true
      },
      {
        "odds_against": 4.68,
        "result": "L",
        "played_against": "Osasuna",
        "fulltime_result": "0 - 1",
        "odds_draw": 3.76,
        "goals_scored_first_half": 0,
        "position": 4,
        "start_date": "2019-11-14",
        "odds_for": 1.58,
        "played_away": false
      },
      {
        "odds_against": 5.59,
        "result": "D",
        "played_against": "Leganes",
        "fulltime_result": "1 - 1",
        "odds_draw": 3.52,
        "goals_scored_first_half": 0,
        "position": 5,
        "start_date": "2019-11-08",
        "odds_for": 1.71,
        "played_away": false
      },
      {
        "odds_against": 2.92,
        "result": "W",
        "played_against": "Granada CF",
        "fulltime_result": "1 - 2",
        "odds_draw": 3.15,
        "goals_scored_first_half": 1,
        "position": 6,
        "start_date": "2019-11-03",
        "odds_for": 2.59,
        "played_away": true
      },
      {
        "odds_against": 6.42,
        "result": "L",
        "played_against": "Levante",
        "fulltime_result": "1 - 2",
        "odds_draw": 4.58,
        "goals_scored_first_half": 0,
        "position": 7,
        "start_date": "2019-10-30",
        "odds_for": 1.49,
        "played_away": false
      },
      {
        "odds_against": 2.79,
        "result": "W",
        "played_against": "Celta Vigo",
        "fulltime_result": "0 - 1",
        "odds_draw": 3.29,
        "goals_scored_first_half": 0,
        "position": 8,
        "start_date": "2019-10-27",
        "odds_for": 2.58,
        "played_away": true
      },
      {
        "odds_against": 3.83,
        "result": "W",
        "played_against": "Real Betis",
        "fulltime_result": "3 - 1",
        "odds_draw": 3.7,
        "goals_scored_first_half": 2,
        "position": 9,
        "start_date": "2019-10-20",
        "odds_for": 1.94,
        "played_away": false
      },
      {
        "odds_against": 2.45,
        "result": "D",
        "played_against": "Osasuna",
        "fulltime_result": "0 - 0",
        "odds_draw": 3.53,
        "goals_scored_first_half": 0,
        "position": 10,
        "start_date": "2019-10-10",
        "odds_for": 2.42,
        "played_away": true
      }
    ]
  }
}

```

{% endtab %}
{% endtabs %}

## Last 10 matches for Away team

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/away-last-10/`

Shows the last 10 encounters for the home team and statistics based on those last 10 matches.\
Less than 10 encounters are shown when more data is not available.

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | number | Fixture ID  |

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

```javascript
{
  "data": {
    "stats": {
      "lost_as_away_team": 1,
      "goals_scored": 25,
      "wins_as_home_team": 4,
      "results_as_home_team": "WDWWW",
      "clean_sheets": 0,
      "goals_conceived_as_away_team": 5,
      "goals_scored_as_home_team": 17,
      "draws": 1,
      "results_as_away_team": "LWWWW",
      "wins": 8,
      "over_35": 5,
      "over_25": 7,
      "num_played_as_home_team": 5,
      "goals_conceived_first_half": 5,
      "lost_as_home_team": 0,
      "goals_scored_as_away_team": 8,
      "goals_scored_second_half": 12,
      "over_15": 8,
      "num_played_as_away_team": 5,
      "draws_as_away_team": 0,
      "lost": 1,
      "results": "WLDWWWWWWW",
      "draws_as_home_team": 1,
      "wins_as_away_team": 4,
      "over_05": 9,
      "goals_conceived_second_half": 5,
      "goals_conceived_as_home_team": 5,
      "goals_scored_first_half": 13,
      "both_teams_scored": 7,
      "goals_conceived": 10
    },
    "encounters": [
      {
        "odds_against": 1.57,
        "result": "W",
        "played_against": "Inter",
        "fulltime_result": "1 - 2",
        "odds_draw": 4.47,
        "goals_scored_first_half": 1,
        "position": 1,
        "start_date": "2019-12-10",
        "odds_for": 5.25,
        "played_away": true
      },
      {
        "odds_against": 23.93,
        "result": "W",
        "played_against": "Mallorca",
        "fulltime_result": "5 - 2",
        "odds_draw": 9.68,
        "goals_scored_first_half": 4,
        "position": 2,
        "start_date": "2019-12-07",
        "odds_for": 1.11,
        "played_away": false
      },
      {
        "odds_against": 2.84,
        "result": "W",
        "played_against": "Atletico Madrid",
        "fulltime_result": "0 - 1",
        "odds_draw": 3.22,
        "goals_scored_first_half": 0,
        "position": 3,
        "start_date": "2019-12-01",
        "odds_for": 2.62,
        "played_away": true
      },
      {
        "odds_against": 6.43,
        "result": "W",
        "played_against": "Borussia Dortmund",
        "fulltime_result": "3 - 1",
        "odds_draw": 4.78,
        "goals_scored_first_half": 2,
        "position": 4,
        "start_date": "2019-11-27",
        "odds_for": 1.46,
        "played_away": false
      },
      {
        "odds_against": 6.09,
        "result": "W",
        "played_against": "Leganes",
        "fulltime_result": "1 - 2",
        "odds_draw": 4.29,
        "goals_scored_first_half": 0,
        "position": 5,
        "start_date": "2019-11-23",
        "odds_for": 1.54,
        "played_away": true
      },
      {
        "odds_against": 3.94,
        "result": "W",
        "played_against": "Cartagena",
        "fulltime_result": "0 - 2",
        "odds_draw": 3.83,
        "goals_scored_first_half": 0,
        "position": 6,
        "start_date": "2019-11-13",
        "odds_for": 1.75,
        "played_away": true
      },
      {
        "odds_against": 12.51,
        "result": "W",
        "played_against": "Celta Vigo",
        "fulltime_result": "4 - 1",
        "odds_draw": 7.02,
        "goals_scored_first_half": 2,
        "position": 7,
        "start_date": "2019-11-09",
        "odds_for": 1.21,
        "played_away": false
      },
      {
        "odds_against": 12.5,
        "result": "D",
        "played_against": "Slavia Prague",
        "fulltime_result": "0 - 0",
        "odds_draw": 6.26,
        "goals_scored_first_half": 0,
        "position": 8,
        "start_date": "2019-11-05",
        "odds_for": 1.23,
        "played_away": false
      },
      {
        "odds_against": 8.43,
        "result": "L",
        "played_against": "Levante",
        "fulltime_result": "3 - 1",
        "odds_draw": 6.16,
        "goals_scored_first_half": 1,
        "position": 9,
        "start_date": "2019-11-02",
        "odds_for": 1.31,
        "played_away": true
      },
      {
        "odds_against": 21.37,
        "result": "W",
        "played_against": "Valladolid",
        "fulltime_result": "5 - 1",
        "odds_draw": 9.62,
        "goals_scored_first_half": 3,
        "position": 10,
        "start_date": "2019-10-29",
        "odds_for": 1.12,
        "played_away": false
      }
    ]
  }
}

```

{% endtab %}
{% endtabs %}

## Get a list of Fixture IDs

<mark style="color:blue;">`GET`</mark> `https://football-prediction-api.p.rapidapi.com/api/v2/get-list-of-fixture-ids`

This endpoint returns an array of fixture ids.\
It is recommended to use this endpoint if you plan to query the Prediction Details endpoint or other endpoints that need a fixture ID as URL parameter.

#### Query Parameters

| Name       | Type   | Description                                                                                                                                     |
| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| iso\_date  | string | <p>Date in YYYY-MM-DD format <br>Day starts at 00:00 London timezone<br>If not provided returns predictions with start\_date > current time</p> |
| market     | string | Market - check prediction endpoint for details                                                                                                  |
| federation | string | The football association                                                                                                                        |

#### Headers

| Name           | Type   | Description               |
| -------------- | ------ | ------------------------- |
| X-RapidAPI-Key | string | Needed for authentication |

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

```
```

{% endtab %}
{% endtabs %}


# Get sorted predictions for tomorrow

## Python

#### Dependencies

```bash
pip install requests pytz
```

#### Code

```python
from datetime import datetime, timedelta, timezone
import os

import requests
import pytz


api_tz = pytz.timezone("Europe/London")

# Change this to your timezone
local_tz = pytz.timezone("Europe/Rome")


def get_current_datetime_on_api_server():
    london_time = datetime.now(tz=timezone.utc).astimezone(api_tz)
    return london_time


def to_local_datetime(start_date):
    dt = datetime.strptime(start_date, "%Y-%m-%dT%H:%M:%S")
    return api_tz.localize(dt).astimezone(local_tz)


if __name__ == "__main__":
    # this is a datetime object with the timezone used by our api
    current_server_time = get_current_datetime_on_api_server()

    # obtaining the next day as python date object
    tomorrow = current_server_time.date() + timedelta(days=1)

    # setting our API key for auth
    headers = {
        'User-Agent': 'python_requests',
        "X-RapidAPI-Key": os.environ["RAPIDAPI_KEY"],
    }

    session = requests.Session()
    session.headers = headers

    # setting our query params
    params = {
        "iso_date": tomorrow.isoformat(), # python date object should be transformed to ISO format (YYYY-MM-DD)
        "federation": "UEFA",
        "market": "classic"
    }

    prediction_endpoint = "https://football-prediction-api.p.rapidapi.com/api/v2/predictions"
    response = session.get(prediction_endpoint, params=params)

    if response.ok:
        json = response.json()
        json["data"].sort(key=lambda p: p["start_date"])

        for match in json["data"]:
            # going to print tab separated start_time, home_team vs away team, prediction @ predicted odds.
            output = "{st}\t{ht} vs {at}\t{p} @ {odd}"

            local_start_time = to_local_datetime(match["start_date"])
            home_team = match["home_team"]
            away_team = match["away_team"]
            prediction = match["prediction"]

            if "odds" in match:
                prediction_odds = match["odds"].get(prediction, None)
            else:
                # user is not able to see odds as it's subscription plan does not support it.
                prediction_odds = None

            print(output.format(st=local_start_time, ht=home_team, at=away_team, p=prediction, odd=prediction_odds))
    else:
        print("Bad response from server, status-code: {}".format(response.status_code))
        print(response.content)

```

## Node JS

#### Dependencies

```bash
npm install moment-timezone axios
```

#### Code

```javascript
const moment = require("moment-timezone");
const axios = require("axios");

const API_TZ = "Europe/London";
const LOCAL_TZ = "Europe/Rome";

// read the current time in the API timezone
const now = moment.tz(API_TZ);
const tomorrow = now.add(1, "days");

const predictionEndpoint = "https://football-prediction-api.p.rapidapi.com/api/v2/predictions";
// setting our API key for auth
// this info should be kept out of public git or other versioning software
const authHeader = {
    "X-RapidAPI-Key": process.env.RAPIDAPI_KEY
}
const params = {
    iso_date: tomorrow.format("YYYY-MM-DD"), // transforming to ISO format.
    federation: "UEFA",
    market: "classic"
}

const opts = {
    method: "GET",
    headers: authHeader,
    params: params
}

axios
    .get(predictionEndpoint, opts)
    .then(response => {
        const json = response.data;

        json.data.sort((a, b) => {
            // sort ascending by start_date
            if (a.start_date > b.start_date)
                return 1;
            if (a.start_date < b.start_date)
                return -1;
            return 0;
        });

        json.data.forEach(match => {
            const locStartDate = moment.tz(match.start_date, API_TZ).tz(LOCAL_TZ);
            let winOdds;

            if (match.odds && match.prediction in match.odds) {
                winOdds = (
                    match.odds[match.prediction] !== null ?
                        match.odds[match.prediction].toFixed(2)
                        : ""
                );
            } else {
                // Not able to see odds as the subscription plan does not support it.
                // or current match does not have the odds available for this prediction
                winOdds = "n/a";
            }
            console.log(`${locStartDate}\t${match.home_team} vs ${match.away_team}\t${match.prediction} @ ${winOdds}`)
        })
    })
    .catch(err => {
        console.log(err.message);
    });
```

## Java

#### Dependencies

{% code title="pom.xml" %}

```markup
<dependency>
  <groupId>com.mashape.unirest</groupId>
  <artifactId>unirest-java</artifactId>
  <version>1.4.9</version>
</dependency>
```

{% endcode %}

#### Code

```java
package Example;

import com.mashape.unirest.http.*;
import org.json.*;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.*;


public class Example {

    private static String API_TZ = "Europe/London";
    private static String LOCAL_TZ = "Europe/Rome";
    private static String predictionEndpoint = "https://football-prediction-api.p.rapidapi.com/api/v2/predictions";

    private static String getAuthKey() {
        return System.getenv("RAPIDAPI_KEY");
    }

    private static ZonedDateTime getApiTimestamp() {
        return ZonedDateTime.now(ZoneId.of(API_TZ));
    }

    private void getPredictions() throws Exception {
        String tomorrow = getApiTimestamp().plusDays(1).format(DateTimeFormatter.ISO_LOCAL_DATE);
        System.out.println("Current API_TZ timestamp: " + getApiTimestamp().toString());
        System.out.println("Tomorrow is: " + tomorrow);

        HttpResponse<JsonNode> response = Unirest
                .get(predictionEndpoint)
                .header("X-RapidAPI-Key", getAuthKey())
                .queryString("federation", "UEFA")
                .queryString("market", "classic")
                .queryString("iso_date", tomorrow)
                .asJson();

        JSONArray jsonArray = response.getBody().getObject().getJSONArray("data");

        if (jsonArray == null) {
            return;
        }

        List<JSONObject> jsonAsList = new ArrayList<JSONObject>();
        for (int i = 0; i < jsonArray.length(); i++)
            jsonAsList.add(jsonArray.getJSONObject(i));

        jsonAsList.sort(new Comparator<JSONObject>() {
            @Override
            public int compare(JSONObject a, JSONObject b) {
                String st1 = a.getString("start_date");
                String st2 = b.getString("start_date");
                return st1.compareTo(st2);
            }
        });

        for (JSONObject match : jsonAsList) {

            LocalDateTime dt = LocalDateTime.parse(match.getString("start_date"));
            ZonedDateTime apiDt = ZonedDateTime.of(dt, ZoneId.of(API_TZ));
            ZonedDateTime localDt = apiDt.withZoneSameInstant(ZoneId.of(LOCAL_TZ));
            String homeTeam = match.getString("home_team");
            String awayTeam = match.getString("away_team");
            String prediction = match.getString("prediction");
            JSONObject odds = match.optJSONObject("odds");
            String winOdds = "n/a";

            System.out.println("LocalDateTime: " + dt + " vs " + localDt);
            if (odds != null) {
                // set default odds to 0 in case not found.
                double optOdds = odds.optDouble(prediction, 0.0);

                // all valid odds are > 1.0, the rest are defaultValue from above
                if (optOdds > 1.0) {
                    winOdds = String.valueOf(optOdds);
                }
            }
            System.out.println(localDt.toString() + "\t" + homeTeam + " vs " + awayTeam + "\t" + prediction + " @ " + winOdds);
        }
    }

    public static void main(String[] args) {
        Unirest.setTimeouts(10000, 10000);
        Example client = new Example();

        try {
            client.getPredictions();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
```


# Setup

## New to Zapier

Zapier is an online automation tool that connects different apps and automate repetitive tasks without coding or relying on developers to build integration.

#### Steps:

* read more about Zapier and [how to use it](https://zapier.com/learn/getting-started-guide/what-is-zapier/)
* sign-up for a [zapier account](https://zapier.com/sign-up/).&#x20;

{% hint style="warning" %}
Zapier is a 3rd party that facilitates connecting the Football Prediction API with other apps without coding.&#x20;

The frequency with which your zap runs can affect the number of requests you make to the Football Prediction API.

Depending on your Zapier plan and whether you keep your zaps running for the whole day you will make:

* 15 minutes (default) = 96 requests / day
* 5 minutes = 288 requests / day

*Calculation method: (24 hours \* 60 minutes) / zap run frequency*
{% endhint %}

{% hint style="danger" %}
Check [our plans](https://market.mashape.com/boggio-analytics/football-prediction/pricing) for daily quotas and extra calls cost.

Our BASIC plan has a quota of 31 calls per month, that means that it should be used to preview what you can do with the API.
{% endhint %}

## Lets get started

* Log into your [zapier account](https://zapier.com/app/login/)
* Accept our [invitation to the beta app](https://zapier.com/platform/public-invite/7853/6d3c4124e203c0e8e03f5151686eaf1d/)
* Click ***Make a Zap!*** from the top right corner

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTOpsnpmqYite_03AE8%2F-LTOxxcqNVZPuPIQsvDY%2FScreenshot%20from%202018-12-10%2023.11.37.png?alt=media\&token=7fbbc6a6-e74c-4767-9d97-968f5134a446)

* Choose **Football Prediction API** as a Trigger App

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTOpsnpmqYite_03AE8%2F-LTOy_FIWaee1e_bxnWV%2FScreenshot%20from%202018-12-10%2023.15.53.png?alt=media\&token=632442d7-dd90-4668-9b3e-0e4f0b6876d1)

* &#x20;There are currently two supported triggers:
  * ***Prediction***
    * triggers when a match is about to start in X minutes
    * you can filter by prediction market and / or federation&#x20;
  * ***Tomorrow's Predictions***
    * triggers in bulk when tomorrow's predictions are available (around midnight London Time)
    * you can filter by prediction market and / or federation&#x20;

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTOpsnpmqYite_03AE8%2F-LTOznVkFmNTYjVz16ZR%2FScreenshot%20from%202018-12-10%2023.16.51.png?alt=media\&token=26e6bf0f-b06c-4350-b8fd-db51cdea4970)

* Click ***Continue***&#x20;


# Connect to Zapier

## Create credentials for Football Prediction API

* Create a [rapidapi.com](https://rapidapi.com/) account and log in.
* Check the details for our [subscription plans](https://rapidapi.com/boggio-analytics/api/football-prediction/pricing) and click *subscribe* to one that fits your needs.
* Create a new RapidApi Project / App

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LiqwzrvAevxMW-ONdPX%2F-LiqyDfXEtO5jIEOfVE7%2FScreenshot%20from%202019-07-03%2011-32-09.png?alt=media\&token=5bfbf209-1402-4703-af08-235869d0d8ba)

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LiqwzrvAevxMW-ONdPX%2F-LiqypZiIswRxZ8cYF-D%2FScreenshot%20from%202019-07-03%2011-35-49.png?alt=media\&token=452d50a0-a13b-4546-bc61-0618ab2b178a)

* Go to the [endpoint documentation](https://rapidapi.com/boggio-analytics/api/football-prediction) page select the RapidAPI project created at the step above and copy the **X-RapidAPI-Key** value from the Header Parameters sectio&#x6E;*.*

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LiqwzrvAevxMW-ONdPX%2F-LiqzbaAEBf6FlldhCSk%2FScreenshot%20from%202019-07-03%2011-40-08.png?alt=media\&token=a695cf17-1fcb-4694-8f9d-743ef4b6bb31)

* Make sure you copy the whole value from X-RapidApi-Key

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LiqwzrvAevxMW-ONdPX%2F-Lir-12lbsTYU5vNZk-O%2FScreenshot%20from%202019-07-03%2011-41-47.png?alt=media\&token=69dff173-7719-47ac-8f5b-441c1c96cd44)

## Back to Zapier

Now you should be at the ***Choose Account*** stage in the creation of your first Football Prediction API trigger in Zapier

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTShL2g9BK2DaVCJqBg%2F-LTShrxBIHyiYks-sXl1%2FScreenshot%20from%202018-12-11%2016.41.05.png?alt=media\&token=7dd6a45a-1979-454d-ad05-09adb521f26c)

Click the ***Connect an Account*** button from the right-hand panel and a new window will pop-out.

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTShL2g9BK2DaVCJqBg%2F-LTSiBrm8pa2OTV2IPh5%2FScreenshot%20from%202018-12-11%2016.42.49.png?alt=media\&token=db390a44-1660-4eb4-983e-c2cfba4a2975)

{% hint style="info" %}
Even though the Zapier interface says X-Mashape-Key it will work with the X-RapidAPI-Key.

Rapidapi has purchased Mashape and the header has changed from X-Mashape-Key to X-RapidAPI-Key but are compatible.
{% endhint %}

Paste your X-RapidAPI-Key into the text box and click ***Yes, Continue***

Click the ***Test*** button to check the newly created account.

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTShL2g9BK2DaVCJqBg%2F-LTSik6wzvi8_kO560Uk%2FScreenshot%20from%202018-12-11%2016.44.29.png?alt=media\&token=ea121e3d-6dee-4d44-9c3e-c2cf2b23ca61)

You should see a **Success** message if the authentication worked fine.

Now we're ready for some action, check the Recipes for some popular examples.


# Recipes

## Automatically tweet a prediction for a match 30 minutes before it starts

### Trigger

* Make sure that you selected **Prediction** as a trigger for our action

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTSpx7lwlTYzbOrfnwP%2F-LTSsqYASSAYY1_uut53%2FPredictionTrigger.png?alt=media\&token=b3234104-64b5-4152-8196-5ce1fb0ad664)

* Use the credentials defined in [Connect to Zapier](/zapier-beta/connect-to-zapier) and click next until you reach **Set Up Options**

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTSpx7lwlTYzbOrfnwP%2F-LTStOOzaZYFqnYpdUxu%2FPredictionOpts.png?alt=media\&token=69fb582a-28b2-4a61-bb4a-579d154c6196)

* For the **prediction market** choose **Over 25** (or any other available prediction market)

{% hint style="info" %}
We will use Over 25 prediction market which predicts whether there will be more than or less than 2.5 goals scored in a match.

The available markets depends on your Football Prediction API subscription.

Details about each prediction market can be found [here](/getting-started/making-a-first-api-call#available-prediction-markets)
{% endhint %}

* Leave the **federation** field empty as we are interested in all available predictions.
* **Minutes before start** set this to 30. (we want to post to twitter 30 minutes before the start of the actual match)
* **Test this step** it is useful to have a sample for the current market

{% hint style="warning" %}
Make sure the **Minutes before start** is not higher than the maximum supported by your subscription:

* 12 hours for BASIC (**Minutes before start** should be lower than 720)
* 36 hours for PRO (**Minutes before start** should be lower than 2160)
* 48 hours for ULTRA and MEGA (**Minutes before start** should be lower than 2880)
  {% endhint %}

### Action

* Click **+Add a step** from the left panel and press **Action/Search**
* Search for **Twitter** and choose **Create Tweet**
* Connect to your **Twitter** account and **Edit Template**

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTSpx7lwlTYzbOrfnwP%2F-LTSwW6l-tf9IqeivXV0%2Fimage.png?alt=media\&token=3732a1f1-01f4-4f72-9fb7-c68055113f56)

* Write your template for the tweet, toggle **Setup Preview** to get an idea on how it would look based on the sampled prediction.
* With the template in place, you are almost done.
* A general recommendation is to click **Send Test To Twitter** to see the prediction actually posted to Twitter.

{% hint style="info" %}
When creating a Zap for the first time, Zapier will check all the available predictions for the **Minutes before start** you defined.

It automatically makes sure it doesn't post the same prediction twice, that is why it will start considering new predictions after the initial interval defined.

This means effectively that the recipe we just created will consider as new any match starting > 30 minutes from now.
{% endhint %}

## Save tomorrow's predictions for UEFA to a Google Sheets spreadsheet

{% hint style="danger" %}
This recipe requires a PRO/ULTRA/MEGA Football Prediction API subscription to work as described here but can be made to work with BASIC as well.

BASIC subscription only permits "seeing" predictions for matches that are starting in 12 hours max and won't be able to see "tomorrow" predictions as that would be 24 hours ahead.

If you want to use BASIC and Google Sheets you can follow the [Trigger](/zapier-beta/recipes#trigger) steps for the Twitter recipe and use the Google Sheets Action described below.
{% endhint %}

### Trigger

* Make sure that you selected **Tomorrow's Predictions** as a trigger for our action

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTTLpC6vRbedUcexWMZ%2F-LTTR4gyf65zt3R9D2RI%2Fimage.png?alt=media\&token=9ef0095c-b747-4124-b491-8060449356d9)

* Use the credentials defined in [Connect to Zapier](https://developer.boggio-analytics.com/zapier-beta/connect-to-zapier) and click next until you reach **Set Up Options**
* For the **prediction market** choose **Over 35**

{% hint style="info" %}
We will use Over 35 prediction market which predicts whether there will be more than or less than 3.5 goals scored in a match. (yes or no)

The available markets depends on your Football Prediction API subscription.

Details about each prediction market can be found [here](/getting-started/making-a-first-api-call#available-prediction-markets)
{% endhint %}

* For the **federation** choose UEFA.
* **Test this step** as it is useful to have a sample for the current market.

### Action

* Click **+Add a step** from the left panel and press **Action/Search**
* Search for **Google Sheets** and choose **Create Spreadsheet Row**
* Connect to your **Google Sheets** account and **click continue**&#x20;

#### Google Sheets

* Copy the first row from this [Google Sheet template](https://docs.google.com/spreadsheets/d/1fbE2xLbd9xrs_JDyL0BE-8tZpBVg0MUTzP48djfmT7E/edit?usp=sharing) and create a new Google Spreadsheet where you will get the predictions.
* Paste the row into the new spreadsheet and optionally rename the Worksheet name of the current Worksheet to something matching the prediction market.

#### Back to Zapier

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTTUDwAKqSOSX1y_mTn%2F-LTT_EdgGkkKE1oNk0No%2Fimage.png?alt=media\&token=b814b3fc-c6b5-46ff-9a37-7755c191bd9e)

* You should now be in the **Edit Template** section of Zapier
* Set the **Speadsheet** to the one created earlier
* The **worksheet** should be the one renamed earlier.

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTTUDwAKqSOSX1y_mTn%2F-LTT_wXY_4u8W7UE6aGt%2Fimage.png?alt=media\&token=212950d0-c519-44a6-8c12-88713ec9ccc7)

* For each field in the Spreadsheet header we need to match one from the trigger.

{% hint style="danger" %}
Make sure each header is mapped correctly as an incorrect mapping would lead to inconsistencies
{% endhint %}

{% hint style="info" %}
Depending on your subscription type, you may not have access to all the fields. (e.g only MEGA has access to team strength)

Leave it blank if not found in the response from Step 1.
{% endhint %}

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTTUDwAKqSOSX1y_mTn%2F-LTTaRvviumwnP6twTGB%2Fimage.png?alt=media\&token=aa067ca5-f815-4470-b527-028459a8d24f)

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTTUDwAKqSOSX1y_mTn%2F-LTTaZSD45O0YW88UWWv%2Fimage.png?alt=media\&token=7ee40850-8537-4e50-a90d-356e0ee16735)

![](https://2291015899-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSptjNWFuZaPDt1Y12e%2F-LTTUDwAKqSOSX1y_mTn%2F-LTTaer8w6r_tVP_MkLG%2Fimage.png?alt=media\&token=f9ffc463-4f00-4e76-a164-49da9009b55a)

* With the mapping in place, you are done, however it is recommended to test everything is working by pressing the **Send Test To Google Sheets** button
* If you go back to your Google Spreadsheet you should see the sample row sent by the test.
* You will start seeing new predictions added to you spreadsheet once a day after 00:00 London Timezone.

## Over 1000 apps on Zapier

These two recipes above serve as an example, you can use any of the over 1000 apps supported by Zapier and they all work automatically.

It is up to your imagination how you plan to use them.


