{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/geoapify/json-schema/geoapify-places-post-request-schema.json",
  "title": "PlacesPostRequest",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/geoapify-places-api-openapi.yml#/components/schemas/PlacesPostRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "categories"
  ],
  "anyOf": [
    {
      "required": [
        "filter"
      ]
    },
    {
      "required": [
        "bias"
      ]
    }
  ],
  "properties": {
    "categories": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "description": "One or more place category keys.",
      "items": {
        "type": "string",
        "minLength": 3,
        "description": "Hierarchical place category key."
      }
    },
    "conditions": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "description": "Optional place-attribute conditions.",
      "items": {
        "type": "string",
        "minLength": 3,
        "description": "Hierarchical place condition."
      }
    },
    "filter": {
      "$ref": "#/$defs/PlacesFilter"
    },
    "bias": {
      "$ref": "#/$defs/PlacesBias"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 500,
      "default": 20
    },
    "offset": {
      "type": "integer",
      "minimum": 0,
      "default": 0
    },
    "lang": {
      "type": "string",
      "enum": [
        "ab",
        "aa",
        "af",
        "ak",
        "sq",
        "am",
        "ar",
        "an",
        "hy",
        "as",
        "av",
        "ae",
        "ay",
        "az",
        "bm",
        "ba",
        "eu",
        "be",
        "bn",
        "bh",
        "bi",
        "bs",
        "br",
        "bg",
        "my",
        "ca",
        "ch",
        "ce",
        "ny",
        "zh",
        "cv",
        "kw",
        "co",
        "cr",
        "hr",
        "cs",
        "da",
        "dv",
        "nl",
        "en",
        "eo",
        "et",
        "ee",
        "fo",
        "fj",
        "fi",
        "fr",
        "ff",
        "gl",
        "ka",
        "de",
        "el",
        "gn",
        "gu",
        "ht",
        "ha",
        "he",
        "hz",
        "hi",
        "ho",
        "hu",
        "ia",
        "id",
        "ie",
        "ga",
        "ig",
        "ik",
        "io",
        "is",
        "it",
        "iu",
        "ja",
        "jv",
        "kl",
        "kn",
        "kr",
        "ks",
        "kk",
        "km",
        "ki",
        "rw",
        "ky",
        "kv",
        "kg",
        "ko",
        "ku",
        "kj",
        "la",
        "lb",
        "lg",
        "li",
        "ln",
        "lo",
        "lt",
        "lu",
        "lv",
        "gv",
        "mk",
        "mg",
        "ms",
        "ml",
        "mt",
        "mi",
        "mr",
        "mh",
        "mn",
        "na",
        "nv",
        "nb",
        "nd",
        "ne",
        "ng",
        "nn",
        "no",
        "ii",
        "nr",
        "oc",
        "oj",
        "cu",
        "om",
        "or",
        "os",
        "pa",
        "pi",
        "fa",
        "pl",
        "ps",
        "pt",
        "qu",
        "rm",
        "rn",
        "ro",
        "ru",
        "sa",
        "sc",
        "sd",
        "se",
        "sm",
        "sg",
        "sr",
        "gd",
        "sn",
        "si",
        "sk",
        "sl",
        "so",
        "st",
        "es",
        "su",
        "sw",
        "ss",
        "sv",
        "ta",
        "te",
        "tg",
        "th",
        "ti",
        "bo",
        "tk",
        "tl",
        "tn",
        "to",
        "tr",
        "ts",
        "tt",
        "tw",
        "ty",
        "ug",
        "uk",
        "ur",
        "uz",
        "ve",
        "vi",
        "vo",
        "wa",
        "cy",
        "wo",
        "fy",
        "xh",
        "yi",
        "yo",
        "za"
      ],
      "default": "en"
    },
    "name": {
      "type": "string",
      "minLength": 1
    }
  },
  "$defs": {
    "PlacesBias": {
      "oneOf": [
        {
          "$ref": "#/$defs/PlacesProximityBias"
        },
        {
          "$ref": "#/$defs/PlacesCircle"
        },
        {
          "$ref": "#/$defs/PlacesRect"
        }
      ]
    },
    "PlacesCircle": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "lon",
        "lat",
        "radius"
      ],
      "properties": {
        "type": {
          "const": "circle"
        },
        "lon": {
          "$ref": "#/$defs/PlacesLongitude"
        },
        "lat": {
          "$ref": "#/$defs/PlacesLatitude"
        },
        "radius": {
          "type": "number",
          "exclusiveMinimum": 0
        }
      }
    },
    "PlacesCountryCodeFilter": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "values"
      ],
      "properties": {
        "type": {
          "const": "countrycode"
        },
        "values": {
          "type": "array",
          "minItems": 1,
          "description": "ISO 3166-1 alpha-2 country codes, `auto`, or the standalone value `none`.",
          "oneOf": [
            {
              "items": {
                "type": "string",
                "enum": [
                  "ad",
                  "ae",
                  "af",
                  "ag",
                  "ai",
                  "al",
                  "am",
                  "an",
                  "ao",
                  "ap",
                  "aq",
                  "ar",
                  "as",
                  "at",
                  "au",
                  "aw",
                  "az",
                  "ba",
                  "bb",
                  "bd",
                  "be",
                  "bf",
                  "bg",
                  "bh",
                  "bi",
                  "bj",
                  "bm",
                  "bn",
                  "bo",
                  "br",
                  "bs",
                  "bt",
                  "bv",
                  "bw",
                  "by",
                  "bz",
                  "ca",
                  "cc",
                  "cd",
                  "cf",
                  "cg",
                  "ch",
                  "ci",
                  "ck",
                  "cl",
                  "cm",
                  "cn",
                  "co",
                  "cr",
                  "cu",
                  "cv",
                  "cx",
                  "cy",
                  "cz",
                  "de",
                  "dj",
                  "dk",
                  "dm",
                  "do",
                  "dz",
                  "ec",
                  "ee",
                  "eg",
                  "eh",
                  "er",
                  "es",
                  "et",
                  "eu",
                  "fi",
                  "fj",
                  "fk",
                  "fm",
                  "fo",
                  "fr",
                  "ga",
                  "gb",
                  "gd",
                  "ge",
                  "gf",
                  "gg",
                  "gh",
                  "gi",
                  "gl",
                  "gm",
                  "gn",
                  "gp",
                  "gq",
                  "gr",
                  "gs",
                  "gt",
                  "gu",
                  "gw",
                  "gy",
                  "hk",
                  "hm",
                  "hn",
                  "hr",
                  "ht",
                  "hu",
                  "id",
                  "ie",
                  "im",
                  "il",
                  "in",
                  "io",
                  "iq",
                  "ir",
                  "is",
                  "it",
                  "je",
                  "jm",
                  "jo",
                  "jp",
                  "ke",
                  "kg",
                  "kh",
                  "ki",
                  "km",
                  "kn",
                  "kp",
                  "kr",
                  "kw",
                  "ky",
                  "kz",
                  "la",
                  "lb",
                  "lc",
                  "li",
                  "lk",
                  "lr",
                  "ls",
                  "lt",
                  "lu",
                  "lv",
                  "ly",
                  "ma",
                  "mc",
                  "md",
                  "me",
                  "mg",
                  "mh",
                  "mk",
                  "ml",
                  "mm",
                  "mn",
                  "mo",
                  "mp",
                  "mq",
                  "mr",
                  "ms",
                  "mt",
                  "mu",
                  "mv",
                  "mw",
                  "mx",
                  "my",
                  "mz",
                  "na",
                  "nc",
                  "ne",
                  "nf",
                  "ng",
                  "ni",
                  "nl",
                  "no",
                  "np",
                  "nr",
                  "nu",
                  "nz",
                  "om",
                  "pa",
                  "pe",
                  "pf",
                  "pg",
                  "ph",
                  "pk",
                  "pl",
                  "pm",
                  "pr",
                  "ps",
                  "pt",
                  "pw",
                  "py",
                  "qa",
                  "re",
                  "ro",
                  "rs",
                  "ru",
                  "rw",
                  "sa",
                  "sb",
                  "sc",
                  "sd",
                  "se",
                  "sg",
                  "sh",
                  "si",
                  "sj",
                  "sk",
                  "sl",
                  "sm",
                  "sn",
                  "so",
                  "sr",
                  "st",
                  "sv",
                  "sy",
                  "sz",
                  "tc",
                  "td",
                  "tf",
                  "tg",
                  "th",
                  "tj",
                  "tk",
                  "tm",
                  "tn",
                  "to",
                  "tr",
                  "tt",
                  "tv",
                  "tw",
                  "tz",
                  "ua",
                  "ug",
                  "um",
                  "us",
                  "uy",
                  "uz",
                  "va",
                  "vc",
                  "ve",
                  "vg",
                  "vi",
                  "vn",
                  "vu",
                  "wf",
                  "ws",
                  "ye",
                  "yt",
                  "za",
                  "zm",
                  "zw",
                  "auto"
                ]
              }
            },
            {
              "maxItems": 1,
              "items": {
                "const": "none"
              }
            }
          ]
        }
      }
    },
    "PlacesEncodedPolylineFilter": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "geometry",
        "encoding"
      ],
      "properties": {
        "type": {
          "const": "polyline"
        },
        "geometry": {
          "type": "string",
          "minLength": 1,
          "maxLength": 102400,
          "description": "Encoded polyline. Its UTF-8 byte length must not exceed 102,400 bytes."
        },
        "encoding": {
          "type": "string",
          "enum": [
            "polyline5",
            "polyline6"
          ]
        },
        "buffer": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 100000,
          "description": "Optional line buffer in metres. When omitted, the internal service uses 1,000 metres."
        }
      }
    },
    "PlacesFilter": {
      "oneOf": [
        {
          "$ref": "#/$defs/PlacesCircle"
        },
        {
          "$ref": "#/$defs/PlacesRect"
        },
        {
          "$ref": "#/$defs/PlacesStoredGeometryFilter"
        },
        {
          "$ref": "#/$defs/PlacesPlaceFilter"
        },
        {
          "$ref": "#/$defs/PlacesCountryCodeFilter"
        },
        {
          "$ref": "#/$defs/PlacesPolygonFilter"
        },
        {
          "$ref": "#/$defs/PlacesPolylineFilter"
        }
      ]
    },
    "PlacesLatitude": {
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "PlacesLineCoordinates": {
      "type": "array",
      "minItems": 2,
      "maxItems": 10000,
      "items": {
        "$ref": "#/$defs/PlacesPosition"
      }
    },
    "PlacesLineGeometry": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": true,
          "required": [
            "type",
            "coordinates"
          ],
          "properties": {
            "type": {
              "const": "LineString"
            },
            "coordinates": {
              "$ref": "#/$defs/PlacesLineCoordinates"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": true,
          "required": [
            "type",
            "coordinates"
          ],
          "properties": {
            "type": {
              "const": "MultiLineString"
            },
            "coordinates": {
              "type": "array",
              "minItems": 1,
              "items": {
                "$ref": "#/$defs/PlacesLineCoordinates"
              }
            }
          }
        }
      ]
    },
    "PlacesLinearRingCoordinates": {
      "type": "array",
      "minItems": 4,
      "description": "A closed ring with at least three distinct positions. Closure and distinctness are validated by the gateway.",
      "items": {
        "$ref": "#/$defs/PlacesPosition"
      }
    },
    "PlacesLongitude": {
      "type": "number",
      "minimum": -180,
      "maximum": 180
    },
    "PlacesPlaceFilter": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "id"
      ],
      "properties": {
        "type": {
          "const": "place"
        },
        "id": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2048,
          "pattern": "^(?:[a-f0-9]{2}){1,1024}$"
        }
      }
    },
    "PlacesPolygonFilter": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "geometry"
      ],
      "properties": {
        "type": {
          "const": "polygon"
        },
        "geometry": {
          "$ref": "#/$defs/PlacesPolygonGeometry"
        },
        "buffer": {
          "type": "number",
          "minimum": 0,
          "maximum": 100000,
          "description": "Optional polygon buffer in metres. Omitted means zero."
        }
      }
    },
    "PlacesPolygonGeometry": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": true,
          "required": [
            "type",
            "coordinates"
          ],
          "properties": {
            "type": {
              "const": "Polygon"
            },
            "coordinates": {
              "type": "array",
              "minItems": 1,
              "maxItems": 100,
              "items": {
                "$ref": "#/$defs/PlacesLinearRingCoordinates"
              }
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": true,
          "required": [
            "type",
            "coordinates"
          ],
          "properties": {
            "type": {
              "const": "MultiPolygon"
            },
            "coordinates": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "$ref": "#/$defs/PlacesLinearRingCoordinates"
                }
              }
            }
          }
        }
      ]
    },
    "PlacesPolylineFilter": {
      "oneOf": [
        {
          "$ref": "#/$defs/PlacesRawPolylineFilter"
        },
        {
          "$ref": "#/$defs/PlacesEncodedPolylineFilter"
        }
      ]
    },
    "PlacesPosition": {
      "type": "array",
      "minItems": 2,
      "prefixItems": [
        {
          "$ref": "#/$defs/PlacesLongitude"
        },
        {
          "$ref": "#/$defs/PlacesLatitude"
        }
      ],
      "items": {
        "type": "number"
      },
      "description": "Position in longitude, latitude order, with optional additional finite numeric ordinates preserved unchanged."
    },
    "PlacesProximityBias": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "lon",
        "lat"
      ],
      "properties": {
        "type": {
          "const": "proximity"
        },
        "lon": {
          "$ref": "#/$defs/PlacesLongitude"
        },
        "lat": {
          "$ref": "#/$defs/PlacesLatitude"
        }
      }
    },
    "PlacesRawPolylineFilter": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "geometry"
      ],
      "properties": {
        "type": {
          "const": "polyline"
        },
        "geometry": {
          "$ref": "#/$defs/PlacesLineGeometry"
        },
        "buffer": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 100000,
          "description": "Optional line buffer in metres. When omitted, the internal service uses 1,000 metres."
        }
      }
    },
    "PlacesRect": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "lon1",
        "lat1",
        "lon2",
        "lat2"
      ],
      "properties": {
        "type": {
          "const": "rect"
        },
        "lon1": {
          "$ref": "#/$defs/PlacesLongitude"
        },
        "lat1": {
          "$ref": "#/$defs/PlacesLatitude"
        },
        "lon2": {
          "$ref": "#/$defs/PlacesLongitude"
        },
        "lat2": {
          "$ref": "#/$defs/PlacesLatitude"
        }
      }
    },
    "PlacesStoredGeometryFilter": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "id"
      ],
      "description": "References a previously stored geometry. This is distinct from inline polygon and polyline filters.",
      "properties": {
        "type": {
          "const": "geometry"
        },
        "id": {
          "type": "string",
          "pattern": "^[a-f0-9]{32}$"
        }
      }
    }
  }
}