{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openephemeris-com/json-schema/openephemeris-com-location-autocomplete-response-schema.json",
  "title": "LocationAutocompleteResponse",
  "description": "Response for /location/autocomplete endpoint.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openephemeris-com-location-timezone-api-openapi.yml#/components/schemas/LocationAutocompleteResponse",
  "additionalProperties": true,
  "properties": {
    "cached": {
      "default": false,
      "description": "True if results were served from cache",
      "title": "Cached",
      "type": "boolean"
    },
    "query": {
      "description": "Original search query",
      "title": "Query",
      "type": "string"
    },
    "suggestions": {
      "description": "List of matching location suggestions",
      "items": {
        "$ref": "#/$defs/LocationSuggestion"
      },
      "title": "Suggestions",
      "type": "array"
    },
    "total_results": {
      "description": "Number of suggestions returned",
      "minimum": 0,
      "title": "Total Results",
      "type": "integer"
    }
  },
  "required": [
    "query",
    "total_results"
  ],
  "type": "object",
  "$defs": {
    "LocationSuggestion": {
      "additionalProperties": true,
      "description": "Single location suggestion for autocomplete results.",
      "properties": {
        "confidence": {
          "anyOf": [
            {
              "maximum": 1,
              "minimum": 0,
              "type": "number"
            }
          ],
          "description": "Optional confidence score from the provider (0-1)",
          "title": "Confidence"
        },
        "country_code": {
          "anyOf": [
            {
              "maxLength": 2,
              "minLength": 2,
              "type": "string"
            }
          ],
          "description": "ISO 3166-1 alpha-2 country code (e.g., US, GB)",
          "title": "Country Code"
        },
        "display_name": {
          "description": "Full human-readable name",
          "title": "Display Name",
          "type": "string"
        },
        "latitude": {
          "description": "Latitude in decimal degrees",
          "maximum": 90,
          "minimum": -90,
          "title": "Latitude",
          "type": "number"
        },
        "longitude": {
          "description": "Longitude in decimal degrees",
          "maximum": 180,
          "minimum": -180,
          "title": "Longitude",
          "type": "number"
        },
        "place_id": {
          "description": "Provider-specific place identifier",
          "title": "Place Id",
          "type": "string"
        },
        "region": {
          "anyOf": [
            {
              "type": "string"
            }
          ],
          "description": "Human-readable admin1 (state/province/region) name, e.g. \"Michigan\", \"Quebec\". Omitted when it cannot be resolved.",
          "title": "Region"
        },
        "short_name": {
          "description": "Short label suitable for UI chips",
          "title": "Short Name",
          "type": "string"
        },
        "timezone": {
          "description": "IANA timezone identifier (e.g., America/Los_Angeles)",
          "title": "Timezone",
          "type": "string"
        }
      },
      "required": [
        "place_id",
        "display_name",
        "short_name",
        "latitude",
        "longitude",
        "timezone"
      ],
      "title": "LocationSuggestion",
      "type": "object"
    }
  }
}