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
| 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: name, createdAt, updatedAt |
query | array | No | Array 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
| 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 game objects |
Game Data Fields
| Field | Type | Description |
|---|---|---|
data[].id | string | Unique game identifier |
data[].slug | string | URL-friendly game identifier |
data[].name | string | Game name |
data[].description | string | Game description |
data[].status | string | Game status |
data[].category | string | Game category |
data[].platform | string | Supported platform |
data[].currentVersion | object | Current version information |
data[].metadata | object | Game-specific metadata |
data[].createdAt | string | Creation date (ISO 8601) |
data[].updatedAt | string | Last update date (ISO 8601) |
Sorting Options
Sort Fields (orderBy)
| Value | Description |
|---|---|
name | Sort by game name |
createdAt | Sort by creation date |
updatedAt | Sort by last update date |
Sort Order
| Value | Description |
|---|---|
asc | Ascending order |
desc | Descending order |
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
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
| Error | Description | Solution |
|---|---|---|
| Invalid size | Size parameter out of range | Use size between 1-30 |
| Invalid orderBy | OrderBy field not supported | Use: name, createdAt, updatedAt |
| Invalid order | Order direction not supported | Use: asc or desc |
| Invalid direction | Direction not supported | Use: forward or backward |