{
  "openapi": "3.1.0",
  "x-last-updated": "2026-04-23",
  "info": {
    "title": "GigXchange Agent Search API",
    "description": "Public, read-only search API for the GigXchange live music marketplace. Find artists, venues, events, and gigs across the UK. No authentication required.",
    "version": "1.0.0",
    "contact": {
      "name": "GigXchange",
      "url": "https://gigxchange.app",
      "email": "support@gigxchange.app"
    }
  },
  "servers": [
    {
      "url": "https://qefkmyczznzbejcscfdm.supabase.co/functions/v1"
    }
  ],
  "paths": {
    "/agent-search": {
      "get": {
        "operationId": "searchGigXchange",
        "summary": "Search for artists, venues, events, or gigs",
        "description": "Search the GigXchange marketplace by type, city, genre, and budget. Returns max 20 results with direct URLs to public pages.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "description": "What to search for",
            "schema": {
              "type": "string",
              "enum": ["artists", "venues", "events", "gigs"]
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "UK city name (e.g. Leeds, London, Manchester)",
            "schema": { "type": "string" }
          },
          {
            "name": "genre",
            "in": "query",
            "required": false,
            "description": "Music genre (e.g. rock, jazz, covers, folk, electronic)",
            "schema": { "type": "string" }
          },
          {
            "name": "min_budget",
            "in": "query",
            "required": false,
            "description": "Minimum budget in GBP",
            "schema": { "type": "number" }
          },
          {
            "name": "max_budget",
            "in": "query",
            "required": false,
            "description": "Maximum budget in GBP",
            "schema": { "type": "number" }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": { "type": "string" },
                          "type": { "type": "string" },
                          "url": { "type": "string", "format": "uri" },
                          "city": { "type": "string" },
                          "genres": { "type": "array", "items": { "type": "string" } },
                          "fee_range": { "type": "string" },
                          "rating": { "type": "number" },
                          "reviews": { "type": "integer" },
                          "verified": { "type": "boolean" },
                          "image": { "type": "string", "format": "uri" }
                        }
                      }
                    },
                    "total": { "type": "integer" },
                    "query": { "type": "object" },
                    "source": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
