{
  "openapi": "3.1.0",
  "info": {
    "title": "GulfPitch — startup funding in the Gulf",
    "description": "Read-only access to GulfPitch, the verified map of startup funding in the six GCC countries (Saudi Arabia, UAE, Qatar, Kuwait, Oman, Bahrain): VC funds, accelerators, grants, government programmes, angel networks, corporate VC, loans. Every entry is taken from the organisation's own website or application form and checked monthly.",
    "version": "1.0.0",
    "contact": { "name": "GulfPitch", "url": "https://gulfpitch.com/support" }
  },
  "servers": [{ "url": "https://gulfpitch.com" }],
  "paths": {
    "/api/v1/search": {
      "get": {
        "operationId": "searchGulfFunding",
        "summary": "Search GCC startup funding",
        "description": "Search the GulfPitch map. Returns name, what it gives, who can apply, cost (equity or not), status, application link and the GulfPitch page link for each match, ranked by fit (sector, stage, terms, open for applications).",
        "parameters": [
          { "name": "query", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Free words, e.g. 'fintech pre-seed', 'climate grant', 'women founders', 'German founder expanding to Saudi'" },
          { "name": "country", "in": "query", "required": false, "schema": { "type": "string", "enum": ["Saudi Arabia", "UAE", "Qatar", "Kuwait", "Oman", "Bahrain"] }, "description": "One GCC country" },
          { "name": "type", "in": "query", "required": false, "schema": { "type": "string" }, "description": "e.g. accelerator, VC, grant, government, angel, corporate, loan" },
          { "name": "stage", "in": "query", "required": false, "schema": { "type": "string", "enum": ["idea", "pre-seed", "seed", "series a", "series b", "growth"] } },
          { "name": "open_only", "in": "query", "required": false, "schema": { "type": "boolean" }, "description": "Only programmes that take applications now" },
          { "name": "no_equity", "in": "query", "required": false, "schema": { "type": "boolean" }, "description": "Only programmes that take no equity" },
          { "name": "from_abroad", "in": "query", "required": false, "schema": { "type": "boolean" }, "description": "Only programmes whose own site says founders from outside the country can apply" },
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 25, "default": 10 } }
        ],
        "responses": { "200": { "description": "Matches", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchResult" } } } } }
      }
    },
    "/api/v1/programme": {
      "get": {
        "operationId": "getGulfProgramme",
        "summary": "One programme in full",
        "description": "Everything GulfPitch has on one funder or programme, by name or GulfPitch id/slug: terms, eligibility, from-abroad rule with the quote and source, stages, ticket as published, application link, check month.",
        "parameters": [
          { "name": "name", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Name, GulfPitch id or page slug, e.g. 'Finspire' or 'sa-finspire'" }
        ],
        "responses": {
          "200": { "description": "The programme", "content": { "application/json": { "schema": { "type": "object", "properties": { "found": { "type": "boolean" }, "programme": { "$ref": "#/components/schemas/Programme" }, "source": { "type": "string" } } } } } },
          "404": { "description": "Not on the map" }
        }
      }
    },
    "/api/v1/deadlines": {
      "get": {
        "operationId": "getGulfDeadlines",
        "summary": "Published application deadlines",
        "description": "Programmes in the GCC with a published application deadline that has not passed yet, nearest first, with the application link.",
        "responses": { "200": { "description": "Deadlines", "content": { "application/json": { "schema": { "type": "object", "properties": {
          "count": { "type": "integer" },
          "deadlines": { "type": "array", "items": { "type": "object", "properties": {
            "name": { "type": "string" }, "type": { "type": "string" }, "country": { "type": "string" }, "closes": { "type": "string" }, "closes_text": { "type": "string" },
            "what": { "type": "string" }, "who": { "type": "string" }, "apply_url": { "type": "string" }, "gulfpitch_page": { "type": "string" } } } },
          "source": { "type": "string" } } } } } } }
      }
    }
  },
  "components": {
    "schemas": {
      "Programme": {
        "type": "object",
        "properties": {
          "id": { "type": "string" }, "name": { "type": "string" }, "country": { "type": "string" }, "type": { "type": "string" }, "category": { "type": "string" },
          "what": { "type": "string" }, "who": { "type": "string" }, "cost": { "type": "string" }, "status": { "type": "string" },
          "open_for_applications": { "type": "boolean" }, "apply_url": { "type": "string" }, "website": { "type": "string" }, "gulfpitch_page": { "type": "string" },
          "stages": { "type": "array", "items": { "type": "string" } }, "ticket_published": { "type": "string" }, "ticket_min_usd": { "type": "number" }, "ticket_max_usd": { "type": "number" },
          "sectors": { "type": "array", "items": { "type": "string" } }, "sector_agnostic": { "type": "boolean" },
          "from_abroad": { "type": "string" }, "from_abroad_text": { "type": "string" }, "from_abroad_condition": { "type": "string" }, "from_abroad_quote": { "type": "string" }, "from_abroad_source": { "type": "string" },
          "instrument": { "type": "string" }, "last_activity": { "type": "string" }, "last_activity_what": { "type": "string" }, "last_activity_source": { "type": "string" },
          "published_timeline": { "type": "string" }, "checked": { "type": "string" }, "matches": { "type": "array", "items": { "type": "string" } }
        }
      },
      "SearchResult": {
        "type": "object",
        "properties": {
          "total_matches": { "type": "integer" }, "shown": { "type": "integer" }, "map": { "type": "string" },
          "results": { "type": "array", "items": { "$ref": "#/components/schemas/Programme" } },
          "source": { "type": "string" }, "note": { "type": "string" }
        }
      }
    }
  }
}
