{
  "openapi": "3.1.0",
  "info": {
    "title": "Indie Collective community API",
    "version": "1.0.0",
    "description": "Read-only: indie games, studios, associations and events. Data under the ODbL 1.0 (https://opendatacommons.org/licenses/odbl/1-0/): credit “Indie Collective community”."
  },
  "servers": [
    {
      "url": "https://community.indieco.xyz/api/v1"
    }
  ],
  "paths": {
    "/games": {
      "get": {
        "summary": "Games, newest first",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "From the previous page’s `next`"
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            },
            "description": "Made by an organisation in this country"
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of games",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Game"
                      }
                    },
                    "next": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The next page, or null"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/games/{id}": {
      "get": {
        "summary": "A game, with its organisations, tags, events and timeline",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID or slug"
          }
        ],
        "responses": {
          "200": {
            "description": "Game",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Game"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/organizations": {
      "get": {
        "summary": "Studios and associations, newest first",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "From the previous page’s `next`"
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            },
            "description": "ISO 3166-1 alpha-2 code"
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "enum": [
                "studio",
                "association"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of organisations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Organization"
                      }
                    },
                    "next": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The next page, or null"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{id}": {
      "get": {
        "summary": "An organisation, with its games and hosted events",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID or slug"
          }
        ],
        "responses": {
          "200": {
            "description": "Organization",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Organization"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/events": {
      "get": {
        "summary": "Events: upcoming soonest first, or past latest first",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "From the previous page’s `next`"
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            },
            "description": "ISO 3166-1 alpha-2 code"
          },
          {
            "name": "organization",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Hosted by this organisation (ID)"
          },
          {
            "name": "upcoming",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      }
                    },
                    "next": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The next page, or null"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/events/{id}": {
      "get": {
        "summary": "An event, with its hosts and games",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID or slug"
          }
        ],
        "responses": {
          "200": {
            "description": "Event",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Event"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Game": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "about": {
            "type": [
              "string",
              "null"
            ]
          },
          "site": {
            "type": [
              "string",
              "null"
            ]
          },
          "igdb_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "organizations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                }
              }
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "milestones": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Organization": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          },
          "type": {
            "enum": [
              "studio",
              "association"
            ]
          },
          "status": {
            "enum": [
              "active",
              "hiatus",
              "closed"
            ]
          },
          "name": {
            "type": "string"
          },
          "about": {
            "type": [
              "string",
              "null"
            ]
          },
          "site": {
            "type": [
              "string",
              "null"
            ]
          },
          "bsky_handle": {
            "type": [
              "string",
              "null"
            ]
          },
          "place": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "country_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "latitude": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "longitude": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "games": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "about": {
            "type": [
              "string",
              "null"
            ]
          },
          "site": {
            "type": [
              "string",
              "null"
            ]
          },
          "ticket_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "starts_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "time_zone": {
            "type": "string"
          },
          "status": {
            "enum": [
              "ongoing",
              "canceled"
            ]
          },
          "attendance": {
            "enum": [
              "in_person",
              "online",
              "hybrid"
            ]
          },
          "online_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "place": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "country_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "latitude": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "longitude": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "previous_edition_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "organizations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "games": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    }
  }
}