{
 "openapi": "3.1.0",
 "info": {
  "title": "Run It Local open data",
  "version": "1.1",
  "description": "Read-only, no auth. Static JSON refreshed daily ~6 AM PT, plus a search endpoint. For AI assistants, the MCP server at /mcp offers the same data as tools.",
  "contact": {
   "email": "feedback@folktechai.com"
  }
 },
 "servers": [
  {
   "url": "https://runitlocal.app"
  }
 ],
 "paths": {
  "/api/deals.json": {
   "get": {
    "operationId": "getDeals",
    "summary": "All tracked local-AI hardware prices",
    "responses": {
     "200": {
      "description": "Deals feed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "https://runitlocal.app/api/schema/deals.schema.json"
        }
       }
      }
     }
    }
   }
  },
  "/api/news.json": {
   "get": {
    "operationId": "getNews",
    "summary": "Recent local / on-prem / private AI news",
    "responses": {
     "200": {
      "description": "News feed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "https://runitlocal.app/api/schema/news.schema.json"
        }
       }
      }
     }
    }
   }
  },
  "/api/guides.json": {
   "get": {
    "operationId": "getGuides",
    "summary": "Every page on the site with title, description, section",
    "responses": {
     "200": {
      "description": "Guide list"
     }
    }
   }
  },
  "/api/search": {
   "get": {
    "operationId": "searchDeals",
    "summary": "Filter tracked deals (same logic as the MCP search_deals tool)",
    "parameters": [
     {
      "name": "category",
      "in": "query",
      "required": false,
      "description": "gpu | apple | box | ram | storage; comma-separate for several (box,apple)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "max_price",
      "in": "query",
      "required": false,
      "description": "Max price, USD",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "min_price",
      "in": "query",
      "required": false,
      "description": "Min price, USD",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "min_ram_gb",
      "in": "query",
      "required": false,
      "description": "Minimum system / unified memory (RAM kits: kit size)",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "min_vram_gb",
      "in": "query",
      "required": false,
      "description": "Minimum GPU VRAM",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "min_storage_gb",
      "in": "query",
      "required": false,
      "description": "Minimum storage in GB (1 TB = 1000): system SSD for boxes/Macs, capacity for SSD/NAS. Items with unknown storage are excluded.",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "min_bandwidth_gbps",
      "in": "query",
      "required": false,
      "description": "Minimum maker-published memory bandwidth, GB/s. Items with unknown bandwidth are excluded.",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "retailer",
      "in": "query",
      "required": false,
      "description": "Retailer name, case-insensitive substring",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "apple_line",
      "in": "query",
      "required": false,
      "description": "studio | mini | macpro | mbp",
      "schema": {
       "type": "string",
       "enum": [
        "studio",
        "mini",
        "macpro",
        "mbp"
       ]
      }
     },
     {
      "name": "query",
      "in": "query",
      "required": false,
      "description": "Words that must all appear in the product name",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "deals_only",
      "in": "query",
      "required": false,
      "description": "Only items flagged as a deal",
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "description": "price_asc (default) | price_desc | memory_desc | bandwidth (highest published bandwidth first; unknown last)",
      "schema": {
       "type": "string",
       "enum": [
        "price_asc",
        "price_desc",
        "memory_desc",
        "bandwidth"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "1-100, default 20",
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Matching deals",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/chips.json": {
   "get": {
    "operationId": "getChipSpecs",
    "summary": "Published memory-bandwidth specs per chip/GPU, each with the maker's source URL (not benchmarks)",
    "responses": {
     "200": {
      "description": "Chip table"
     }
    }
   }
  },
  "/mcp": {
   "post": {
    "operationId": "mcp",
    "summary": "MCP Streamable HTTP endpoint (JSON-RPC 2.0). Tools: search_deals, get_chip_specs, get_news, list_guides.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "JSON-RPC response"
     }
    }
   }
  }
 }
}
