API Reference
Basic RESTful endpoints which can be used to discover Aver on-chain market instances and add context to the on-chain data
Environments (Devnet or Mainnet)
DevNet: base_url = https://dev.api.aver.exchange/v3
Mainnet: base_url = https://api.aver.exchange/v3
Please note these variables are referenced throughout below as {base_url}
Javascript and Python Examples
const { default: axios } = require("axios")
const AVER_BASE_URL = 'https://dev.api.aver.exchange/v3'
const EPL_SUB_CATEGORY_ID = 109
const SOCCER_CATEGORY_ID = 1035
const getActiveEvents = async () => {
const activeEventsResp = await axios.get(`${AVER_BASE_URL}/events?active_only=true&include_markets=true`)
return activeEventsResp.data.results
}
const getActiveEplEvents = async () => {
const activeEplEventsResp = await axios.get(`${AVER_BASE_URL}/events?active_only=true&include_markets=true&sub_category_ids=${EPL_SUB_CATEGORY_ID}`)
return activeEplEventsResp.data.results
}
const getActiveSubCategories = async () => {
const activeSubCategoriesResp = await axios.get(`${AVER_BASE_URL}/sub_categories?active_only=true`)
return activeSubCategoriesResp.data.results
}
const getActiveSoccerSubCategories = async () => {
const activeSoccerSubCategoriesResp = await axios.get(`${AVER_BASE_URL}/sub_categories?active_only=true&category_ids=${SOCCER_CATEGORY_ID}`)
return activeSoccerSubCategoriesResp.data.results
}
const getActiveCategories = async () => {
const activeCategoriesResp = await axios.get(`${AVER_BASE_URL}/categories?active_only=true`)
return activeCategoriesResp.data.results
}
const main = async () => {
console.log('---- EVENTS ----')
const activeEvents = await getActiveEvents()
console.log(activeEvents)
console.log('---- EVENTS END ----')
console.log('---- SUB CATEGORIES ----')
const activeSubCategories = await getActiveSubCategories()
console.log(activeSubCategories)
console.log('---- SUB CATEGORIES END ----')
console.log('---- CATEGORIES ----')
const activeCategories = await getActiveCategories()
console.log(activeCategories)
console.log('---- CATEGORIES END ----')
console.log('--- EPL EVENTS START ---')
const eplEvents = await getActiveEplEvents()
eplEvents.forEach((eplEvent) => {
console.log(eplEvent)
})
console.log('--- EPL EVENTS END ---')
console.log('--- SOCCER SERIES START ---')
const soccerSubCategories = await getActiveSoccerSubCategories()
console.log(soccerSubCategories)
console.log('--- SOCCER SERIES END ---')
}
main()
import requests
import asyncio
AVER_BASE_URL = 'https://dev.api.aver.exchange/v3'
EPL_SUB_CATEGORY_ID = 109 # call the categories endpoint to find others like NFL, NBA...
SOCCER_CATEGORY_ID = 1035 # call the subcategories endpoint to find others like American Football, Basketball...
async def getActiveEvents():
activeEventsResp = requests.get(AVER_BASE_URL + '/events?active_only=true&include_markets=true').json()
return activeEventsResp['results']
async def getActiveEplEvents():
activeEplEventsResp = requests.get(AVER_BASE_URL + '/events?active_only=true&include_markets=true&sub_category_ids=109').json()
return activeEplEventsResp['results']
async def getActiveCategories():
activeCategoriesResp = requests.get(AVER_BASE_URL + '/categories?active_only=true').json()
return activeCategoriesResp['results']
async def getActiveSubCategories():
activeSubCategoriesResp = requests.get(AVER_BASE_URL + '/sub_categories?active_only=true').json()
return activeSubCategoriesResp['results']
async def getActiveSoccerSubCategories():
activeSoccerSubCategoriesResp = requests.get(AVER_BASE_URL + '/sub_categories?active_only=true&category_ids=1035').json()
return activeSoccerSubCategoriesResp['results'] if activeSoccerSubCategoriesResp is not None else []
async def main():
print('----- START ACTIVE EVENTS -----')
active_events = await getActiveEvents()
print(active_events)
print('----- END ACTIVE EVENTS -----')
print('----- START ACTIVE EPL EVENTS -----')
active_epl_events = await getActiveEplEvents()
print(active_epl_events)
print('----- END ACTIVE EPL EVENTS -----')
print('----- START ACTIVE SUB CATEGORIES -----')
active_sub_categories = await getActiveSubCategories()
print(active_sub_categories)
print('----- END ACTIVE SUB CATEGORIES -----')
print('----- START ACTIVE CATEGORIES -----')
active_categories = await getActiveCategories()
print(active_categories)
print('----- END ACTIVE CATEGORIES -----')
print('----- START ACTIVE SOCCER SUB CATEGORIES -----')
active_soccer_sub_categories = await getActiveSoccerSubCategories()
print(active_soccer_sub_categories)
print('----- END ACTIVE SOCCER SUB CATEGORIES -----')
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
List Categories
No authentication required
List Categories
GET
{base_url}/categories
This endpoint will return the list of categories of markets.
By default this will only return categories for which there are currently active markets.
Query Parameters
{
"count": 100,
"next": "http://dev.api.aver.exchange/v3/categories/?limit=20&offset=40",
"previous": "http://dev.api.aver.exchange/v3/categories/?limit=20",
"results": [
{
"name": "Soccer",
"topic": "Sports",
"label": "Soccer",
"id": 1035
},
// if include_sub_categories=true
{
"name": "Mixed Martial Arts",
"topic": "Sports",
"label": "Mixed Martial Arts",
"id": 1029,
"subCategories": [
{
"id": 535,
"name": "UFC",
"label": "UFC",
"category": 1029
}
]
},
]
}
Get Category
No authentication required
Get Category
GET
{base_url}/categories/{category_id}
This endpoint will return data on a single category.
This endpoint will only return information on child objects (subcategories, events) which currently active markets.
Path Parameters
Query Parameters
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"name": "Soccer",
"topic": "Sports",
"label": "Soccer",
"id": 1035
},
// if include_sub_categories=true
{
"name": "Mixed Martial Arts",
"topic": "Sports",
"label": "Mixed Martial Arts",
"id": 1029,
"subCategories": [
{
"id": 535,
"name": "UFC",
"label": "UFC",
"category": 1029
}
]
},
]
}
List Subcategories
No authentication required
List Subcategories
GET
{base_url}/sub_categories
This endpoint will return the list of subcategories of markets.
By default this will only return subcategories for which there are currently active markets.
Query Parameters
{
"count": 50,
"next": "https://dev.api.aver.exchange/v3/sub_categories/?limit=20&offset=20",
"previous": null,
"results": [
{
"id": 1,
"name": "English Premier League",
"label": "",
"category": 1
},
// if include_events=true
{
"id": 1,
"name": "Coin flips",
"label": "",
"category": 1,
"events": [
{
"id": 63,
"name": "Everton vs Liverpool",
"start": "2022-06-16T23:00:00Z",
"end": "2022-06-18T23:00:00Z",
"sub_category": 65,
"pubkey": "6Sz96xAR6v9DqWMzQu9e67HD79QbZnqWSwP9teFQuhtN"
},
}
...
}
Get Subcategory
No authentication required
Get Subcategory
GET
{base_url}/sub_category/{sub_category_id}
This endpoint will return data on a single subcategory.
This endpoint will only return information on child objects (events) which currently active markets.
Path Parameters
Query Parameters
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"name": "English Premier League",
"label": "",
"category": 1
},
// if include_events=true
{
"id": 1,
"name": "Coin flips",
"label": "",
"category": 1,
"events": [
{
"id": 63,
"name": "Everton vs Liverpool",
"start": "2022-06-16T23:00:00Z",
"end": "2022-06-18T23:00:00Z",
"sub_category": 65,
"pubkey": "6Sz96xAR6v9DqWMzQu9e67HD79QbZnqWSwP9teFQuhtN"
},
}
...
}
List Events
No authentication required
List Events
GET
{base_url}/events/
This endpoint will return data on a single subcategory.
By default this will only return subcategories for which there are currently active markets.
Query Parameters
{
"count": 50,
"next": "https://dev.api.aver.exchange/v3/events/?limit=20&offset=20",
"previous": null,
"results": [
{
"id": 2,
"name": "Arsenal vs Liverpool",
"start": "2022-03-16T20:00:00Z",
"end": "2022-03-16T22:00:00Z",
"sub_category": 109,
"pubkey": "AtkgHEdRVbqdh3xWWKqbubvrmsxJjhEcsU69Thad2VJc"
},
// if include_markets=true
{
"id": 3,
"name": "Leicester City v Nottingham Forest",
"start": "2022-10-03T19:00:00Z",
"end": "2022-10-03T20:45:00Z",
"sub_category": 109,
"markets": [
{
"pubkey": "EXoTPToWyKDD7ZUu8edz6nMXc8Ua6uBs8LWixWB7QV57",
"name": "Leicester City vs Nottingham Forest - Match Winner",
"description": "Leicester City play Nottingham Forest at King Power Stadium (Leicester, Leicestershire) in English Premier League. Who will win this match?",
"market_type": "Match Winner",
"image_url": "",
"market_terms": "Win only market. Predict the result of this match. All bets apply to Full Time according to the match officials, plus any stoppage time. Extra-time/penalty shoot-outs are not included. This market is not going in-play.",
"winning_outcome": null,
"outcomes": [
{
"id": 4978,
"name": "Leicester City",
"description": "Leicester City to win the match",
"index": 0,
"image_url": "https://cdn.aver.exchange/img/markets/1028/9240.png"
},
{
"id": 4979,
"name": "Nottingham Forest",
"description": "Nottingham Forest to win the match",
"index": 1,
"image_url": "https://cdn.aver.exchange/img/markets/1028/9297.png"
},
{
"id": 4980,
"name": "Draw",
"description": "The match to end in a draw",
"index": 2,
"image_url": "https://cdn.aver.exchange/frontend/outcome-images/_DRAW.png"
}
],
"internal_status": "active",
"event": 783
}
],
"pubkey": "EBvfe2KjvbF7tUcWvTMxrFZXsc83akvkn3PFWKcrkj11"
},
}
Get Event
No authentication required
Get Event
GET
{base_url}/event/{event_id}
This endpoint will return data on a single event.
Path Parameters
Query Parameters
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 54,
"name": "England vs New Zealand (Test 2 of 3)",
"start": "2022-06-10T10:00:00Z",
"end": "2022-06-10T02:59:00Z",
"sub_category": 770,
"pubkey": "Dv6EVNyGSQumq5pZWDTFQegtDdwept8UHtEUZBtcqYEz"
},
// if include_markets=true
{
"id": 54,
"name": "England vs New Zealand (Test 2 of 3)",
"start": "2022-06-10T10:00:00Z",
"end": "2022-06-10T02:59:00Z",
"sub_category": 770,
"markets": [
{
"pubkey": "Ft8D6bfVgaYdZi486NefMWHyvS6wk32kfA24bG7FzUgy",
"name": "England vs New Zealand (Test 2 of 3)",
"description": "Winner of the second of three test matches",
"market_type": "Match Winner",
"image_url": "https://google.com",
"market_terms": "Win Only Market. Who will win this Test match (2 of 3) in the England vs New Zealand 2022 Test Series.",
"winning_outcome": 56,
"outcomes": [
{
"id": 56,
"name": "England",
"description": "England to win outright",
"index": 0,
"image_url": "https://library.sportingnews.com/2021-08/england-cricket_1mdh7k1eud6j117sg3vwiazuol.png"
},
{
"id": 57,
"name": "New Zealand",
"description": "New Zealand to win outright",
"index": 1,
"image_url": "https://img.cricketnmore.com/logo/new_zealand_logo.jpg"
},
{
"id": 58,
"name": "Draw",
"description": "The match to end in a draw or otherwise go unresolved",
"index": 2,
"image_url": "https://cdn.aver.exchange/frontend/outcome-images/_DRAW.png"
}
],
"internal_status": "active",
"event": 54
}
],
"pubkey": "Dv6EVNyGSQumq5pZWDTFQegtDdwept8UHtEUZBtcqYEz"
}
]
}
List Markets
No authentication required
List Markets
GET
{base_url}/markets
This endpoint will return data on markets.
Path Parameters
Query Parameters
{
"count": 50,
"next": "https://dev.api.aver.exchange/v3/markets/?limit=20&offset=20",
"previous": null,
"results": [
{
"pubkey": "13ycoscSVJ7NGcJmCvgjuCtDwrM4jKrgw4zTRus9Z8VD",
"outcomes": [
{
"id": 3561,
"name": "Fulham",
"description": "Fulham to win the match",
"image_url": "https://cdn.aver.exchange/img/markets/1028/9175.png",
"index": 0,
"aver_market": "13ycoscSVJ7NGcJmCvgjuCtDwrM4jKrgw4zTRus9Z8VD"
},
{
"id": 3562,
"name": "Brighton & Hove Albion",
"description": "Brighton & Hove Albion to win the match",
"image_url": "https://cdn.aver.exchange/img/markets/1028/9065.png",
"index": 1,
"aver_market": "13ycoscSVJ7NGcJmCvgjuCtDwrM4jKrgw4zTRus9Z8VD"
},
{
"id": 3563,
"name": "Draw",
"description": "The match to end in a draw",
"image_url": "https://cdn.aver.exchange/frontend/outcome-images/_DRAW.png",
"index": 2,
"aver_market": "13ycoscSVJ7NGcJmCvgjuCtDwrM4jKrgw4zTRus9Z8VD"
}
],
"winning_outcome": null,
"name": "Fulham vs Brighton & Hove Albion - Match Winner",
"description": "Fulham play Brighton & Hove Albion at Craven Cottage (London) in English Premier League. Who will win this match?",
"created_at": "2022-08-29T13:24:46.918526Z",
"updated_at": "2022-08-29T13:28:49.089437Z",
"notes": "MARKET MAKER AUDIT TRAIL: \n{\n \"bf_event_info\": {\n \"name\": \"Fulham v Brighton\",\n \"date\": \"2022-08-30 18:30\",\n \"time_zone\": \"GMT\",\n \"country_code\": \"GB\",\n \"venue\": null,\n \"market_count\": 50,\n \"utc_datetime\": \"2022-08-30 18:30:00+00:00\",\n \"event_id\": \"31679990\",\n \"fuzz_rating\": 100,\n \"time_mismatch\": 0.0\n },\n \"bf_market_info\": [\n {\n \"market_name\": \"Match Odds\",\n \"description\": \"\",\n \"event\": \"\",\n \"event_type\": \"\",\n \"market_id\": \"1.202357844\",\n \"market_start_time\": \"\",\n \"total_matched\": 15167.272613999998,\n \"selections\": [\n {\n \"selection_id\": 56764,\n \"name\": \"Fulham\",\n \"handicap\": 0.0,\n \"sort_priority\": 1,\n \"metadata\": {}\n },\n {\n \"selection_id\": 18567,\n \"name\": \"Brighton\",\n \"handicap\": 0.0,\n \"sort_priority\": 2,\n \"metadata\": {}\n },\n {\n \"selection_id\": 58805,\n \"name\": \"The Draw\",\n \"handicap\": 0.0,\n \"sort_priority\": 3,\n \"metadata\": {}\n }\n ],\n \"total_fuzz_rating\": 300,\n \"outcome_mapping\": {\n \"0\": {\n \"outcome_name\": \"Fulham\",\n \"bf_selection_name\": \"Fulham\",\n \"bf_selection_id\": 56764,\n \"fuzz_rating\": 100\n },\n \"1\": {\n \"outcome_name\": \"Brighton & Hove Albion\",\n \"bf_selection_name\": \"Brighton\",\n \"bf_selection_id\": 18567,\n \"fuzz_rating\": 100\n },\n \"2\": {\n \"outcome_name\": \"Draw\",\n \"bf_selection_name\": \"The Draw\",\n \"bf_selection_id\": 58805,\n \"fuzz_rating\": 100\n }\n }\n }\n ],\n \"bf_market_id\": \"1.202357844\",\n \"bf_outcome_mappings\": {\n \"0\": 56764,\n \"1\": 18567,\n \"2\": 58805\n },\n \"bf_ordered_selection_ids\": [\n 56764,\n 18567,\n 58805\n ]\n}",
"internal_status": "active",
"market_type": "Match Winner",
"image_url": "",
"market_terms": "Win only market. Predict the result of this match. All bets apply to Full Time according to the match officials, plus any stoppage time. Extra-time/penalty shoot-outs are not included. This market is not going in-play.",
"reason_voided": "copy",
"number_of_winners": 1,
"permissioned_market_flag": false,
"min_orderbook_base_size": 1000000,
"min_new_order_base_size": 1000000,
"min_new_order_quote_size": 1000000,
"max_quote_tokens_in": 50000000,
"max_quote_tokens_in_permission_capped": 50000000,
"cranker_reward": 5000,
"going_in_play_flag": false,
"active_immediately": true,
"trading_cease_time": "2022-08-30T18:30:00Z",
"inplay_start_time": null,
"event": 561,
"fee_tier_collection_bps_rates": 1
},
]
}
Get Market
No authentication required
Get Market
GET
{base_url}/market/{market_pubkey}
This endpoint will return data on a single market, given a market pubkey.
Path Parameters
Query Parameters
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"pubkey": "231FwDiezpxJxkHQRSiWv3yfNAGiyHfxQAzbfgtcP2bB",
"outcomes": [
{
"id": 2490,
"name": "Liverpool",
"description": "Liverpool to win the match",
"image_url": "https://cdn.aver.exchange/img/markets/1028/9249.png",
"index": 0,
"aver_market": "231FwDiezpxJxkHQRSiWv3yfNAGiyHfxQAzbfgtcP2bB"
},
{
"id": 2491,
"name": "Crystal Palace",
"description": "Crystal Palace to win the match",
"image_url": "https://cdn.aver.exchange/img/markets/1028/9127.png",
"index": 1,
"aver_market": "231FwDiezpxJxkHQRSiWv3yfNAGiyHfxQAzbfgtcP2bB"
},
{
"id": 2492,
"name": "Draw",
"description": "The match to end in a draw",
"image_url": "https://cdn.aver.exchange/frontend/outcome-images/_DRAW.png",
"index": 2,
"aver_market": "231FwDiezpxJxkHQRSiWv3yfNAGiyHfxQAzbfgtcP2bB"
}
],
"winning_outcome": null,
"name": "Liverpool vs Crystal Palace - Match Winner",
"description": "Liverpool play Crystal Palace at Anfield (Liverpool) in English Premier League. Who will win this match?",
"created_at": "2022-08-09T09:50:03.821127Z",
"updated_at": "2022-08-09T09:50:03.821146Z",
"notes": "MARKET MAKER AUDIT TRAIL: \n{\n \"bf_event_info\": {\n \"name\": \"Liverpool v Crystal Palace\",\n \"date\": \"2022-08-15 19:00\",\n \"time_zone\": \"GMT\",\n \"country_code\": \"GB\",\n \"venue\": null,\n \"market_count\": 61,\n \"utc_datetime\": \"2022-08-15 19:00:00+00:00\",\n \"event_id\": \"31531738\",\n \"fuzz_rating\": 100,\n \"time_mismatch\": 0.0\n },\n \"bf_market_info\": [\n {\n \"market_name\": \"Match Odds\",\n \"description\": \"\",\n \"event\": \"\",\n \"event_type\": \"\",\n \"market_id\": \"1.200236669\",\n \"market_start_time\": \"\",\n \"total_matched\": 11877.672438000001,\n \"selections\": [\n {\n \"selection_id\": 56323,\n \"name\": \"Liverpool\",\n \"handicap\": 0.0,\n \"sort_priority\": 1,\n \"metadata\": {}\n },\n {\n \"selection_id\": 62523,\n \"name\": \"Crystal Palace\",\n \"handicap\": 0.0,\n \"sort_priority\": 2,\n \"metadata\": {}\n },\n {\n \"selection_id\": 58805,\n \"name\": \"The Draw\",\n \"handicap\": 0.0,\n \"sort_priority\": 3,\n \"metadata\": {}\n }\n ],\n \"total_fuzz_rating\": 300,\n \"outcome_mapping\": {\n \"0\": {\n \"outcome_name\": \"Liverpool\",\n \"bf_selection_name\": \"Liverpool\",\n \"bf_selection_id\": 56323,\n \"fuzz_rating\": 100\n },\n \"1\": {\n \"outcome_name\": \"Crystal Palace\",\n \"bf_selection_name\": \"Crystal Palace\",\n \"bf_selection_id\": 62523,\n \"fuzz_rating\": 100\n },\n \"2\": {\n \"outcome_name\": \"Draw\",\n \"bf_selection_name\": \"The Draw\",\n \"bf_selection_id\": 58805,\n \"fuzz_rating\": 100\n }\n }\n }\n ],\n \"bf_market_id\": \"1.200236669\",\n \"bf_outcome_mappings\": {\n \"0\": 56323,\n \"1\": 62523,\n \"2\": 58805\n },\n \"bf_ordered_selection_ids\": [\n 56323,\n 62523,\n 58805\n ]\n}",
"internal_status": "active",
"market_type": "Match Winner",
"image_url": "",
"market_terms": "Win only market. Predict the result of this match. All bets apply to Full Time according to the match officials, plus any stoppage time. Extra-time/penalty shoot-outs are not included. This market is not going in-play.",
"reason_voided": "",
"number_of_winners": 1,
"permissioned_market_flag": false,
"min_orderbook_base_size": 1000000,
"min_new_order_base_size": 1000000,
"min_new_order_quote_size": 1000000,
"max_quote_tokens_in": 50000000,
"max_quote_tokens_in_permission_capped": 50000000,
"cranker_reward": 5000,
"going_in_play_flag": false,
"active_immediately": true,
"trading_cease_time": "2022-08-15T19:00:00Z",
"inplay_start_time": null,
"event": 411,
"fee_tier_collection_bps_rates": 1
}
]
}
Last updated