{
  "openapi": "3.1.0",
  "info": {
    "title": "GitHired API",
    "version": "1.0.0",
    "summary": "Public read-only API for Canada-eligible technology jobs",
    "description": "Search employer-ATS jobs that GitHired has confirmed as Canada-eligible. Salaries are advertised annual base only — never estimated. No authentication required.",
    "contact": {
      "name": "GitHired",
      "url": "https://githired.ca"
    },
    "license": {
      "name": "See repository",
      "url": "https://github.com/mikegianfelice/GitHired"
    }
  },
  "servers": [
    {
      "url": "https://api.githired.ca",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "summary": "Service and dataset health",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "Health payload (`status` may be ok or degraded when the dataset is stale)"
          }
        }
      }
    },
    "/api/v1/stats": {
      "get": {
        "summary": "Dataset statistics",
        "operationId": "getStats",
        "responses": {
          "200": {
            "description": "Aggregate counts for tracked employers (not a labour-market census)"
          }
        }
      }
    },
    "/api/v1/companies": {
      "get": {
        "summary": "Tracked employers",
        "operationId": "listCompanies",
        "responses": {
          "200": {
            "description": "Employers with active Canada-eligible job counts"
          }
        }
      }
    },
    "/api/v1/jobs": {
      "get": {
        "summary": "Search jobs",
        "operationId": "searchJobs",
        "parameters": [
          { "name": "q", "in": "query", "schema": { "type": "string" }, "example": "data engineer" },
          { "name": "location", "in": "query", "schema": { "type": "string" } },
          { "name": "province", "in": "query", "schema": { "type": "string" }, "example": "ON" },
          { "name": "remote", "in": "query", "schema": { "type": "boolean" } },
          { "name": "work_mode", "in": "query", "schema": { "type": "string", "enum": ["remote", "hybrid", "onsite"] } },
          { "name": "salary_min", "in": "query", "schema": { "type": "number" }, "description": "Minimum advertised annual base (CAD-normalized)", "example": 150000 },
          { "name": "salary_max", "in": "query", "schema": { "type": "number" } },
          { "name": "salary_disclosed", "in": "query", "schema": { "type": "boolean" } },
          { "name": "seniority", "in": "query", "schema": { "type": "string" }, "example": "senior" },
          { "name": "company", "in": "query", "schema": { "type": "string" } },
          { "name": "sort", "in": "query", "schema": { "type": "string", "enum": ["relevance", "salary", "freshness"] } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 50 }, "example": 10 },
          { "name": "cursor", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Matching Canada-eligible jobs",
            "content": {
              "application/json": {
                "example": {
                  "total": 49,
                  "limit": 2,
                  "next_cursor": "Mg==",
                  "dataset_id": "7b762b6f4c074978",
                  "generated_at": "2026-11-09T13:35:15Z",
                  "dataset_fresh": true,
                  "salary_filter_note": "salary_min/salary_max filter advertised annual base pay only (CAD-normalized). Estimates are never used.",
                  "jobs": [
                    {
                      "id": "82d4aa797f949b4f",
                      "title": "Senior Staff Data Engineer",
                      "company": "Cohere",
                      "location": "Toronto (Remote)",
                      "work_arrangement": "remote",
                      "salary_min": 275000,
                      "salary_max": 450000,
                      "salary_currency": "USD",
                      "salary_available": true,
                      "salary_max_cad": 607500,
                      "apply_url": "https://jobs.ashbyhq.com/cohere/4ef5101e-b083-49cd-808a-54c754d159e5/application",
                      "last_verified": "2026-11-09"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}": {
      "get": {
        "summary": "Get job by id",
        "operationId": "getJob",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": { "description": "Job detail including description excerpt" },
          "404": {
            "description": "Unknown id",
            "content": {
              "application/json": {
                "example": { "error": "not_found", "message": "No job with id nope" }
              }
            }
          },
          "429": { "description": "Rate limited" }
        }
      }
    },
    "/api/v1/match": {
      "post": {
        "summary": "Deterministic profile match",
        "operationId": "matchProfile",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "skills": { "type": "array", "items": { "type": "string" } },
                  "years_experience": { "type": "number" },
                  "preferred_roles": { "type": "array", "items": { "type": "string" }, "description": "Matched by role-family tokens, not exact title equality" },
                  "preferred_locations": { "type": "array", "items": { "type": "string" } },
                  "remote_preference": { "type": "boolean", "description": "Legacy: true → remote-only when work_arrangements omitted" },
                  "work_arrangements": { "type": "array", "items": { "type": "string", "enum": ["remote", "hybrid", "onsite"] }, "description": "Hard allow-list; overrides remote_preference" },
                  "minimum_salary": { "type": "number", "description": "CAD-normalized annual base floor" },
                  "salary_mode": { "type": "string", "enum": ["strict", "flexible"], "description": "Default flexible (max may meet floor). strict requires advertised min ≥ floor." },
                  "seniority": { "type": "string" },
                  "limit": { "type": "integer" }
                }
              },
              "example": {
                "skills": ["Python", "Spark", "Airflow"],
                "preferred_roles": ["Senior Data Engineer"],
                "years_experience": 6,
                "work_arrangements": ["remote", "hybrid"],
                "minimum_salary": 150000,
                "salary_mode": "flexible",
                "seniority": "senior",
                "limit": 5
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Ranked matches with explanations (not stored)" }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP Streamable HTTP JSON-RPC endpoint",
        "operationId": "mcpJsonRpc",
        "description": "Standards-oriented MCP endpoint exposing search_jobs, get_job, match_profile, get_market_stats.",
        "responses": {
          "200": { "description": "JSON-RPC response" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Job": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "company": { "type": "string" },
          "location": { "type": "string" },
          "province": { "type": ["string", "null"] },
          "work_arrangement": { "type": "string" },
          "remote_scope": { "type": "string" },
          "salary_available": { "type": "boolean" },
          "salary_kind": { "type": "string", "enum": ["advertised_base", "undisclosed"] },
          "apply_url": { "type": "string", "format": "uri" },
          "last_verified": { "type": "string" }
        }
      }
    }
  }
}
