{
  "openapi": "3.1.0",
  "info": {
    "title": "DealSeoul Public API",
    "description": "Agent-readable, station-keyed Seoul commerce + venue data. Foreigner-friendly attribute fields (English menu, card acceptance, walk-in/reservation), nearest Metro station with line + distance, and ISO last_verified freshness signal. Designed for LLM apps and travel-tech partners that need executable Seoul local data, not generic web pages.",
    "version": "1.0.0",
    "termsOfService": "https://dealseoul.com/about",
    "contact": {
      "name": "DealSeoul",
      "url": "https://dealseoul.com",
      "email": "starryscript@gmail.com"
    },
    "license": {
      "name": "Editorial use; attribution required",
      "url": "https://dealseoul.com/about"
    }
  },
  "servers": [
    {
      "url": "https://dealseoul.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Site overview + agent manifest",
    "url": "https://dealseoul.com/llms-full.txt"
  },
  "tags": [
    {
      "name": "eats",
      "description": "Seoul restaurants: Michelin + canon picks. Station-anchored, foreigner-friendly attributes baked in."
    },
    {
      "name": "stations",
      "description": "Per-station rollup: every venue within walking distance (≤600m) of a Seoul Metro station, distance-sorted."
    },
    {
      "name": "popups",
      "description": "Live pop-up brand experiences in Seoul (sourced from editorial Google Sheet, ~10min CDN cache)."
    }
  ],
  "paths": {
    "/api/eats.json": {
      "get": {
        "tags": ["eats"],
        "summary": "List every restaurant",
        "description": "The full eats dataset in one call. Use when you want to ingest everything at once or filter on top.",
        "operationId": "listEats",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EatsListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/eats/{id}.json": {
      "get": {
        "tags": ["eats"],
        "summary": "Get one restaurant by id",
        "description": "Single restaurant: same item shape used inside /api/eats.json. The id is the slug shown in the listing endpoint.",
        "operationId": "getEat",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Restaurant slug (e.g. mingles, jungsik, gwangjang-market).",
            "schema": {
              "type": "string"
            },
            "example": "mingles"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EatPublic"
                }
              }
            }
          },
          "404": {
            "description": "Unknown slug"
          }
        }
      }
    },
    "/api/station/{slug}.json": {
      "get": {
        "tags": ["stations"],
        "summary": "Every venue within walking distance of a station",
        "description": "Per-station rollup. Returns every eat ≤600m from the station, sorted by distance ascending. Slug = English station name slugified (lowercase, hyphens).",
        "operationId": "getStationRollup",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Slugified Seoul Metro station name.",
            "schema": {
              "type": "string"
            },
            "example": "hongik-univ"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StationRollup"
                }
              }
            }
          },
          "404": {
            "description": "Unknown station slug"
          }
        }
      }
    },
    "/api/popups.json": {
      "get": {
        "tags": ["popups"],
        "summary": "Live pop-up experiences",
        "description": "Currently-live brand pop-ups in Seoul. Sheet-backed; new entries appear within ~10 minutes of the editorial team publishing.",
        "operationId": "listPopups",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Popup"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EatsListResponse": {
        "type": "object",
        "required": ["api_version", "generated_at", "site", "count", "items"],
        "properties": {
          "api_version": {
            "type": "string",
            "example": "1"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO timestamp of build (used as freshness signal alongside per-item last_verified)."
          },
          "site": {
            "type": "string",
            "example": "https://dealseoul.com"
          },
          "count": {
            "type": "integer",
            "example": 280
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EatPublic"
            }
          }
        }
      },
      "EatPublic": {
        "type": "object",
        "required": ["id", "url", "name", "cuisine", "category", "neighborhood", "price_level"],
        "properties": {
          "id": {
            "type": "string",
            "example": "mingles"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://dealseoul.com/eats/mingles"
          },
          "name": {
            "type": "string",
            "example": "Mingles"
          },
          "name_ko": {
            "type": ["string", "null"],
            "example": "밍글스"
          },
          "cuisine": {
            "type": "string",
            "example": "Modern Korean"
          },
          "category": {
            "type": "string",
            "enum": ["bbq", "hansik", "noodles", "rice-bowl", "stew-soup", "street-food", "fried-chicken", "seafood", "modern-korean", "japanese", "chinese", "italian", "western", "fusion", "vegetarian", "dessert", "cafe", "market"]
          },
          "category_label": {
            "type": "string",
            "example": "Hansik"
          },
          "neighborhood": {
            "type": "string",
            "example": "Cheongdam"
          },
          "price_level": {
            "type": "string",
            "enum": ["$", "$$", "$$$", "$$$$"]
          },
          "michelin": {
            "type": ["string", "null"],
            "enum": ["3-star", "2-star", "1-star", "bib-gourmand", "selected", null]
          },
          "michelin_label": {
            "type": ["string", "null"]
          },
          "michelin_green_star": {
            "type": "boolean"
          },
          "michelin_url": {
            "type": ["string", "null"],
            "format": "uri"
          },
          "lat": {
            "type": ["number", "null"]
          },
          "lng": {
            "type": ["number", "null"]
          },
          "nearest_station": {
            "oneOf": [
              { "type": "null" },
              {
                "type": "object",
                "properties": {
                  "name": { "type": "string", "example": "Hak-dong" },
                  "line_id": { "type": "string", "example": "line7" },
                  "line_number": { "type": "integer", "example": 7 },
                  "line_color": { "type": "string", "example": "#747F00" },
                  "distance_m": { "type": "integer", "example": 482 }
                }
              }
            ]
          },
          "exit": {
            "type": ["string", "null"],
            "example": "Exit 5"
          },
          "walk_minutes": {
            "type": ["integer", "null"],
            "example": 7
          },
          "english_menu": {
            "type": ["string", "null"],
            "enum": ["yes", "partial", "no", null]
          },
          "card_ok": {
            "type": ["string", "null"],
            "enum": ["yes", "no", null]
          },
          "reservation": {
            "type": ["string", "null"],
            "enum": ["required", "recommended", "walk-in", null]
          },
          "foreigner_tip": {
            "type": ["string", "null"]
          },
          "last_verified": {
            "type": ["string", "null"],
            "format": "date",
            "description": "ISO YYYY-MM-DD. Use as a freshness signal: older than 6 months means stale risk for hours/menu."
          },
          "description": {
            "type": "string"
          },
          "hook": {
            "type": ["string", "null"]
          },
          "image": {
            "type": ["string", "null"],
            "format": "uri"
          },
          "image_credit": {
            "type": ["string", "null"]
          },
          "tags": {
            "type": "array",
            "items": { "type": "string" }
          },
          "best_for": {
            "type": "array",
            "items": { "type": "string" }
          },
          "source": {
            "type": "string",
            "enum": ["michelin", "canon"]
          }
        }
      },
      "StationRollup": {
        "type": "object",
        "required": ["api_version", "generated_at", "site", "station", "items"],
        "properties": {
          "api_version": { "type": "string" },
          "generated_at": { "type": "string", "format": "date-time" },
          "site": { "type": "string" },
          "station": {
            "type": "object",
            "properties": {
              "slug": { "type": "string", "example": "hongik-univ" },
              "name": { "type": "string", "example": "Hongik Univ" },
              "lines": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": { "type": "string" },
                    "number": { "type": "integer" },
                    "color": { "type": "string" }
                  }
                }
              },
              "lat": { "type": "number" },
              "lng": { "type": "number" }
            }
          },
          "items": {
            "type": "array",
            "items": {
              "allOf": [
                { "$ref": "#/components/schemas/EatPublic" },
                {
                  "type": "object",
                  "properties": {
                    "distance_from_station_m": { "type": "integer" }
                  }
                }
              ]
            }
          }
        }
      },
      "Popup": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "brand": { "type": "string" },
          "venue": { "type": "string" },
          "neighborhood": { "type": "string" },
          "lat": { "type": ["number", "null"] },
          "lng": { "type": ["number", "null"] },
          "nearest_station": { "type": ["string", "null"] },
          "starts_on": { "type": "string", "format": "date" },
          "ends_on": { "type": "string", "format": "date" },
          "url": { "type": "string", "format": "uri" }
        }
      }
    }
  }
}
