{
  "openapi": "3.1.0",
  "info": {
    "title": "Yeah Called It public API",
    "version": "1.0.0",
    "description": "Read-only data from Called It, the free sports prediction game. Calls lock at kickoff, and the crowd's YES/NO split is never published before kickoff: before then, endpoints return call counts and activity only. Counts and splits include Called It's AI crowd where labelled (calls.ai_crowd > 0); every split also gives players and the AI crowd separately, and accuracy figures labelled players_* cover real players only. Times are ISO 8601 with timezone. CORS is open for GET. Responses are cached at the edge; please keep to about two requests a second."
  },
  "servers": [
    {
      "url": "https://yeahcalledit.com"
    }
  ],
  "paths": {
    "/api/public/fixtures/{slug}": {
      "get": {
        "summary": "One fixture with its questions",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-10-25-brentford-v-coventry-city"
          }
        ],
        "responses": {
          "200": {
            "description": "The fixture",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fixture": {
                      "type": "object",
                      "properties": {
                        "slug": {
                          "type": "string",
                          "example": "2026-10-25-brentford-v-coventry-city"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "competition": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "slug": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "key",
                            "name"
                          ]
                        },
                        "season": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "round": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "home_team": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "slug"
                          ]
                        },
                        "away_team": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "slug"
                          ]
                        },
                        "kickoff_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "pre_lock",
                            "locked",
                            "final"
                          ]
                        },
                        "result": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Score, e.g. \"2-1\", once final."
                        },
                        "calls": {
                          "type": "object",
                          "description": "total includes the AI crowd where ai_crowd > 0.",
                          "properties": {
                            "total": {
                              "type": "integer"
                            },
                            "last_hour": {
                              "type": "integer"
                            },
                            "players": {
                              "type": "integer"
                            },
                            "ai_crowd": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "total"
                          ]
                        }
                      },
                      "required": [
                        "slug",
                        "url",
                        "competition",
                        "home_team",
                        "away_team",
                        "kickoff_at",
                        "state",
                        "calls"
                      ]
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "question": {
                            "type": "string"
                          },
                          "difficulty": {
                            "type": "string",
                            "enum": [
                              "easy",
                              "medium",
                              "hard",
                              "very_hard"
                            ]
                          },
                          "calls": {
                            "type": "object",
                            "description": "total includes the AI crowd where ai_crowd > 0.",
                            "properties": {
                              "total": {
                                "type": "integer"
                              },
                              "last_hour": {
                                "type": "integer"
                              },
                              "players": {
                                "type": "integer"
                              },
                              "ai_crowd": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "total"
                            ]
                          },
                          "room": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "divided",
                              "lopsided",
                              null
                            ],
                            "description": "Coarse, pre-kickoff only, 50+ calls."
                          },
                          "split": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Always null before kickoff (the hidden-split rule).",
                            "properties": {
                              "yes_pct": {
                                "type": "integer"
                              },
                              "no_pct": {
                                "type": "integer"
                              },
                              "outcome": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "enum": [
                                  "yes",
                                  "no",
                                  "void",
                                  null
                                ]
                              },
                              "called_pct": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "Share of all callers (players and AI crowd) whose call matched the result."
                              },
                              "players": {
                                "type": "object",
                                "properties": {
                                  "calls": {
                                    "type": "integer"
                                  },
                                  "yes_pct": {
                                    "type": [
                                      "integer",
                                      "null"
                                    ]
                                  },
                                  "called_pct": {
                                    "type": [
                                      "integer",
                                      "null"
                                    ]
                                  }
                                }
                              },
                              "ai_crowd": {
                                "type": "object",
                                "properties": {
                                  "calls": {
                                    "type": "integer"
                                  },
                                  "yes_pct": {
                                    "type": [
                                      "integer",
                                      "null"
                                    ]
                                  },
                                  "called_pct": {
                                    "type": [
                                      "integer",
                                      "null"
                                    ]
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "split_policy": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such fixture",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/public/sports/{league}/round/{n}": {
      "get": {
        "summary": "Every fixture in a competition round",
        "parameters": [
          {
            "name": "league",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "premier-league"
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": 10
          }
        ],
        "responses": {
          "200": {
            "description": "The round",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "competition": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "slug": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "name"
                      ]
                    },
                    "season": {
                      "type": "string"
                    },
                    "round": {
                      "type": "integer"
                    },
                    "stats": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "fixtures": {
                          "type": "integer"
                        },
                        "calls_locked": {
                          "type": "integer"
                        },
                        "crowd_accuracy_pct": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "boldest_called_pct": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      }
                    },
                    "fixtures": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string",
                                "example": "2026-10-25-brentford-v-coventry-city"
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "competition": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "slug": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "key",
                                  "name"
                                ]
                              },
                              "season": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "round": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "home_team": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "slug": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name",
                                  "slug"
                                ]
                              },
                              "away_team": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "slug": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name",
                                  "slug"
                                ]
                              },
                              "kickoff_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "pre_lock",
                                  "locked",
                                  "final"
                                ]
                              },
                              "result": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Score, e.g. \"2-1\", once final."
                              },
                              "calls": {
                                "type": "object",
                                "description": "total includes the AI crowd where ai_crowd > 0.",
                                "properties": {
                                  "total": {
                                    "type": "integer"
                                  },
                                  "last_hour": {
                                    "type": "integer"
                                  },
                                  "players": {
                                    "type": "integer"
                                  },
                                  "ai_crowd": {
                                    "type": "integer"
                                  }
                                },
                                "required": [
                                  "total"
                                ]
                              }
                            },
                            "required": [
                              "slug",
                              "url",
                              "competition",
                              "home_team",
                              "away_team",
                              "kickoff_at",
                              "state",
                              "calls"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "headline_split": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "description": "Always null before kickoff (the hidden-split rule).",
                                "properties": {
                                  "yes_pct": {
                                    "type": "integer"
                                  },
                                  "no_pct": {
                                    "type": "integer"
                                  },
                                  "outcome": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "enum": [
                                      "yes",
                                      "no",
                                      "void",
                                      null
                                    ]
                                  },
                                  "called_pct": {
                                    "type": [
                                      "integer",
                                      "null"
                                    ],
                                    "description": "Share of all callers (players and AI crowd) whose call matched the result."
                                  },
                                  "players": {
                                    "type": "object",
                                    "properties": {
                                      "calls": {
                                        "type": "integer"
                                      },
                                      "yes_pct": {
                                        "type": [
                                          "integer",
                                          "null"
                                        ]
                                      },
                                      "called_pct": {
                                        "type": [
                                          "integer",
                                          "null"
                                        ]
                                      }
                                    }
                                  },
                                  "ai_crowd": {
                                    "type": "object",
                                    "properties": {
                                      "calls": {
                                        "type": "integer"
                                      },
                                      "yes_pct": {
                                        "type": [
                                          "integer",
                                          "null"
                                        ]
                                      },
                                      "called_pct": {
                                        "type": [
                                          "integer",
                                          "null"
                                        ]
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        ]
                      }
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown competition or round",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/public/trending": {
      "get": {
        "summary": "Upcoming fixtures ranked by calls in the last hour",
        "parameters": [
          {
            "name": "competition",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "epl"
          }
        ],
        "responses": {
          "200": {
            "description": "Trending fixtures",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "trending": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "rank": {
                            "type": "integer"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "competition": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            }
                          },
                          "home_team": {
                            "type": "string"
                          },
                          "away_team": {
                            "type": "string"
                          },
                          "kickoff_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "calls": {
                            "type": "object",
                            "description": "total includes the AI crowd where ai_crowd > 0.",
                            "properties": {
                              "total": {
                                "type": "integer"
                              },
                              "last_hour": {
                                "type": "integer"
                              },
                              "players": {
                                "type": "integer"
                              },
                              "ai_crowd": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "total"
                            ]
                          }
                        }
                      }
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}