List Active Games
GET /v1/gamesReturns all active game mechanics available for users to play.
Authentication
Section titled “Authentication”| Header | Required | Value |
|---|---|---|
X-API-Key | Yes | Your public key |
Request Examples
Section titled “Request Examples”curl -X GET https://api.gamifyhost.com/v1/games \ -H "X-API-Key: pk_live_your_public_key"const response = await fetch('https://api.gamifyhost.com/v1/games', { method: 'GET', headers: { 'X-API-Key': 'pk_live_your_public_key', },});
const data = await response.json();console.log(data.data); // Array of active gamesimport requests
response = requests.get( "https://api.gamifyhost.com/v1/games", headers={"X-API-Key": "pk_live_your_public_key"},)
data = response.json()print(data["data"]) # List of active gamesimport java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.gamifyhost.com/v1/games")) .header("X-API-Key", "pk_live_your_public_key") .GET() .build();
HttpResponse<String> response = client.send( request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());req, _ := http.NewRequest("GET", "https://api.gamifyhost.com/v1/games", nil)req.Header.Set("X-API-Key", "pk_live_your_public_key")
resp, err := http.DefaultClient.Do(req)if err != nil { log.Fatal(err)}defer resp.Body.Close()
var result map[string]interface{}json.NewDecoder(resp.Body).Decode(&result)fmt.Println(result["data"])$ch = curl_init('https://api.gamifyhost.com/v1/games');curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'X-API-Key: pk_live_your_public_key', ],]);
$response = curl_exec($ch);curl_close($ch);
$data = json_decode($response, true);print_r($data['data']);require 'net/http'require 'json'
uri = URI('https://api.gamifyhost.com/v1/games')req = Net::HTTP::Get.new(uri)req['X-API-Key'] = 'pk_live_your_public_key'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http| http.request(req)enddata = JSON.parse(res.body)puts data['data']using var client = new HttpClient();client.DefaultRequestHeaders.Add("X-API-Key", "pk_live_your_public_key");
var response = await client.GetAsync("https://api.gamifyhost.com/v1/games");var json = await response.Content.ReadAsStringAsync();Console.WriteLine(json);import 'dart:convert';import 'package:http/http.dart' as http;
final response = await http.get( Uri.parse('https://api.gamifyhost.com/v1/games'), headers: {'X-API-Key': 'pk_live_your_public_key'},);
final data = jsonDecode(response.body);print(data['data']);Response
Section titled “Response”Status: 200 OK
{ "message": "Active games retrieved", "code": 200, "status": "success", "data": [ { "gameType": "NEON_WHEEL", "name": "Neon Wheel", "description": "Spin the neon wheel to win rewards", "pointsToUnlock": 100, "status": "ACTIVE", "imageUrl": "https://res.cloudinary.com/.../neon-wheel.jpg" }, { "gameType": "COSMIC_SLOTS", "name": "Cosmic Slots", "description": "Match cosmic symbols for prizes", "pointsToUnlock": 150, "status": "ACTIVE", "imageUrl": "https://res.cloudinary.com/.../cosmic-slots.jpg" }, { "gameType": "ENIGMA_BOXES", "name": "Enigma Boxes", "description": "Pick a mystery box to reveal your reward", "pointsToUnlock": 100, "status": "ACTIVE", "imageUrl": "https://res.cloudinary.com/.../enigma-boxes.jpg" } ]}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
gameType | string | One of NEON_WHEEL, COSMIC_SLOTS, ENIGMA_BOXES |
name | string | Display name |
description | string | Short description |
pointsToUnlock | integer | Points required to play once |
status | string | Always ACTIVE for this endpoint |
imageUrl | string | Optional cover image URL |