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
| Parameter | Type | Required | Description |
|---|---|---|---|
gameSlug | string | Yes | Unique identifier for the game |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
size | number | Yes | Number of items per page (min: 1, max: 30) |
key | string | No | Cursor key for pagination |
direction | string | No | Cursor direction: forward or backward |
order | string | No | Sort order: asc or desc |
orderBy | string | No | Field to sort by: startDate |
status | string | No | Filter by tournament status: RUNNING, UPCOMING, FINISHED |
query | array | No | Array 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
| Field | Type | Description |
|---|---|---|
current | object | Current pagination parameters |
previous | object | Previous page parameters (null if first) |
next | object | Next page parameters (null if last) |
data | array | Array of tournament objects |
Tournament Data Fields
| Field | Type | Description |
|---|---|---|
data[].id | string | Unique tournament identifier |
data[].name | string | Tournament name |
data[].organizationId | string | Organization identifier |
data[].color | string | Tournament theme color (hex) |
data[].image | string | Tournament image URL |
data[].gameId | string | Associated game identifier |
data[].startDate | number | Start date (Unix timestamp in ms) |
data[].endDate | number | End date (Unix timestamp in ms) |
data[].createdAt | number | Creation date (Unix timestamp in ms) |
data[].updatedAt | number | Last update date (Unix timestamp in ms) |
data[].projects | array | Array of associated project objects |
data[].airdrops | array | Array of associated airdrop objects |
data[].rounds | array | Array of tournament round objects |
Project Fields
| Field | Type | Description |
|---|---|---|
data[].projects[].id | string | Project identifier |
data[].projects[].name | string | Project name |
data[].projects[].imageUrl | string | Project image URL |
data[].projects[].organizationId | string | null | Organization identifier (optional) |
data[].projects[].chainId | string | null | Blockchain chain ID (optional) |
data[].projects[].contractAddress | string | null | Smart contract address (optional) |
data[].projects[].createdAt | number | Creation date (Unix ms) |
data[].projects[].updatedAt | number | Last update date (Unix ms) |
Round Fields
| Field | Type | Description |
|---|---|---|
data[].rounds[].id | string | Round identifier |
data[].rounds[].tournamentId | string | Associated tournament identifier |
data[].rounds[].name | string | Round name |
data[].rounds[].title | string | Round title/description |
data[].rounds[].projectsIds | array | Array of associated project identifiers |
data[].rounds[].intervals | array | Array of round interval objects |
data[].rounds[].userWinnerRewards | array | Array of winner reward objects |
data[].rounds[].intraPointRewards | array | Array of intra point reward amounts |
data[].rounds[].createdAt | number | Creation date (Unix timestamp in ms) |
data[].rounds[].updatedAt | number | Last update date (Unix timestamp in ms) |
Round Interval Fields
| Field | Type | Description |
|---|---|---|
data[].rounds[].intervals[].startDate | number | Interval start (Unix timestamp ms) |
data[].rounds[].intervals[].endDate | number | Interval end (Unix timestamp ms) |
Round Reward Fields
| Field | Type | Description |
|---|---|---|
data[].rounds[].userWinnerRewards[].coinId | string | Reward token/coin identifier |
data[].rounds[].userWinnerRewards[].amount | number | Reward amount |
Tournament Status Filter
| Status | Description |
|---|---|
RUNNING | Tournaments currently active |
UPCOMING | Tournaments that haven't started yet |
FINISHED | Tournaments 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
sizeparameter - Next page: Use the
nextobject from the previous response - Previous page: Use the
previousobject from the previous response - Custom ordering: Use
orderByandorderparameters
Error Handling
| Error | Description | Solution |
|---|---|---|
| Game not found | Game slug doesn't exist | Verify the game slug exists |
| Invalid status | Status filter is invalid | Use: RUNNING, UPCOMING, FINISHED |
| Invalid size | Size parameter out of range | Use size between 1-30 |
| Invalid orderBy | OrderBy field not supported | Use: startDate |