Associations by Country API

Associations by Country API

Names and association keys of the cricket associations in a country which are covered by Roanuz sports. The association key is required to access information from other API endpoints such as the Association Featured Tournaments.
Cricket API Image

Request structure

Here is what you would require to make a successful HTTP REST Associations by Country API call.

Sample Request

TERMINAL
pip install requests
pip install requests
icon copy
get_associations_by_country_international.py
import requests project_key = 'YOUR_PROJ_KEY' token = 'YOUR_ACCESS_TOKEN' url = "https://api.sports.roanuz.com/v5/cricket/{}/association/list-by-country/INTERNATIONAL/".format(project_key) headers = { 'rs-token': token } response = requests.get(url, headers=headers) print(response.json())
import requests

project_key = 'YOUR_PROJ_KEY'
token = 'YOUR_ACCESS_TOKEN'
url = "https://api.sports.roanuz.com/v5/cricket/{}/association/list-by-country/INTERNATIONAL/".format(project_key)
headers = {
    'rs-token': token
}
response = requests.get(url, headers=headers)

print(response.json())
icon copy
get_associations_by_country.py
import requests project_key = 'YOUR_PROJ_KEY' token = 'YOUR_ACCESS_TOKEN' country_code = 'ind' url = "https://api.sports.roanuz.com/v5/cricket/{}/association/list-by-country/{}/".format(project_key,country_code) headers = { 'rs-token': token } response = requests.get(url, headers=headers) print(response.json())
import requests

project_key = 'YOUR_PROJ_KEY'
token = 'YOUR_ACCESS_TOKEN'
country_code = 'ind'
url = "https://api.sports.roanuz.com/v5/cricket/{}/association/list-by-country/{}/".format(project_key,country_code)
headers = {
    'rs-token': token
}
response = requests.get(url, headers=headers)

print(response.json())
icon copy
get_associations_by_country_international_pagination.py
import requests project_key = 'YOUR_PROJ_KEY' token = 'YOUR_ACCESS_TOKEN' page_key = '2' url = "https://api.sports.roanuz.com/v5/cricket/{}/association/list-by-country/INTERNATIONAL/{}/".format(project_key,page_key) headers = { 'rs-token': token } response = requests.get(url, headers=headers) print(response.json())
import requests

project_key = 'YOUR_PROJ_KEY'
token = 'YOUR_ACCESS_TOKEN'
page_key = '2'
url = "https://api.sports.roanuz.com/v5/cricket/{}/association/list-by-country/INTERNATIONAL/{}/".format(project_key,page_key)
headers = {
    'rs-token': token
}
response = requests.get(url, headers=headers)

print(response.json())
icon copy
get_associations_by_country_pagination.py
import requests project_key = 'YOUR_PROJ_KEY' token = 'YOUR_ACCESS_TOKEN' country_code = 'ind' page_key ='2' url = "https://api.sports.roanuz.com/v5/cricket/{}/association/list-by-country/{}/{}/".format(project_key,country_code,page_key) headers = { 'rs-token': token } response = requests.get(url, headers=headers) print(response.json())
import requests

project_key = 'YOUR_PROJ_KEY'
token = 'YOUR_ACCESS_TOKEN'
country_code = 'ind'
page_key ='2'
url = "https://api.sports.roanuz.com/v5/cricket/{}/association/list-by-country/{}/{}/".format(project_key,country_code,page_key)
headers = {
    'rs-token': token
}
response = requests.get(url, headers=headers)

print(response.json())
icon copy

Concepts & 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.

HTTP Status

Possible status codes you may receive in response to your requests.

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.

Downloads

A few snapshots of the Associations by Country API in action in different situations that could help you in testing your app and understanding the responses in most possible cases.

Response Schema

The schema as per which the data is sent by the Associations By Country 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.