Developer Docs

SGA Reference

Integrate thousands of unblocked games directly into your frontend using the Sea Games Api (SGA) REST interface.

1. Authentication

Every request to the SGA requires a valid API key passed as a URL parameter. If the key is missing or invalid, the API will return an access denied error.

// Base URL
const API_URL = "https://winter-cake-e4ab.iloveramen661.workers.dev";

// Always append your key
const requestUrl = `${API_URL}?key=SEA_VSH2OKQZ5A`;

2. Endpoints

Fetch All Games (Library Overview)

To get the total count of games and the complete list, make a standard GET request to the base URL with your API key. This is perfect for building a total index or dynamic counters.

GET /?key=YOUR_KEY

Search Games

To filter games, append the search parameter. The API will return any game where the name partially matches the search string (case-insensitive).

GET /?key=YOUR_KEY&search=mario

3. The Response Object

The API responds with standard JSON. It includes a success boolean, the total count of games returned, and an array of games containing the metadata and CDN links required to embed them.

{ "success": true, "count": 1016, "games": [ { "name": "Super Mario 64", "COVER_URL": "https://cdn.example.com/images/mario64.webp", "HTML_URL": "https://cdn.example.com/games/mario64/index.html", "source": "truffled" }, ... ] }

4. Quick Start Example

Here is a basic JavaScript fetch template you can drop directly into your frontend to search the library and handle the data.

async function searchSGAGames(query) { const API_KEY = "SEA_VSH2OKQZ5A"; const WORKER_URL = "https://winter-cake-e4ab.iloveramen661.workers.dev"; try { const response = await fetch(`${WORKER_URL}?key=${API_KEY}&search=${query}`); const data = await response.json(); if (data.success) { console.log(`Found ${data.count} games!`); console.log(data.games); // Render your games here... } } catch (error) { console.error("API Connection Failed:", error); } }