Skip to main content

Get Tournaments by Game Slug

Retrieve all tournaments for a specific game using cursor-based pagination.

Endpoint

GET /api/v2/tournament/game/{gameSlug}

Authentication

This endpoint is public and does not require authentication.

Description

This endpoint returns all tournaments associated with a specific game, including upcoming, running, and finished tournaments.

Path Parameters

ParameterTypeRequiredDescription
gameSlugstringYesUnique identifier for the game

Query Parameters

ParameterTypeRequiredDescription
sizenumberYesNumber of items per page (min: 1, max: 30)
keystringNoCursor key for pagination
directionstringNoCursor direction: forward or backward
orderstringNoSort order: asc or desc
orderBystringNoField to sort by: startDate
statusstringNoFilter by tournament status: RUNNING, UPCOMING, FINISHED
queryarrayNoArray of query filter objects

Request Examples

Basic Request

GET /api/v2/tournament/game/my-awesome-game?size=10

With Filters

GET /api/v2/tournament/game/my-awesome-game?size=10&status=RUNNING&orderBy=startDate&order=desc

With Cursor Pagination

GET /api/v2/tournament/game/my-awesome-game?size=10&key=tournament-123&direction=forward

Response

Success Response (200)

{
"current": {
"size": 10,
"key": null,
"direction": null,
"order": "desc",
"orderBy": "startDate",
"query": null
},
"previous": null,
"next": {
"size": 10,
"key": "tournament-456",
"direction": "forward",
"order": "desc",
"orderBy": "startDate",
"query": null
},
"data": [
{
"id": "tournament-123",
"name": "Weekly Championship",
"organizationId": "org-456",
"color": "#FF5733",
"image": "https://example.com/tournament-image.jpg",
"gameId": "game-789",
"startDate": 1704110400000,
"endDate": 1704715200000,
"createdAt": 1703548800000,
"updatedAt": 1704110400000,
"projects": [
{
"id": "project-123",
"name": "Epic NFT Collection",
"imageUrl": "https://example.com/project-image.jpg",
"organizationId": "org-456",
"chainId": "1",
"contractAddress": "0x123...abc",
"createdAt": 1703548800000,
"updatedAt": 1703548800000
}
],
"airdrops": [
{
"id": "drop-123",
"name": "Tournament Rewards",
"isActive": true,
"startDate": 1704110400000,
"endDate": 1704715200000,
"contractAddress": "0xabc...123",
"hasMultipleContracts": false,
"isVIP": false,
"whitelistEnabled": true,
"chain": "ethereum",
"chainId": 1,
"network": "mainnet",
"description": "Exclusive rewards for tournament participants",
"moreInfoUrl": "https://example.com/more-info",
"logo": "https://example.com/drop-logo.jpg",
"numberOfRarities": 3,
"hasDailyCheckIn": false,
"magicEdenGoldTokenName": null,
"cards": [],
"marketplaces": [],
"phases": [],
"slug": "tournament-rewards"
}
],
"rounds": [
{
"id": "round-123",
"tournamentId": "tournament-123",
"name": "Qualification Round",
"title": "Week 1 - Qualification",
"projectsIds": ["project-123", "project-456"],
"intervals": [
{
"startDate": 1704110400000,
"endDate": 1704196800000
}
],
"userWinnerRewards": [
{
"coinId": "intra-token",
"amount": 100
},
{
"coinId": "bonus-token",
"amount": 50
}
],
"intraPointRewards": [1000, 500, 250],
"createdAt": 1703548800000,
"updatedAt": 1703548800000
}
]
}
]
}

Error Response (404)

{
"message": "Game not found",
"status": 404
}

Response Fields

Pagination Fields

FieldTypeDescription
currentobjectCurrent pagination parameters
previousobjectPrevious page parameters (null if first)
nextobjectNext page parameters (null if last)
dataarrayArray of tournament objects

Tournament Data Fields

FieldTypeDescription
data[].idstringUnique tournament identifier
data[].namestringTournament name
data[].organizationIdstringOrganization identifier
data[].colorstringTournament theme color (hex)
data[].imagestringTournament image URL
data[].gameIdstringAssociated game identifier
data[].startDatenumberStart date (Unix timestamp in ms)
data[].endDatenumberEnd date (Unix timestamp in ms)
data[].createdAtnumberCreation date (Unix timestamp in ms)
data[].updatedAtnumberLast update date (Unix timestamp in ms)
data[].projectsarrayArray of associated project objects
data[].airdropsarrayArray of associated airdrop objects
data[].roundsarrayArray of tournament round objects

Project Fields

FieldTypeDescription
data[].projects[].idstringProject identifier
data[].projects[].namestringProject name
data[].projects[].imageUrlstringProject image URL
data[].projects[].organizationIdstring | nullOrganization identifier (optional)
data[].projects[].chainIdstring | nullBlockchain chain ID (optional)
data[].projects[].contractAddressstring | nullSmart contract address (optional)
data[].projects[].createdAtnumberCreation date (Unix ms)
data[].projects[].updatedAtnumberLast update date (Unix ms)

Round Fields

FieldTypeDescription
data[].rounds[].idstringRound identifier
data[].rounds[].tournamentIdstringAssociated tournament identifier
data[].rounds[].namestringRound name
data[].rounds[].titlestringRound title/description
data[].rounds[].projectsIdsarrayArray of associated project identifiers
data[].rounds[].intervalsarrayArray of round interval objects
data[].rounds[].userWinnerRewardsarrayArray of winner reward objects
data[].rounds[].intraPointRewardsarrayArray of intra point reward amounts
data[].rounds[].createdAtnumberCreation date (Unix timestamp in ms)
data[].rounds[].updatedAtnumberLast update date (Unix timestamp in ms)

Round Interval Fields

FieldTypeDescription
data[].rounds[].intervals[].startDatenumberInterval start (Unix timestamp ms)
data[].rounds[].intervals[].endDatenumberInterval end (Unix timestamp ms)

Round Reward Fields

FieldTypeDescription
data[].rounds[].userWinnerRewards[].coinIdstringReward token/coin identifier
data[].rounds[].userWinnerRewards[].amountnumberReward amount

Tournament Status Filter

StatusDescription
RUNNINGTournaments currently active
UPCOMINGTournaments that haven't started yet
FINISHEDTournaments that have completed

Usage Example

// Basic request
const response = await fetch("https://api.intraverse.io/api/v2/tournament/game/my-awesome-game?size=10");

const result = await response.json();

console.log(`Found ${result.data.length} tournaments`);

result.data.forEach((tournament) => {
console.log(`\n${tournament.name}`);
console.log(`- Game ID: ${tournament.gameId}`);
console.log(`- Organization: ${tournament.organizationId}`);
console.log(`- Start Date: ${new Date(tournament.startDate).toISOString()}`);
console.log(`- End Date: ${new Date(tournament.endDate).toISOString()}`);
console.log(`- Projects: ${tournament.projects.length}`);
console.log(`- Airdrops: ${tournament.airdrops.length}`);
console.log(`- Rounds: ${tournament.rounds.length}`);

// Log round details
tournament.rounds.forEach((round, index) => {
console.log(` Round ${index + 1}: ${round.name} (${round.title})`);
console.log(` Intervals: ${round.intervals.length}`);
console.log(` Winner Rewards: ${round.userWinnerRewards.length} types`);
console.log(` Intra Points: ${round.intraPointRewards.join(", ")}`);
});
});

// Handle pagination
if (result.next) {
const nextPageResponse = await fetch(
`https://api.intraverse.io/api/v2/tournament/game/my-awesome-game?size=10&key=${result.next.key}&direction=forward`,
);
// Process next page...
}
// With filters
const filteredResponse = await fetch(
"https://api.intraverse.io/api/v2/tournament/game/my-awesome-game?size=5&status=RUNNING&orderBy=startDate&order=desc",
);

const filteredResult = await filteredResponse.json();
console.log(`Found ${filteredResult.data.length} running tournaments`);

Cursor Pagination

This API uses cursor-based pagination instead of traditional page/offset pagination:

  • First request: Only provide size parameter
  • Next page: Use the next object from the previous response
  • Previous page: Use the previous object from the previous response
  • Custom ordering: Use orderBy and order parameters

Error Handling

ErrorDescriptionSolution
Game not foundGame slug doesn't existVerify the game slug exists
Invalid statusStatus filter is invalidUse: RUNNING, UPCOMING, FINISHED
Invalid sizeSize parameter out of rangeUse size between 1-30
Invalid orderByOrderBy field not supportedUse: startDate

Next Steps