Fantasy Match Credits API*

Fantasy Match Credits API*

The list of players in the squads of a match and the credit points required to include them in the fantasy team. The match credit for each of the players is determined by a special algorithm that takes into account both the overall and recent performances of the players.
* Docs & Schema still under development
Cricket API Image

Request structure

Here is what you would require to make a successful HTTP REST Fantasy Match Credits API call.

Sample Request

TERMINAL
pip install roanuz-sports
pip install roanuz-sports
icon copy
get_fantasy_match_credits_mg100.py
#For MG100 matches import requests project_key = 'PROJ_KEY' token = 'API_TOKEN' key = 'cplt20_2020_g3' url = "https://api.sports.roanuz.com/v5/cricket/{}/fantasy-match-credits/{}/".format(project_key, key) headers = { 'rs-token': token } response = requests.get(url, headers=headers) print(response.json()) # if MG101 match key = 'c.match.btc_vs_clu.f9be9' model = 'RZ-C-A101' url = "https://api.sports.roanuz.com/v5/cricket/{}/fantasy-match-credits/{}/?model={}".format(project_key, key, model) headers = { 'rs-token': token } response = requests.get(url, headers=headers) print(response.json())
#For MG100 matches
import requests

project_key = 'PROJ_KEY'
token = 'API_TOKEN'
key = 'cplt20_2020_g3'
url = "https://api.sports.roanuz.com/v5/cricket/{}/fantasy-match-credits/{}/".format(project_key, key)
headers = {
    'rs-token': token
}
response = requests.get(url, headers=headers)

print(response.json())

# if MG101 match
key = 'c.match.btc_vs_clu.f9be9'
model = 'RZ-C-A101'
url = "https://api.sports.roanuz.com/v5/cricket/{}/fantasy-match-credits/{}/?model={}".format(project_key, key, model)
headers = {
    'rs-token': token
}
response = requests.get(url, headers=headers)

print(response.json())
icon copy
get_fantasy_match_credits_mg101.py
#For MG101 matches import requests project_key = 'PROJ_KEY' token = 'API_TOKEN' key = 'c.match.btc_vs_clu.f9be9' model = 'RZ-C-A101' url = "https://api.sports.roanuz.com/v5/cricket/{}/fantasy-match-credits/{}/?model={}".format(project_key, key, model) headers = { 'rs-token': token } response = requests.get(url, headers=headers) print(response.json())
#For MG101 matches
import requests

project_key = 'PROJ_KEY'
token = 'API_TOKEN'
key = 'c.match.btc_vs_clu.f9be9'
model = 'RZ-C-A101'
url = "https://api.sports.roanuz.com/v5/cricket/{}/fantasy-match-credits/{}/?model={}".format(project_key, key, model)
headers = {
    'rs-token': token
}
response = requests.get(url, headers=headers)

print(response.json())
icon copy

Scenarios

We recommend you to go through the following scenarios and keep them in mind while developing your application. A sound knowledge of these scenarios should help you in maintaining the quality of your app.

Explore Data

Some unique objects and properties available in the Fantasy Match Credits API and the value they bring to the table.

HTTP Status

Possible status code you may receive in response to your request.

HTTP StatusError Code
200
OK. Everything is fine.
500
UN-500-0
Unknown Error. In unpredictable circumstances the server may throw 500 errors for a very brief period. When this happens retry the same request.
HTTP StatusReasonError Code
200
OK. Everything is fine.
500
Unknown Error. In unpredictable circumstances the server may throw 500 errors for a very brief period. When this happens retry the same request.
UN-500-0

Cache

A cache object accompanies every API response. It comes with a set of recommended values to help you properly cache the data and handle the cache internally.

When you try to cache the responses on say MemCached, Redis or any other cache server, you will usually require a Key and an expire time.

cache.key

Our recommendations on what Key or ID you should use while you cache a response of this API.

cache.expires

Our recommendations on how long you can cache a particular response.

An interesting thing to note here is that the recommended expire time is not going to be the same under all situations. Our intelligent caching mechanism dynamically decides the best expire time analysing various parameters.

The cache object also provides you with a max_age and the ETag values, which lets you implement the ETag HTTP caching mechanism. To implement HTTP Caching with this API, refer here.

cache.max_age

Our recommended period of time up to which you can consider the data to be fresh. It gives you a heads up on when you should be checking for updates in the data.

cache.etag

Etag is an identifier for a specific version of a response. To know more, refer here.

The time period specified in max_age will be lesser than that in the expires object. To sum it up, the cache.expires object tells you how long you can cache the data while the cache.max_age object tells you when you should check for updates.

Response Schema

The schema as per which the data is sent by the Fantasy Match Credits API is explained below. We constantly work on improving our API system, and in some cases, safely introduce new attributes to provide interesting and useful features. To give you a heads up regarding such updates, every successful API response will contain a schema object. It gives the information about the current minor version and major version of the API.