Skip to main content

List Public Games

Retrieve a paginated list of all public games available on the platform.

Endpoint​

GET /api/v2/public/games

Authentication​

This endpoint is public and does not require authentication.

Description​

This endpoint returns a paginated list of all public games available on the Intraverse platform using cursor-based pagination. You can sort the results by name, creation date, or update date.

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: name, createdAt, updatedAt
queryarrayNoArray of query filter objects

Request Examples​

Basic Request​

GET /api/v2/public/games?size=10

With Sorting​

GET /api/v2/public/games?size=10&orderBy=name&order=asc

With Cursor Pagination​

GET /api/v2/public/games?size=10&key=game-123&direction=forward

Response​

Success Response (200)​

{
"current": {
"size": 10,
"key": null,
"direction": null,
"order": "asc",
"orderBy": "name",
"query": null
},
"previous": null,
"next": {
"size": 10,
"key": "game-456",
"direction": "forward",
"order": "asc",
"orderBy": "name",
"query": null
},
"data": [
{
"id": "game-123",
"slug": "my-awesome-game",
"name": "My Awesome Game",
"description": "An amazing game with incredible features",
"status": "active",
"category": "action",
"platform": "web",
"currentVersion": {
"version": "1.2.0",
"releaseDate": "2024-01-01T10:00:00Z"
},
"metadata": {
"minPlayers": 1,
"maxPlayers": 4,
"estimatedDuration": "30 minutes"
},
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2024-01-01T10:00:00Z"
},
{
"id": "game-456",
"slug": "epic-adventure",
"name": "Epic Adventure",
"description": "Embark on an epic journey",
"status": "active",
"category": "adventure",
"platform": "multi",
"currentVersion": {
"version": "2.1.0",
"releaseDate": "2024-01-15T10:00:00Z"
},
"metadata": {
"minPlayers": 1,
"maxPlayers": 1,
"estimatedDuration": "2 hours"
},
"createdAt": "2023-06-01T00:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
}
]
}

Error Response (400)​

{
"message": "Invalid request parameters",
"status": 400
}

Response Fields​

Pagination Fields​

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

Game Data Fields​

FieldTypeDescription
data[].idstringUnique game identifier
data[].slugstringURL-friendly game identifier
data[].namestringGame name
data[].descriptionstringGame description
data[].statusstringGame status
data[].categorystringGame category
data[].platformstringSupported platform
data[].currentVersionobjectCurrent version information
data[].metadataobjectGame-specific metadata
data[].createdAtstringCreation date (ISO 8601)
data[].updatedAtstringLast update date (ISO 8601)

Sorting Options​

Sort Fields (orderBy)​

ValueDescription
nameSort by game name
createdAtSort by creation date
updatedAtSort by last update date

Sort Order​

ValueDescription
ascAscending order
descDescending order

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

Usage Example​

Basic Usage​

const response = await fetch("https://api.intraverse.io/api/v2/public/games?size=10");

const result = await response.json();

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

result.data.forEach((game) => {
console.log(`\n${game.name} (${game.slug})`);
console.log(`- Category: ${game.category}`);
console.log(`- Platform: ${game.platform}`);
console.log(`- Status: ${game.status}`);
console.log(`- Current Version: ${game.currentVersion.version}`);
});

// Handle pagination
if (result.next) {
const nextPageResponse = await fetch(
`https://api.intraverse.io/api/v2/public/games?size=10&key=${result.next.key}&direction=forward`,
);
// Process next page...
}

With Sorting​

const response = await fetch("https://api.intraverse.io/api/v2/public/games?size=5&orderBy=createdAt&order=desc");

const result = await response.json();
console.log(`Found ${result.data.length} newest games`);

Error Handling​

ErrorDescriptionSolution
Invalid sizeSize parameter out of rangeUse size between 1-30
Invalid orderByOrderBy field not supportedUse: name, createdAt, updatedAt
Invalid orderOrder direction not supportedUse: asc or desc
Invalid directionDirection not supportedUse: forward or backward

Next Steps​