{
  "openapi": "3.1.0",
  "info": {
    "title": "FastFlickPick public film search API",
    "version": "1.0.0",
    "description": "Read-only search over the FastFlickPick film catalogue (IMDb datasets, TMDB, JustWatch). No authentication. Personal recommendations are not part of this API. See https://www.fastflickpick.com/llms-full.txt for notes.",
    "contact": { "email": "info@fastflickpick.com", "url": "https://www.fastflickpick.com/" },
    "license": { "name": "Data for personal, non-commercial use; attribution required", "url": "https://www.fastflickpick.com/llms.txt" }
  },
  "servers": [ { "url": "https://www.fastflickpick.com" } ],
  "paths": {
    "/api/search.php": {
      "get": {
        "operationId": "searchFilms",
        "summary": "Search and rank films, or fetch catalogue metadata",
        "description": "Returns films matching all given filters, ranked by IMDb rating adjusted for vote count by default. With meta=1 returns genres, streaming regions/providers and countries instead.",
        "parameters": [
          { "name": "meta", "in": "query", "schema": { "type": "integer", "enum": [1] }, "description": "Return catalogue metadata instead of films." },
          { "name": "genre", "in": "query", "schema": { "type": "string" }, "description": "Comma separated genres; a film matches if it has any of them. Example: Comedy,Crime" },
          { "name": "exclude_genre", "in": "query", "schema": { "type": "string" }, "description": "Comma separated genres that must not be present." },
          { "name": "max_runtime", "in": "query", "schema": { "type": "integer", "minimum": 1 }, "description": "Maximum runtime in minutes." },
          { "name": "min_runtime", "in": "query", "schema": { "type": "integer", "minimum": 1 }, "description": "Minimum runtime in minutes." },
          { "name": "min_year", "in": "query", "schema": { "type": "integer" }, "description": "Earliest release year." },
          { "name": "max_year", "in": "query", "schema": { "type": "integer" }, "description": "Latest release year." },
          { "name": "min_rating", "in": "query", "schema": { "type": "number", "minimum": 0, "maximum": 10 }, "description": "Minimum IMDb rating." },
          { "name": "min_votes", "in": "query", "schema": { "type": "integer" }, "description": "Minimum number of IMDb votes." },
          { "name": "country", "in": "query", "schema": { "type": "string" }, "description": "Comma separated ISO 3166-1 alpha-2 production countries (any)." },
          { "name": "exclude_country", "in": "query", "schema": { "type": "string" }, "description": "Comma separated production countries to exclude." },
          { "name": "region", "in": "query", "schema": { "type": "string" }, "description": "Streaming region (ISO code, see meta=1), used together with provider." },
          { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Comma separated streaming provider names or ids; only films in a subscription of one of them are returned." },
          { "name": "q", "in": "query", "schema": { "type": "string" }, "description": "Substring of the title." },
          { "name": "director", "in": "query", "schema": { "type": "string" }, "description": "Substring of a director's name." },
          { "name": "sort", "in": "query", "schema": { "type": "string", "enum": ["quality", "rating", "votes", "year", "runtime"], "default": "quality" } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } },
          { "name": "offset", "in": "query", "schema": { "type": "integer", "minimum": 0, "default": 0 } }
        ],
        "responses": {
          "200": { "description": "Search result (or metadata when meta=1).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchResult" } } } },
          "400": { "description": "Invalid parameter." },
          "429": { "description": "Rate limit (60 requests per minute per IP); see Retry-After." },
          "503": { "description": "Catalogue not built yet." }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Film": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "example": "tt0111161" },
          "title": { "type": "string" },
          "year": { "type": "integer" },
          "runtime_minutes": { "type": "integer" },
          "genres": { "type": "array", "items": { "type": "string" } },
          "imdb_rating": { "type": "number" },
          "imdb_votes": { "type": "integer" },
          "directors": { "type": "array", "items": { "type": "string" } },
          "countries": { "type": "array", "items": { "type": "string" } },
          "cast": { "type": "array", "items": { "type": "string" } },
          "keywords": { "type": "array", "items": { "type": "string" } },
          "writers": { "type": "array", "items": { "type": "string" } },
          "streaming_subscription": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } }, "description": "Region code to provider names (subscription offers only)." },
          "imdb_url": { "type": "string", "format": "uri" }
        }
      },
      "SearchResult": {
        "type": "object",
        "properties": {
          "total": { "type": "integer" }, "offset": { "type": "integer" }, "limit": { "type": "integer" }, "sort": { "type": "string" },
          "films": { "type": "array", "items": { "$ref": "#/components/schemas/Film" } },
          "open_in_app": { "type": "string", "format": "uri" },
          "license": { "type": "string" }
        }
      }
    }
  }
}