Get Public Game
Retrieve detailed information about a specific public game.
Endpoint
GET /api/v2/public/games/{slug}
Authentication
This endpoint is public and does not require authentication.
Description
This endpoint returns comprehensive information about a specific game, including name, description, visual assets, platforms, and social links.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | string | Yes | Unique identifier for the game |
Request Example
GET /api/v2/public/games/my-awesome-game
Response
Success Response (200)
{
"name": "My Awesome Game",
"slug": "my-awesome-game",
"description": "An amazing game with incredible features and stunning gameplay",
"color": "#FF5733",
"images": [
"https://example.com/game-screenshot1.jpg",
"https://example.com/game-screenshot2.jpg",
"https://example.com/game-logo.jpg"
],
"icon": "https://example.com/game-icon.png",
"tags": ["action", "multiplayer", "adventure"],
"socials": [
{
"platform": "twitter",
"url": "https://twitter.com/myawesomegame"
},
{
"platform": "discord",
"url": "https://discord.gg/myawesomegame"
}
],
"platforms": ["web", "mobile", "desktop"],
"createdAt": 1672531200000,
"updatedAt": 1704067200000
}
Error Response (404)
{
"message": "Game not found",
"status": 404
}
Error Response (400)
{
"message": "Invalid game slug",
"status": 400
}
Response Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Game name |
slug | string | Yes | URL-friendly game identifier |
description | string | Yes | Game description |
color | string | Yes | Game theme color (hex code) |
images | string[] | Yes | Array of game image URLs |
icon | string | No | Game icon URL (optional) |
tags | string[] | No | Array of game tags (optional) |
socials | object[] | No | Array of social media links (optional) |
platforms | string[] | Yes | Array of supported platforms |
createdAt | number | Yes | Creation date (Unix timestamp in ms) |
updatedAt | number | Yes | Last update date (Unix timestamp in ms) |
Social Media Object Fields
| Field | Type | Description |
|---|---|---|
platform | string | Social media platform name |
url | string | URL to the game's social media page |
Usage Example
const response = await fetch("https://api.intraverse.io/api/v2/public/games/my-awesome-game");
const game = await response.json();
console.log(`Game: ${game.name}`);
console.log(`Slug: ${game.slug}`);
console.log(`Description: ${game.description}`);
console.log(`Theme Color: ${game.color}`);
console.log(`Platforms: ${game.platforms.join(", ")}`);
console.log(`Images: ${game.images.length} available`);
if (game.tags && game.tags.length > 0) {
console.log(`Tags: ${game.tags.join(", ")}`);
}
if (game.socials && game.socials.length > 0) {
console.log("Social Links:");
game.socials.forEach((social) => {
console.log(`- ${social.platform}: ${social.url}`);
});
}
console.log(`Created: ${new Date(game.createdAt).toISOString()}`);
console.log(`Updated: ${new Date(game.updatedAt).toISOString()}`);
Error Handling
| Error | Description | Solution |
|---|---|---|
| Game not found | Game slug doesn't exist | Verify the game slug |
| Invalid slug | Slug format is incorrect | Use valid slug format |