{
  "openapi": "3.1.0",
  "info": {
    "title": "Khau Gully Curated Food Trails API",
    "description": "Official API for Khau Gully: query curated walking food trails, top-rated dishes, restaurants, and universal app links across 17 global culinary capitals.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://khaugully.app"
    }
  ],
  "paths": {
    "/api/v1/cities": {
      "get": {
        "operationId": "listCities",
        "summary": "List all 17 supported global food cities and curated trails",
        "description": "Returns all 17 culinary capitals (Tokyo, Bangkok, Shanghai, Mexico City, London, New York, etc.) with their trail titles and IDs.",
        "responses": {
          "200": {
            "description": "List of cities with curated trails",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": { "type": "integer" },
                    "cities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": { "type": "string" },
                          "name": { "type": "string" },
                          "flag": { "type": "string" },
                          "tagline": { "type": "string" },
                          "trail_id": { "type": "string" },
                          "trail_title": { "type": "string" },
                          "stops_count": { "type": "integer" },
                          "guide_url": { "type": "string" },
                          "trail_url": { "type": "string" },
                          "universal_link": { "type": "string" },
                          "app_scheme": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trails": {
      "get": {
        "operationId": "getTrail",
        "summary": "Get curated 5-stop walking food trail for a city",
        "description": "Retrieves the sequential 5 stops, ranked dishes, restaurants, neighborhood areas, curator scores, GPS coordinates, and deep links for a specified city.",
        "parameters": [
          {
            "name": "city",
            "in": "query",
            "required": true,
            "description": "City name or id, e.g. 'tokyo', 'shanghai', 'mexico_city', 'london', 'mumbai', 'paris'",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "diet",
            "in": "query",
            "required": false,
            "description": "Optional dietary filter: 'vegetarian', 'zero_dashi', 'indian', or 'no_beef_pork'",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trail details with 5 ranked stops",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": { "type": "integer" },
                    "trails": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "city": { "type": "string" },
                          "city_id": { "type": "string" },
                          "flag": { "type": "string" },
                          "trail_id": { "type": "string" },
                          "title": { "type": "string" },
                          "curated_by": { "type": "string" },
                          "methodology_url": { "type": "string" },
                          "web_guide": { "type": "string" },
                          "city_50_dishes_url": { "type": "string" },
                          "universal_link": { "type": "string" },
                          "app_scheme": { "type": "string" },
                          "ios_app_store_url": { "type": "string" },
                          "android_beta_waitlist_url": { "type": "string" },
                          "traveler_dietary_intelligence": { "type": ["string", "null"] },
                          "chef_flashcard": {
                            "type": ["object", "null"],
                            "properties": {
                              "language": { "type": "string" },
                              "local_script": { "type": "string" },
                              "english": { "type": "string" }
                            }
                          },
                          "stops": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "rank": { "type": "integer" },
                                "dish_name": { "type": "string" },
                                "restaurant_name": { "type": "string" },
                                "area": { "type": "string" },
                                "lat": { "type": "number" },
                                "lng": { "type": "number" },
                                "curator_score": { "type": "string" },
                                "score_type": { "type": "string" },
                                "diet_badge": { "type": ["string", "null"] },
                                "description": { "type": ["string", "null"] },
                                "pro_tip": { "type": ["string", "null"] },
                                "chef_flashcard_jp": { "type": ["string", "null"] },
                                "chef_flashcard_en": { "type": ["string", "null"] },
                                "photo_url": { "type": "string" },
                                "photo_label": { "type": "string" }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
