๐ŸŽฎ Games API Documentation

RESTful API for accessing gaming console and variation data.

๐Ÿ” Authentication

All API requests require authentication using an API key in the Authorization header:

Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5

Base URL: https://api.getgames.app

โšก Rate Limiting

API requests are limited to 120 requests per minute per IP address to ensure service reliability.

Rate limit headers:

X-RateLimit-Limit: 120
X-RateLimit-Remaining: 119
X-RateLimit-Reset: 1754744061

429 Too Many Requests: {"error": "Rate limit exceeded", "message": "Too many requests. Maximum 120 requests per minute allowed.", "retry_after": 60}

๐Ÿงช API Tester

Test any endpoint directly from this page:

๐Ÿ“‹ Available Endpoints

GET /api/consoles

Retrieve all gaming consoles.

curl -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" https://api.getgames.app/api/consoles
Response:
[
  {"id": 1, "name": "Nintendo Switch"},
  {"id": 2, "name": "Nintendo Switch 2"},
  {"id": 3, "name": "PlayStation 5"}
]
GET /api/console/{id}

Retrieve a specific console information only.

curl -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" https://api.getgames.app/api/console/1
Response:
{
  "id": 1,
  "name": "Nintendo Switch"
}
GET /api/console/{id}/variations

Retrieve all variations for a specific console.

curl -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" https://api.getgames.app/api/console/1/variations
Response:
[
  {
    "id": 1,
    "variation_name": "OLED - White",
    "console_id": 1,
    "release_date": "2021-10-08",
    "product_code": "HEG-KAAAA-EUR",
    "upc": "",
    "base_console": "Nintendo Switch",
    "region_name": "Europe"
  }
]
GET /api/variations

Retrieve all variations across all consoles.

curl -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" https://api.getgames.app/api/variations
Response:
[
  {
    "id": 1,
    "variation_name": "OLED - White",
    "console_id": 1,
    "product_code": "HEG-KAAAA-EUR",
    "upc": "",
    "base_console": "Nintendo Switch",
    "region_id": 1,
    "release_date": "2021-10-08",
    "region_short_name": "EU",
    "region_name": "Europe"
  }
]
GET /api/variation/{id}

Retrieve a specific variation by ID.

curl -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" https://api.getgames.app/api/variation/1
Response:
{
  "id": 1,
  "name": "OLED - White",
  "console_id": 1,
  "release_date": "2021-10-08",
  "product_code": "HEG-KAAAA-EUR",
  "upc": "",
  "base_console": "Nintendo Switch",
  "region_short_name": "EU",
  "region_name": "Europe"
}
GET /api/regions

Retrieve all available regions.

curl -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" https://api.getgames.app/api/regions
Response:
[
  {"id": 1, "name": "Europe", "short_name": "EU"},
  {"id": 2, "name": "North America", "short_name": "US"},
  {"id": 3, "name": "Japan", "short_name": "JP"}
]
GET /api/manufacturers

Retrieve all console manufacturers.

curl -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" https://api.getgames.app/api/manufacturers
Response:
[
  {"id": 1, "name": "Nintendo"},
  {"id": 2, "name": "Sony"},
  {"id": 3, "name": "Microsoft"}
]
GET /api/variations/upc/{upc_code}

Search for variations by UPC code. Perfect for barcode scanning in mobile apps.

curl -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" https://api.getgames.app/api/variations/upc/045496453572
Response:
[
  {
    "id": 4,
    "variation_name": "OLED - The Legend of Zelda: Tears of the Kingdom Edition",
    "console_id": 1,
    "product_code": "HEG-KDAAA-EUR",
    "upc": "045496453572",
    "base_console": "Nintendo Switch",
    "region_id": 1,
    "release_date": "2023-04-28",
    "region_short_name": "EU",
    "region_name": "Europe"
  }
]

Note: Returns empty array [] if no variations found with the given UPC.

๐Ÿ” Barcode Mapping API

Crowdsourced UPC to TGDB game ID mapping system. Submit barcodes from your app and query approved mappings.

POST /api/barcode

Submit barcode(s) with TGDB game ID for admin review. Supports both single and batch submissions.

Single submission:

curl -X POST -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" \ -H "Content-Type: application/json" \ -d '{ "upc": "045496730451", "tgdb_game_id": 12345, "title": "The Legend of Zelda: Breath of the Wild", "original_title": null, "platform_name": "Nintendo Switch", "source": "ios_app" }' \ https://api.getgames.app/api/barcode
Response:
{
  "message": "Barcode submitted successfully",
  "submission_id": 42
}

Batch submission:

curl -X POST -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" \ -H "Content-Type: application/json" \ -d '{ "submissions": [ { "upc": "045496730451", "tgdb_game_id": 12345, "title": "Game Title", "platform_name": "Nintendo Switch" }, { "upc": "885370107043", "tgdb_game_id": 67890, "title": "Another Game", "platform_name": "PlayStation 5" } ] }' \ https://api.getgames.app/api/barcode
Response:
{
  "message": "Barcodes submitted successfully",
  "count": 2
}
GET /api/barcode/{upc}

Query approved barcode mappings. Returns all TGDB game IDs associated with a UPC (one-to-many relationship).

curl -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" https://api.getgames.app/api/barcode/045496730451
Response:
{
  "upc": "045496730451",
  "mappings": [
    {
      "id": 1,
      "upc": "045496730451",
      "tgdb_game_id": 12345,
      "times_queried": 42,
      "source": "import",
      "created_at": "2025-01-15 10:30:00",
      "updated_at": "2025-01-15 10:30:00"
    }
  ],
  "count": 1
}

Note: Returns empty array in mappings if no approved mappings exist for the UPC.

GET /api/barcode/stats

Get statistics about pending submissions and approved mappings.

curl -H "Authorization: Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5" https://api.getgames.app/api/barcode/stats
Response:
{
  "pending_submissions": 15,
  "approved_mappings": 30542
}

โŒ Error Responses

The API returns clean error responses with appropriate HTTP status codes:

401 Unauthorized: {"error": "Invalid API key"}
404 Not Found: {"error": "Console not found"}
400 Bad Request: {"error": "Invalid console ID"}

๐Ÿ“ฑ iOS Integration

Perfect for mobile apps! All responses are in clean JSON format with consistent structure.

๐Ÿ” Barcode Scanning: Use the UPC search endpoint with barcode scanner libraries like AVFoundation to instantly lookup variations by scanning their UPC codes.

// Swift example - UPC search after barcode scan let upc = "045496453572" // From barcode scanner let url = "https://api.getgames.app/api/variations/upc/\(upc)" let headers = ["Authorization": "Bearer QxEdkx4hpQowXMNSbJr9agO2b1G6RQPZ6CwfMBGcrDyvUos5"] URLSession.shared.dataTask(with: request) { data, response, error in // Returns array of matching variations or empty array if no matches }