{
  "openapi": "3.1.0",
  "info": {
    "title": "ZetoIQ public business index API",
    "version": "1.1.0",
    "summary": "Free, machine-readable facts about local businesses in Auroville and Pondicherry, India.",
    "description": "Every fact carries its source and the date it was last updated. Verified listings were checked by a ZetoIQ person. Free within fair use (600 requests per hour per IP). Quote facts with a link to the business page URL in each result. No key needed. The same data is available over MCP at /api/mcp (JSON-RPC 2.0) and as text at /llms.txt and /llms-full.txt.",
    "license": {
      "name": "ZetoIQ API terms",
      "url": "https://www.zetoiq.com/legal/api"
    },
    "contact": {
      "name": "ZetoIQ",
      "url": "https://www.zetoiq.com/contact",
      "email": "support@zetoiq.com"
    }
  },
  "servers": [
    {
      "url": "https://www.zetoiq.com"
    }
  ],
  "paths": {
    "/api/v1/search": {
      "get": {
        "operationId": "searchBusinesses",
        "summary": "Search the index",
        "description": "Keyword search over published listings. Results are ranked transparently (see rank.parts); payment never changes rank.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "What you are looking for, e.g. 'guesthouse breakfast' or 'yoga'."
          },
          {
            "name": "town",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "auroville",
                "pondicherry"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "stay",
                "cafe",
                "food",
                "wellness",
                "shop",
                "tour",
                "clinic",
                "service",
                "other"
              ]
            }
          },
          {
            "name": "max_price",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Rupees. Listings with no rupee price on file are left out."
          },
          {
            "name": "open_now",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Open now in IST, read from the listed hours."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching business cards and a short answer written only from those cards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse",
                  "properties": {
                    "auctions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LiveLot"
                      },
                      "description": "Live room auctions matching the query"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Fair-use limit reached (600 requests per hour)."
          }
        }
      }
    },
    "/api/v1/business/{id}": {
      "get": {
        "operationId": "getBusiness",
        "summary": "One business card",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The slug or ai_id (ziq:<slug>)."
          }
        ],
        "responses": {
          "200": {
            "description": "The card.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "business": {
                      "$ref": "#/components/schemas/BusinessCard"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not a published ZetoIQ listing."
          }
        }
      }
    },
    "/b/{town}/{slug}.json": {
      "get": {
        "operationId": "getBusinessCardFile",
        "summary": "Business card as a static-style JSON file (also includes reviews and live updates)",
        "parameters": [
          {
            "name": "town",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "auroville",
                "pondicherry"
              ]
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The card.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCard"
                }
              }
            }
          },
          "404": {
            "description": "Not in the index."
          }
        }
      }
    },
    "/updates.json": {
      "get": {
        "operationId": "getLiveUpdates",
        "summary": "Unexpired owner updates and offers, approved by staff",
        "responses": {
          "200": {
            "description": "Feed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP server (JSON-RPC 2.0, stateless streamable HTTP)",
        "description": "Methods: initialize, tools/list, tools/call. Tools: search_businesses, get_business, list_categories, get_live_updates, get_active_auctions, check_availability, send_enquiry, request_booking, get_request_status. Server card: /.well-known/mcp.json.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Fact": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "description": "Who supplied the fact, e.g. 'Owner', 'ZetoIQ staff', 'OpenStreetMap contributors (ODbL)'."
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BusinessCard": {
        "type": "object",
        "properties": {
          "ai_id": {
            "type": "string",
            "examples": [
              "ziq:example-guesthouse-auroville"
            ]
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "town": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "Human page. Cite this when quoting."
          },
          "card_url": {
            "type": "string"
          },
          "demo": {
            "type": "boolean"
          },
          "trust": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "verified",
                  "unverified"
                ]
              },
              "verified": {
                "type": "boolean"
              },
              "verified_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "claimed_by_owner": {
                "type": "boolean"
              },
              "note": {
                "type": "string"
              }
            }
          },
          "freshness": {
            "type": "object",
            "properties": {
              "updated_at": {
                "type": "string"
              },
              "days_since_update": {
                "type": "integer"
              }
            }
          },
          "facts": {
            "type": "object",
            "description": "Keys: description, address, postal_code, phone, email, website, hours, price_range, languages, amenities, images, latitude, longitude. Only facts on file are present.",
            "additionalProperties": {
              "$ref": "#/components/schemas/Fact"
            }
          },
          "price_from_inr": {
            "type": [
              "integer",
              "null"
            ]
          },
          "open_now": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "rank": {
            "type": "object",
            "properties": {
              "total": {
                "type": "number"
              },
              "parts": {
                "type": "object"
              }
            }
          },
          "licence": {
            "type": "string"
          }
        }
      },
      "SearchResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCard"
            }
          },
          "answer": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "citations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              },
              "basis": {
                "type": "string"
              }
            }
          }
        }
      },
      "LiveLot": {
        "type": "object",
        "description": "A live room auction (tonight's empty room). Highest bid at or above the hotel's reserve wins; people bid on zetoiq.com.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "room": {
            "type": [
              "string",
              "null"
            ]
          },
          "sleeps": {
            "type": [
              "integer",
              "null"
            ]
          },
          "city": {
            "type": "string"
          },
          "check_in": {
            "type": "string",
            "format": "date"
          },
          "check_out": {
            "type": "string",
            "format": "date"
          },
          "starting_bid_inr": {
            "type": "integer"
          },
          "current_bid_inr": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bids": {
            "type": "integer"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
