{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/geoapify/json-schema/geoapify-map-matching-request-schema.json",
  "title": "MapMatchingRequest",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/geoapify-map-matching-api-openapi.yml#/components/schemas/MapMatchingRequest",
  "type": "object",
  "required": [
    "mode",
    "waypoints"
  ],
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "walk",
        "hike",
        "scooter",
        "motorcycle",
        "drive",
        "light_truck",
        "bicycle",
        "mountain_bike",
        "road_bike",
        "bus",
        "medium_truck",
        "truck",
        "truck_dangerous_goods",
        "heavy_truck",
        "long_truck"
      ],
      "description": "Travel profile used to decide which roads can plausibly connect the GPS measurements. `drive` represents a passenger car."
    },
    "waypoints": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1000,
      "description": "Ordered GPS measurements to match. Input order is preserved; the API does not optimize or reorder these points.",
      "items": {
        "$ref": "#/$defs/TraceWaypoint"
      }
    },
    "geocode_step_address": {
      "type": "boolean",
      "default": false,
      "description": "When `true`, reverse-geocodes matched route steps and adds address data. Each geocoded step adds API credit cost."
    },
    "lookup_step_osmtags": {
      "type": "boolean",
      "default": false,
      "description": "When `true`, looks up OpenStreetMap tags for matched route steps. Each lookup step adds API credit cost."
    },
    "lookup_osm_overlap": {
      "type": "boolean",
      "default": false,
      "description": "When `true`, includes OpenStreetMap overlap information for matched route steps. Each lookup step adds API credit cost."
    },
    "lang": {
      "type": "string",
      "enum": [
        "en",
        "de",
        "es",
        "fr",
        "hi",
        "it",
        "pt",
        "ru",
        "sl",
        "sv",
        "ca",
        "cs"
      ],
      "default": "en",
      "description": "Language code used for any generated address or instruction text."
    }
  },
  "$defs": {
    "TraceWaypoint": {
      "type": "object",
      "required": [
        "location"
      ],
      "properties": {
        "location": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "prefixItems": [
            {
              "type": "number",
              "minimum": -180,
              "maximum": 180,
              "description": "Longitude."
            },
            {
              "type": "number",
              "minimum": -90,
              "maximum": 90,
              "description": "Latitude."
            }
          ],
          "items": false,
          "description": "Recorded coordinate in GeoJSON order: `[longitude, latitude]`."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Optional ISO 8601 recording time. Ordered timestamps help estimate speed and identify implausible measurements."
        },
        "bearing": {
          "type": "number",
          "minimum": 0,
          "maximum": 360,
          "description": "Optional recorded travel direction in degrees clockwise from north."
        }
      }
    }
  }
}