{
  "openapi": "3.1.0",
  "info": {
    "title": "Foundplay games",
    "version": "1.0.0",
    "description": "Search the free browser games listed on Foundplay, made by independent creators, many of them with AI tools. Every game plays in a browser tab with no download."
  },
  "servers": [
    {
      "url": "https://foundplay.io"
    }
  ],
  "paths": {
    "/api/games": {
      "get": {
        "operationId": "searchGames",
        "summary": "Find games to play in a browser",
        "description": "Returns games matching the words in q (title, description or genre), most played first by default. Leave q empty to get the top games. Each game includes a link to its page.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Words to match, such as 'zombie shooter', 'racing', 'puzzle' or 'cozy farm'.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "genre",
            "in": "query",
            "required": false,
            "description": "Only games in this genre.",
            "schema": {
              "type": "string",
              "enum": [
                "action",
                "adventure",
                "arcade",
                "cozy",
                "horror",
                "platformer",
                "puzzle",
                "racing",
                "rpg",
                "shooter",
                "simulation",
                "sports",
                "strategy",
                "survival"
              ]
            }
          },
          {
            "name": "phone",
            "in": "query",
            "required": false,
            "description": "true for games with touch controls that play on a phone.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "multiplayer",
            "in": "query",
            "required": false,
            "description": "true for games people play together, online or on one screen.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "popular (most played), trending (most played in the last 48 hours) or new.",
            "schema": {
              "type": "string",
              "enum": [
                "popular",
                "trending",
                "new"
              ],
              "default": "popular"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many games to return, 1 to 25.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching games, plus Foundplay lists that answer the same question.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "description": "How many games matched in all."
                    },
                    "games": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "pitch": {
                            "type": "string",
                            "description": "One line about the game."
                          },
                          "url": {
                            "type": "string",
                            "description": "The game's page on Foundplay, with a Play button."
                          },
                          "type": {
                            "type": "string",
                            "description": "Original or Mashup."
                          },
                          "genres": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "multiplayer": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "true: people play it together. false: single-player. null: not known."
                          },
                          "phoneFriendly": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "true: plays on phones. false: needs a keyboard. null: not known."
                          },
                          "plays": {
                            "type": "integer"
                          },
                          "upvotes": {
                            "type": "integer"
                          },
                          "creatorX": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The creator's X handle, without @."
                          }
                        }
                      }
                    },
                    "lists": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "browseAll": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}