Documentation
Two ways to add our games: paste an iframe, or build your pages from the JSON API. Both need an approved website.
Quick start
- 1Create a free account and confirm your email address.
- 2Add your website and prove it is yours (HTML tag, file or DNS record).
- 3Wait for our approval. We review every website by hand.
- 4Paste embed codes from the dashboard, or create an API key and import the catalogue.
Embedding a game
Every game is one iframe. Games load only inside pages of your approved domains (with and without "www"); anywhere else they show a notice instead.
<iframe src="https://games.oghnet.com/make-pizza/?lang=en" title="Make Pizza!" width="960" height="540" style="width:100%;height:auto;aspect-ratio:16/9;border:0" allow="fullscreen; autoplay; gamepad; accelerometer; gyroscope" allowfullscreen loading="lazy"></iframe>Address parameters
lang Language of the game. Without it the game follows the browser language. (en, de, es, fr, it, pt, ro, tr)
Good to know
- Keep the allow attribute and allowfullscreen: games use fullscreen, sound and gamepads.
- Do not wrap the iframe in a sandbox attribute that removes allow-scripts or allow-same-origin: progress is saved in the browser.
- Give the game room: at least 320 pixels wide on phones. The code keeps the proportions by itself.
- Do not cover the game with ads or other elements, and do not change it. See the publisher terms.
- The games are free of charge. They may show our logo and a link to our website.
API basics
https://oghnet.com/api/v1Authentication
Send your key in the Authorization header. Create keys in the dashboard. Call the API from your server: a key placed in a web page can be read by anyone.
Authorization: Bearer YOUR_API_KEYLimits and caching
Up to 120 requests per minute for each key. The catalogue changes a few times a week: fetch it once, store it in your database, and refresh it once or twice a day with updated_since.
Errors
Errors use the matching HTTP status and a JSON body with a code and a message.
{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key. Send it as \"Authorization: Bearer <key>\"."
}
}- 401 unauthorized
- The key is missing, wrong or revoked.
- 403 no_approved_site
- None of your websites is approved yet.
- 403 account_inactive
- The account is suspended or its email is not confirmed.
- 404 not_found
- No such game or endpoint.
- 422 invalid_parameter
- A parameter has a value we do not accept.
- 429 rate_limited
- Too many requests. Wait for the number of seconds in Retry-After.
Endpoints
GET/games
List of games, newest first. Paginated.
- lang
- Language of titles and texts. Default: en. Available: en, de, es, fr, it, pt, ro, tr.
- category
- Only games of this category (its id from /categories).
- q
- Only games whose title contains this text.
- sort
- Order: new, title, popular. Default: new.
- updated_since
- Only games added or changed since this date (ISO 8601).
- page
- Page number, from 1.
- per_page
- Games per page, 1 to 100. Default: 50.
GET/games/{id}
One game by its id, with the ready-made embed code (embed_html).
- lang
- Language of titles and texts. Default: en. Available: en, de, es, fr, it, pt, ro, tr.
GET/categories
Categories with the number of games in each.
- lang
- Language of titles and texts. Default: en. Available: en, de, es, fr, it, pt, ro, tr.
GET/me
Your account: websites and whether they may embed, and the available languages.
Game fields
- id
- Stable identifier of the game (also the last part of its address).
- title
- Name of the game in the requested language.
- description
- Short plain-text description.
- instructions
- How to play, as a list of short lines.
- language
- Language of the texts in this answer (falls back to English when the game is not translated).
- embed_url
- Address for the iframe src, with the language set.
- languages
- Languages the game itself is translated into.
- categories
- Category ids.
- aspect_ratio
- Proportions of the game area, width:height.
- orientation
- Preferred orientation on phones: any, landscape or portrait.
- mobile
- Whether the game plays well on phones and tablets.
- controls
- Input methods the game supports.
- allow
- Values for the allow attribute of the iframe.
- images
- thumbnail and thumbnail_large (16:9), cover_landscape (16:9) and cover_portrait (2:3). Copy them to your server or link them directly.
- preview_video
- Short silent gameplay video (MP4), ideal for hover previews. May be null.
- added_at
- When the game was published.
- updated_at
- When the game or its texts last changed.
Example
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://oghnet.com/api/v1/games/make-pizza?lang=en"{
"data": {
"id": "make-pizza",
"title": "Make Pizza!",
"description": "Run a pizzeria: stretch the dough, add sauce, cheese and toppings, bake it perfectly and serve every customer on time. Free to play in your browser.",
"instructions": [
"Read the customer's order.",
"Tap the dough 3 times to stretch it, then add the sauce and the mozzarella.",
"Add exactly the toppings the customer wants. Tap a piece on the pizza to remove it.",
"Bake it and take it out when the needle is in the green zone.",
"Serve it before the patience bar runs out."
],
"language": "en",
"embed_url": "https://games.oghnet.com/make-pizza/?lang=en",
"languages": [
"en",
"de",
"es",
"fr",
"it",
"pt",
"ro",
"tr"
],
"categories": [
"cooking",
"kids"
],
"aspect_ratio": "16:9",
"orientation": "any",
"mobile": true,
"controls": [
"mouse",
"touch"
],
"allow": [
"fullscreen",
"autoplay",
"gamepad",
"accelerometer",
"gyroscope"
],
"images": {
"thumbnail": "https://ogh.lol/storage/catalog/games/01a0fe94-7e1f-7186-9c2e-9e35e2266f34/thumb-h8dzao-640.webp",
"thumbnail_large": "https://ogh.lol/storage/catalog/games/01a0fe94-7e1f-7186-9c2e-9e35e2266f34/thumb-h8dzao-960.webp",
"cover_landscape": "https://games.oghnet.com/make-pizza/assets/cover-landscape.webp?v=1791133229",
"cover_portrait": "https://games.oghnet.com/make-pizza/assets/cover-portrait.webp?v=1791133229"
},
"preview_video": "https://games.oghnet.com/make-pizza/assets/preview.mp4?v=1791120836",
"added_at": "2026-10-02T21:45:41+00:00",
"updated_at": "2026-10-05T17:53:36+00:00",
"embed_html": "<iframe src=\"https://games.oghnet.com/make-pizza/?lang=en\" title=\"Make Pizza!\" width=\"960\" height=\"540\" style=\"width:100%;height:auto;aspect-ratio:16/9;border:0\" allow=\"fullscreen; autoplay; gamepad; accelerometer; gyroscope\" allowfullscreen loading=\"lazy\"></iframe>"
}
}<?php
// Run once or twice a day from cron. Keep the key outside the web root.
$key = getenv('OGH_API_KEY');
$base = 'https://oghnet.com/api/v1';
$page = 1;
do {
$ch = curl_init("$base/games?lang=en&per_page=100&page=$page");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer $key"],
CURLOPT_TIMEOUT => 20,
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status !== 200) {
exit("API error $status: " . ($answer['error']['message'] ?? 'unknown') . PHP_EOL);
}
foreach ($answer['data'] as $game) {
// Save or update the game in your database, by $game['id'].
save_game($game['id'], $game['title'], $game['description'], $game['embed_url'],
$game['images']['thumbnail'], $game['categories']);
}
} while ($page++ < $answer['meta']['pages']);Need help?
Something unclear or not working? Write to us and we will help you get the games running.
[email protected]