MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

Endpoints

GET /api/player

requires authentication

Display all the players.

Example request:
curl --request GET \
    --get "https://sportsfever.ai/api/player" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sportsfever.ai/api/player"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://sportsfever.ai/api/player',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://sportsfever.ai/api/player'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
"data": [
{
"pid": 1,
"title": "Martin Guptill",
"short_name": "Martin Guptill",
"first_name": "Martin Guptill",
"last_name" : "",
"nationality": "New Zealand",
"birthdate": "30-09-1986",
"country": "nz"
},{
 "pid": 29,
"title": "Brendon McCullum",
"short_name": "Brendon McCullum",
"first_name": "Brendon McCullum",
"last_name": "",
"nationality": "New Zealand",
"birthdate": "27-09-1981",
"country": "nz"
}
],
}
 

Request   

GET api/player

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

GET /api/player/{id}

requires authentication

Display the details of the specified player.

Example request:
curl --request GET \
    --get "https://sportsfever.ai/api/player/27" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sportsfever.ai/api/player/27"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://sportsfever.ai/api/player/27',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://sportsfever.ai/api/player/27'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
   "title": "Martin Guptill",
   "short_name": "Martin Guptill",
   "first_name": "Martin Guptill",
   "last_name": "",
   "middle_name": "",
   "birthdate": "30-09-1986",
   "birthplace": "",
   "country": "nz",
   "primary_team": "[]",
   "logo_url": "",
   "playing_role": "bat",
   "batting_style": "",
   "bowling_style": "",
   "fielding_position": "",
   "recent_match": "0",
   "recent_appearance": "0",
   "fantasy_player_rating": "8.5",
   "alt_name": "",
   "nationality": "New Zealand",
   "batting_stats": [
       {
       "match_id": 0,
       "inning_id": 0,
       "matches": 47,
       "innings": 89,
       "notout": 1,
       "runs": 2586,
       "balls": 5548,
       "highest": 189,
       "runs100": 3,
       "runs50": 17,
       "runs4": 326,
       "runs6": 23,
       "average": 29.38,
       "strike": 46.61,
       "catches": 50,
       "stumpings": 0,
       "fastest50balls": 0,
        "fastest100balls": 0,
        "type": "test"
        },
   ],
   "bowling_stats": [
       {
       "match_id": 0,
       "inning_id": 0,
       "matches": 47,
       "innings": 18,
       "balls": 428,
       "overs": 71.2,
       "runs": 298,
       "wickets": 8,
       "bestinning": "3/11",
       "bestmatch": "3/11",
       "econ": 4.17,
       "average": 37.25,
       "strike": 53.5,
       "wicket4i": 0,
       "wicket5i": 0,
       "wicket10m": 0,
       "hattrick": 0,
       "expensive_over_runs": 0,
       "type": "test"
       },
   ]
   }
 

Request   

GET api/player/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the player. Example: 27

GET /api/latest-commentary

requires authentication

Get the latest commentary for the specified match

Example request:
curl --request GET \
    --get "https://sportsfever.ai/api/latest-commentary?match_id=1&lang=Hindi%2C+English%2C+Malayalam." \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sportsfever.ai/api/latest-commentary"
);

const params = {
    "match_id": "1",
    "lang": "Hindi, English, Malayalam.",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://sportsfever.ai/api/latest-commentary',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'match_id' => '1',
            'lang' => 'Hindi, English, Malayalam.',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://sportsfever.ai/api/latest-commentary'
params = {
  'match_id': '1',
  'lang': 'Hindi, English, Malayalam.',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "status": "success",
    "data": {
        "match_id": 1,
        "commentary": "Martin Guptill to Shikhar Dhawan, no run, full and outside off, Dhawan drives it to mid off",
        "over": 1,
        "ball": 1,
        "runs": 0,
        "wicket": 0,
        "extra": 0
    }
}
 

Request   

GET api/latest-commentary

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

match_id   string   

The ID of the match. Example: 1

lang   string   

The language of the commentary. Example: Hindi, English, Malayalam.

GET /api/all-commentary

requires authentication

Get all the commentaries for the specified match

Example request:
curl --request GET \
    --get "https://sportsfever.ai/api/all-commentary?match_id=1&lang=Hindi%2C+English%2C+Malayalam." \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"match_id\": 3,
    \"lang\": \"Kannada\"
}"
const url = new URL(
    "https://sportsfever.ai/api/all-commentary"
);

const params = {
    "match_id": "1",
    "lang": "Hindi, English, Malayalam.",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "match_id": 3,
    "lang": "Kannada"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://sportsfever.ai/api/all-commentary',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'match_id' => '1',
            'lang' => 'Hindi, English, Malayalam.',
        ],
        'json' => [
            'match_id' => 3,
            'lang' => 'Kannada',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://sportsfever.ai/api/all-commentary'
payload = {
    "match_id": 3,
    "lang": "Kannada"
}
params = {
  'match_id': '1',
  'lang': 'Hindi, English, Malayalam.',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()

Example response (200):



    {
    "commentary":[
    {
    "innings": 2,
    "over": 1,
    "ball": 6,
    "runs": 2,
    "wicket": 0,
    "extra": 0,
    "batter1": "Kane Williamson",
    "batter2": "Martin Guptill",
    "bowler": "Rohit Sharma",
    "commetary": "Kane Williamson takes a double toward third man good running between the wickets. Rohit
    Sharma ball’s a Fast delivery on full length on off stump. "
    },
    {
    "innings": 2,
    "over": 1,
    "ball": 5,
    "runs": 1,
    "wicket": 0,
    "extra": 0,
    "batter1": "Martin Guptill",
    "batter2": "Kane Williamson",
    "bowler": "Rohit Sharma",
    "commetary": "Martin Guptill takes a single toward deep third man. Rohit Sharma ball’s a Fast
    delivery on full length on off stump. "
    }],
    "breaks":[{
    "innings": 2,
    "over": 1,
    "ball": 5,
    "runs": 1,
    "wicket": 0,
    "extra": 0,
    "batter1": "Martin Guptill",
    "batter2": "Kane Williamson",
    "bowler": "Rohit Sharma",
    "commetary": "It is a Tea Break "
    }]
    }

 

Request   

GET api/all-commentary

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

match_id   string   

The ID of the match. Example: 1

lang   string   

The language of the commentary. Example: Hindi, English, Malayalam.

GET /api/match

requires authentication

Display the details of all the matches.

Example request:
curl --request GET \
    --get "https://sportsfever.ai/api/match" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sportsfever.ai/api/match"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://sportsfever.ai/api/match',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://sportsfever.ai/api/match'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{[
"id": 1,
"team_a": 1,
"team_b": 2,
"match_type": "ODI",
"started": 1,
"finished": 0
],
[
"id": 2,
"team_a": 3,
"team_b": 4,
"match_type": "ODI",
"started": 1,
"finished": 0
]
}
 

Request   

GET api/match

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

GET /api/match/{match_id}

requires authentication

Display the details of the specified match.

Example request:
curl --request GET \
    --get "https://sportsfever.ai/api/match/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sportsfever.ai/api/match/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://sportsfever.ai/api/match/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://sportsfever.ai/api/match/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "team_a": {
      "id": 1,
      "name": "India",
      "team_short": "ind"
    },
    "team_b": {
      "id": 2,
      "name": "New Zealand",
      "team_short": "nz"
    },
    "match_type": "atc",
    "started": 1,
    "finished": 0,
    "overs": 20,
    "start_time": null,
    "toss_winner": 1,
    "innings": [
      1,
      "2"
    ],
    "metadata": [
      {
        "type": "match_results",
        "data": {
          "won_by": "runs",
          "won_by_value": "12"
        }
      },
      {
        "type": "match_status",
        "data": {
          "status": "completed",
          "status_note": "India Won by 12 Wickets"
        }
      }
    ]
  }
 

Request   

GET api/match/{match_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

match_id   string   

The ID of the match. Example: 1

GET /api/team

requires authentication

Display the details of all the teams.

Example request:
curl --request GET \
    --get "https://sportsfever.ai/api/team" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sportsfever.ai/api/team"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://sportsfever.ai/api/team',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://sportsfever.ai/api/team'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "id": 1,
    "name": "New Zealand",
    "team_short": "NZ"
}
 

Request   

GET api/team

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

GET /api/team/{team_id}

requires authentication

Display the details of the specified team.

Example request:
curl --request GET \
    --get "https://sportsfever.ai/api/team/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sportsfever.ai/api/team/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://sportsfever.ai/api/team/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://sportsfever.ai/api/team/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "name": "New Zealand",
    "team_short": "NZ"
}
 

Request   

GET api/team/{team_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

team_id   integer   

The ID of the team. Example: 1