{
  "openapi": "3.1.0",
  "info": {
    "title": "JobFairs.co.uk Deterministic Agent Search API",
    "version": "2.1.0",
    "summary": "Zero-auth, deterministic UK job fair calendar, multi-city comparison, and Career Fair OS discovery API.",
    "description": "Deterministic UK-wide job fair search API operated by The UK Careers Fair Limited (Company No. 11482834). Indexes 225 verified upcoming UK in-person and online recruitment events across 252 directory towns as of 2026-12-04, with zero authentication and zero PII storage. Full single-fetch RAG corpus available at https://jobfairs.co.uk/llms-full.txt.",
    "termsOfService": "https://jobfairs.co.uk/listing-policy/",
    "contact": {
      "name": "JobFairs.co.uk Editorial & Partnerships",
      "url": "https://jobfairs.co.uk/contact/"
    }
  },
  "servers": [
    {
      "url": "https://jobfairs.co.uk",
      "description": "Production UK Job Fairs Directory & Edge Search API"
    }
  ],
  "paths": {
    "/.well-known/search": {
      "get": {
        "operationId": "searchJobFairsGet",
        "summary": "Search upcoming UK job fairs, guides, or compare multiple UK cities (GET)",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text query: UK town/city, postcode/outcode (e.g. SW1A 1AA), venue, date window, sector, employer pricing question, or multi-city comparison phrase (e.g. \"Manchester vs Leeds\").",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "examples": {
              "city": {
                "summary": "City search",
                "value": "Manchester"
              },
              "comparison": {
                "summary": "Multi-city comparison",
                "value": "Manchester vs Leeds"
              },
              "postcode": {
                "summary": "UK postcode",
                "value": "SW1A 1AA"
              },
              "exhibitor": {
                "summary": "Exhibitor pricing",
                "value": "how much does it cost to exhibit at a UK job fair"
              }
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "Canonical UK town/city slug across all 252 directory towns (e.g. \"manchester\", \"leeds\", \"london\", \"belfast\").",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$"
            }
          },
          {
            "name": "cities",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of 2–6 canonical UK town/city slugs for deterministic multi-city comparison (e.g. \"manchester,leeds,sheffield\"), returning a structured comparison[] array.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+(?:,[a-z0-9-]+){1,5}$"
            },
            "example": "manchester,leeds,sheffield"
          },
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "description": "Filter results to one of the 12 UK job fair sector archetypes.",
            "schema": {
              "type": "string",
              "enum": [
                "flagship",
                "general_all_sectors",
                "nhs_healthcare",
                "defence_tech",
                "stem",
                "apprenticeships",
                "council_dwp",
                "university",
                "teaching",
                "graduate",
                "forces",
                "online"
              ]
            }
          },
          {
            "name": "radius",
            "in": "query",
            "required": false,
            "description": "Same-landmass commuter catchment radius in miles when paired with city or postcode (10, 25, 50 standard; 100 extended reach).",
            "schema": {
              "type": "integer",
              "enum": [
                10,
                25,
                50,
                100
              ],
              "default": 25
            }
          },
          {
            "name": "fair",
            "in": "query",
            "required": false,
            "description": "Exact public fair UID (e.g. \"flagship-manchester-2027-03-19\" or \"ext-...\").",
            "schema": {
              "type": "string",
              "maxLength": 160
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of ranked results to return (1–25).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 10
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Response format: compact LLM-ready Markdown (default) or structured JSON.",
            "schema": {
              "type": "string",
              "enum": [
                "markdown",
                "json"
              ],
              "default": "markdown"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deterministic search results and optional multi-city comparison array in Markdown or JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameters or malformed JSON request body."
          },
          "413": {
            "description": "Request body exceeded the 8 KiB limit."
          }
        }
      },
      "post": {
        "operationId": "searchJobFairsPost",
        "summary": "Search upcoming UK job fairs or compare multiple UK cities with a structured body (POST / X-HTTP-Method-Override: QUERY)",
        "parameters": [
          {
            "name": "X-HTTP-Method-Override",
            "in": "header",
            "required": false,
            "description": "Optional RFC 10008 compatibility header (\"QUERY\") for clients routing safe search bodies over POST.",
            "schema": {
              "type": "string",
              "enum": [
                "QUERY"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Structured JSON search request or plain-text query string (max 8 KiB).",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequestBody"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string",
                "maxLength": 300
              },
              "example": "NHS nursing fairs near Leeds within 25 miles"
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic search results and optional multi-city comparison array in Markdown or JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameters or malformed JSON request body."
          },
          "413": {
            "description": "Request body exceeded the 8 KiB limit."
          }
        }
      },
      "query": {
        "operationId": "searchJobFairsQuery",
        "summary": "RFC 10008 safe idempotent search with request body (QUERY)",
        "requestBody": {
          "required": true,
          "description": "Structured JSON search request or plain-text query string (max 8 KiB).",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequestBody"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string",
                "maxLength": 300
              },
              "example": "NHS nursing fairs near Leeds within 25 miles"
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic search results and optional multi-city comparison array in Markdown or JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameters or malformed JSON request body."
          },
          "413": {
            "description": "Request body exceeded the 8 KiB limit."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SearchRequestBody": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "q": {
            "type": "string",
            "maxLength": 300
          },
          "city": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "cities": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^[a-z0-9-]+(?:,[a-z0-9-]+){1,5}$"
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]+$"
                },
                "minItems": 2,
                "maxItems": 6
              }
            ]
          },
          "sector": {
            "type": "string",
            "enum": [
              "flagship",
              "general_all_sectors",
              "nhs_healthcare",
              "defence_tech",
              "stem",
              "apprenticeships",
              "council_dwp",
              "university",
              "teaching",
              "graduate",
              "forces",
              "online"
            ]
          },
          "radius": {
            "type": "integer",
            "enum": [
              10,
              25,
              50,
              100
            ],
            "default": 25
          },
          "fair": {
            "type": "string",
            "maxLength": 160
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 25,
            "default": 10
          },
          "format": {
            "type": "string",
            "enum": [
              "markdown",
              "json"
            ],
            "default": "markdown"
          }
        }
      },
      "CityComparisonEntry": {
        "type": "object",
        "required": [
          "city_slug",
          "city",
          "upcoming_count",
          "flagship_count",
          "city_hub_url",
          "prep_url",
          "ics_url"
        ],
        "properties": {
          "city_slug": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "upcoming_count": {
            "type": "integer",
            "minimum": 0
          },
          "flagship_count": {
            "type": "integer",
            "minimum": 0
          },
          "next_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "city_hub_url": {
            "type": "string",
            "format": "uri"
          },
          "prep_url": {
            "type": "string",
            "format": "uri"
          },
          "ics_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "CareerOsActions": {
        "type": "object",
        "properties": {
          "prep_url": {
            "type": "string",
            "format": "uri"
          },
          "rehearse_url": {
            "type": "string",
            "format": "uri"
          },
          "after_url": {
            "type": "string",
            "format": "uri"
          },
          "prep_index_url": {
            "type": "string",
            "format": "uri"
          },
          "hiring_planner_url": {
            "type": "string",
            "format": "uri"
          },
          "exhibitor_url": {
            "type": "string",
            "format": "uri"
          },
          "free_jobs_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "SearchResultItem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "url",
          "summary"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "event",
              "online",
              "city",
              "hub",
              "guide"
            ]
          },
          "uid": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "summary": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "end_date": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "city_slug": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "venue": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "organiser": {
            "type": "string"
          },
          "archetype": {
            "type": "string"
          },
          "distance_miles": {
            "type": "number"
          },
          "is_flagship_operator": {
            "type": "boolean"
          },
          "official_url": {
            "type": "string",
            "format": "uri"
          },
          "jobs_preview_url": {
            "type": "string",
            "format": "uri"
          },
          "city_hub_url": {
            "type": "string",
            "format": "uri"
          },
          "ics_url": {
            "type": "string",
            "format": "uri"
          },
          "prep_url": {
            "type": "string",
            "format": "uri"
          },
          "rehearse_url": {
            "type": "string",
            "format": "uri"
          },
          "after_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "SearchResponse": {
        "type": "object",
        "required": [
          "publisher",
          "query",
          "total_matches",
          "results",
          "career_os_actions"
        ],
        "properties": {
          "publisher": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "total_matches": {
            "type": "integer",
            "minimum": 0
          },
          "filters": {
            "type": "object"
          },
          "comparison": {
            "type": "array",
            "description": "Populated when ?cities= or a \"City A vs City B\" comparison query is supplied.",
            "items": {
              "$ref": "#/components/schemas/CityComparisonEntry"
            }
          },
          "career_os_actions": {
            "$ref": "#/components/schemas/CareerOsActions"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResultItem"
            }
          }
        }
      }
    }
  }
}
