{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thaiprops-com/json-schema/thaiprops-com-search-payload-schema.json",
  "title": "SearchPayload",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thaiprops-com-openapi.json#/components/schemas/SearchPayload",
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "buy",
        "rent"
      ],
      "title": "Mode"
    },
    "province": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Province"
    },
    "property_types": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Property Types"
    },
    "location": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Location"
    },
    "keyword": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Keyword"
    },
    "property_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Property Id"
    },
    "project_ids": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Project Ids"
    },
    "station_ids": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Station Ids"
    },
    "areas": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Areas"
    },
    "districts": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Districts"
    },
    "bedrooms_min": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bedrooms Min"
    },
    "bedrooms_values": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bedrooms Values"
    },
    "price_min": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Price Min"
    },
    "price_max": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Price Max"
    },
    "area_min": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Area Min"
    },
    "area_max": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Area Max"
    },
    "map_bounds": {
      "anyOf": [
        {
          "$ref": "#/$defs/MapBounds"
        },
        {
          "type": "null"
        }
      ]
    },
    "map_bounds_list": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/MapBounds"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Map Bounds List"
    },
    "map_polygon": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/MapPoint"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Map Polygon"
    },
    "nearby_center": {
      "anyOf": [
        {
          "$ref": "#/$defs/NearbyCenter"
        },
        {
          "type": "null"
        }
      ]
    },
    "nearby_radius_km": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Nearby Radius Km"
    },
    "features": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Features"
    },
    "project_features": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Project Features"
    },
    "built_after_year": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Built After Year"
    },
    "availability": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "now",
            "7",
            "30",
            "updated_7"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Availability"
    },
    "pet_friendly": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pet Friendly"
    },
    "short_term": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Short Term"
    },
    "private_pool": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Private Pool"
    },
    "duplex": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Duplex"
    },
    "map_only": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Map Only",
      "default": false
    },
    "analytics_search_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Analytics Search Token"
    },
    "analytics_session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Analytics Session Id"
    },
    "analytics_source": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Analytics Source"
    },
    "analytics_page_path": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Analytics Page Path"
    },
    "sort": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "best",
            "newest",
            "availability",
            "updated",
            "newest_added",
            "price_low",
            "price_high",
            "area_low",
            "area_high",
            "floor_high"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Sort",
      "default": "best"
    },
    "page": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Page",
      "default": 1
    },
    "page_size": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Page Size",
      "default": 20
    }
  },
  "type": "object",
  "required": [
    "mode"
  ],
  "$defs": {
    "MapBounds": {
      "properties": {
        "north": {
          "type": "number",
          "title": "North"
        },
        "south": {
          "type": "number",
          "title": "South"
        },
        "east": {
          "type": "number",
          "title": "East"
        },
        "west": {
          "type": "number",
          "title": "West"
        }
      },
      "type": "object",
      "required": [
        "north",
        "south",
        "east",
        "west"
      ],
      "title": "MapBounds"
    },
    "MapPoint": {
      "properties": {
        "lat": {
          "type": "number",
          "title": "Lat"
        },
        "lng": {
          "type": "number",
          "title": "Lng"
        }
      },
      "type": "object",
      "required": [
        "lat",
        "lng"
      ],
      "title": "MapPoint"
    },
    "NearbyCenter": {
      "properties": {
        "lat": {
          "type": "number",
          "title": "Lat"
        },
        "lng": {
          "type": "number",
          "title": "Lng"
        }
      },
      "type": "object",
      "required": [
        "lat",
        "lng"
      ],
      "title": "NearbyCenter"
    }
  }
}