{
  "openapi": "3.0.1",
  "info": {
    "title": "Directions, Routing & Distance Matrix API — no API key",
    "description": "Directions, travel times, distance matrices, route optimization, isochrones, geocoding and elevation on OpenStreetMap: a Google Maps Directions API alternative with no API key. Driving, cycling, walking, truck. Polyline + GeoJSON geometry. MCP-ready for Claude and AI agents.",
    "version": "0.4",
    "x-build-id": "ob3ArCw2mmalLNOU1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/davidar~openstreetmap-directions-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-davidar-openstreetmap-directions-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/davidar~openstreetmap-directions-api/runs": {
      "post": {
        "operationId": "runs-sync-davidar-openstreetmap-directions-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/davidar~openstreetmap-directions-api/run-sync": {
      "post": {
        "operationId": "run-sync-davidar-openstreetmap-directions-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "origin": {
            "title": "Origin",
            "type": "string",
            "description": "Quick route: where the trip starts — a place name or address (`\"Torquay VIC\"`, `\"Flinders Street Station, Melbourne\"`) or coordinates as `\"lat,lng\"` (`\"-38.3385,144.3255\"`). With `destination` this makes one route; leave both empty to use `routes` (batch), `matrix`, `isochrones`, `geocode` or `elevation` below. Place names are geocoded (one `geocoded_location` event each)."
          },
          "destination": {
            "title": "Destination",
            "type": "string",
            "description": "Quick route: where the trip ends — a place name or address, or `\"lat,lng\"`. Needs `origin`."
          },
          "waypoints": {
            "title": "Waypoints",
            "type": "array",
            "description": "Quick route: optional stops between origin and destination, in visiting order, up to 18 — each a place name or `\"lat,lng\"`. Each stop starts a new leg. To reorder stops for the shortest trip, use `routes` with `optimize: true` instead.",
            "items": {
              "type": "string"
            }
          },
          "profile": {
            "title": "Travel profile",
            "enum": [
              "car",
              "bike",
              "foot",
              "truck",
              "motorcycle",
              "scooter",
              "bus",
              "taxi"
            ],
            "type": "string",
            "description": "Quick route: how you travel. `car` (default), `bike`, `foot`, `truck`, `motorcycle`, `scooter`, `bus`, `taxi`. Free Apify plans: `car` only (served by the community router)."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "route",
              "matrix",
              "isochrone",
              "geocode",
              "elevation"
            ],
            "type": "string",
            "description": "What to compute. Optional (a quick route with `origin`/`destination` needs no mode): when left out, the Actor runs whichever one of `routes`, `matrix`, `isochrones`, `geocode`, `elevation` you send (send only one, or set this). `route` reads `routes`, `matrix` reads `matrix`, `isochrone` reads `isochrones`, `geocode` reads `geocode`, `elevation` reads `elevation`; the others are ignored. Free (non-paying) Apify users are served by the community routing server: car profile, coordinates only (no geocoding), routes and matrices, no isochrones and no elevation profiles, at most 100 jobs per run."
          },
          "routes": {
            "title": "Routes",
            "type": "array",
            "description": "Mode `route`, the batch form of the quick route above. Up to 1000 routes per run (free Apify users: at most 100 jobs per run, served by the community routing server). Each item: `id` (optional, echoed in `input.id`); `locations` (2–20: origin, stops, destination — `\"Apollo Bay VIC\"`, `{\"lat\": -38.3385, \"lng\": 144.3255}`, `[lat, lng]` or `\"lat,lng\"`; routes with more than 20 are skipped); `profile` (`car` default, `bike`, `foot`, `truck`, `motorcycle`, `scooter`, `bus`, `taxi`); `alternates` (0–3, only for a 2-location route without `departAt`/`arriveAt`, otherwise set to 0 with a warning); `avoid` (any of `tolls`, `highways`, `ferries`, `unpaved`; `bike` and `foot` support only `ferries`, other values are dropped with a warning); `departAt` or `arriveAt` (one of them, `YYYY-MM-DDTHH:MM`, local time at the origin, no time zone; typical speeds, not live traffic); `excludePolygons` (rings of at least 3 `[lng, lat]` pairs, GeoJSON order; roads crossing them are avoided); `truck` (`height`, `width`, `length` in metres, `weight`, `axleLoad` in tonnes, `hazmat` true/false; only with profile `truck`); `optimize` (true = reorder the stops between the first and last location for the shortest trip; needs 4–20 locations (with 3 there is nothing to reorder), ignored with a warning on fewer and routed and charged as a plain route; cannot be combined with `departAt`/`arriveAt`; sets `alternates` to 0; the row gets `optimizedOrder`; charged as one `route_computed`, like a plain route); `avoidLocations` (coordinates only, any coordinate format, place names are an input error; the road nearest each point is avoided — a closed bridge, a blocked street); `tuning` (per-profile preferences: `bicycleType` `road`/`hybrid`/`cross`/`mountain` and `useRoads` 0–1 for `bike`; `useHills` 0–1 for `bike` and `foot`, 0 avoids hills; `walkingSpeedKmh` 0.5–25 for `foot`; `shortest` true to minimise distance instead of time; `roundaboutExits` false to drop roundabout exit maneuvers; keys that do not apply to the profile, and unknown keys, are dropped with a warning; out-of-range values are input errors). See the README for examples."
          },
          "matrix": {
            "title": "Matrix",
            "type": "object",
            "description": "Mode `matrix` (paid Apify plans only). One object: `sources` and `targets` (each 1–50 locations, same formats as routes), `profile` (default `car`), `departAt` (`YYYY-MM-DDTHH:MM`, optional), `longPairs` (`reject` default, or `route`), `id` (optional). The default engine caps a single matrix pair at 400 km of road (an engine without that cap answers such pairs in the matrix). With `reject`, a pair of coordinates more than 380 km apart as the crow flies fails the input up front (a long pair found only after geocoding makes the rows `no_route`); with `route`, each such pair is computed as a separate route and charged as `route_computed`. Output is one row per source; each element is charged as `matrix_element`, unreachable ones included."
          },
          "isochrones": {
            "title": "Isochrones",
            "type": "array",
            "description": "Mode `isochrone` (paid Apify plans only). Up to 10 per run. Each item: `location` (one location), `profile` (default `car`), exactly one of `minutes` (up to 4 contours, each ≤ 120) or `km` (up to 4, each ≤ 200), `polygons` (true for filled polygons, false for boundary lines; default false), `denoise` (0–1), `generalize` (metres, ≥ 0, Douglas-Peucker tolerance), `id` (optional). Output is one row per isochrone with a GeoJSON FeatureCollection."
          },
          "geocode": {
            "title": "Geocoding",
            "type": "array",
            "description": "Mode `geocode` (paid Apify plans only). Up to 1000 queries per run, one row each. Each item is either forward — `text` (a place name or address, e.g. `\"Lorne VIC\"`) — or reverse — `lat` and `lng` (what is at this point); exactly one of the two. `size` (1–10, default 1): results per query, best first. `layers` (optional): restrict to kinds of place, any of `address`, `street`, `venue` (or `poi`), `locality`, `localadmin`, `neighbourhood`, `county`, `region`, `postalcode`, `country`, `coarse` (all administrative areas). `id` (optional, echoed). Forward queries are bounded to `geocodeCountry`, and each result must pass the same word-match check as route place names (at least half of your significant words in the match) unless `looseGeocoding` is on; the row is `geocode_failed` only when no result passes. Reverse results are not checked. Each result returned is one `geocoded_location` event; a `geocode_failed` query is free."
          },
          "elevation": {
            "title": "Elevation profiles",
            "type": "array",
            "description": "Mode `elevation` (paid Apify plans only). Up to 100 lines per run, one row each. Each item: either `polyline` (an encoded polyline; set `polylinePrecision` to 5 or 6 to match how it was encoded — default 5, as most tools encode; a route row's `route.geometry.polyline6` needs 6) or `coordinates` (`[lng, lat]` pairs in GeoJSON order, or `{\"lat\": …, \"lng\": …}` objects), not both; up to 5000 points. `intervalM`: 0 (default) = one sample per given point, or 10–5000 = a sample every that many metres along the line; at most 5000 samples per line (a longer one is skipped with a warning naming the smallest intervalM that fits). `id` optional. The row has `samples[]` (`lat`, `lng`, `distanceM` along the line, `elevationM`, null where there is no data, e.g. over the sea) and a `summary` (min, max, total climb and descent, length). One `geocoded_location` (\"Lookup\") event per answered line; a line with no elevation data at any sample is `no_route` and free."
          },
          "geometry": {
            "title": "Route geometry",
            "enum": [
              "all",
              "polyline6",
              "polyline5",
              "geojson",
              "none"
            ],
            "type": "string",
            "description": "Geometry format(s) on route rows. `polyline6` is encoded polyline at 6 decimal places (the engine's native precision); `polyline5` is 5 decimal places, the precision most decoders assume by default; `geojson` is a LineString of `[lng, lat]`. `all` returns all three, `none` drops geometry (smaller rows). Decode each polyline at its own precision.",
            "default": "all"
          },
          "steps": {
            "title": "Turn-by-turn steps",
            "enum": [
              "none",
              "maneuvers",
              "instructions"
            ],
            "type": "string",
            "description": "`instructions` returns maneuvers with narrative text; `maneuvers` returns them without text; `none` returns legs with distance and duration only.",
            "default": "instructions"
          },
          "units": {
            "title": "Narrative units",
            "enum": [
              "km",
              "mi"
            ],
            "type": "string",
            "description": "Units used in instruction text. Numeric fields are always metres (`distanceM`) and seconds (`durationS`).",
            "default": "km"
          },
          "language": {
            "title": "Instruction language",
            "enum": [
              "bg-BG",
              "ca-ES",
              "cs-CZ",
              "da-DK",
              "de-DE",
              "el-GR",
              "en-GB",
              "en-US",
              "en-US-x-pirate",
              "es-ES",
              "et-EE",
              "fi-FI",
              "fr-FR",
              "hi-IN",
              "hu-HU",
              "it-IT",
              "ja-JP",
              "nb-NO",
              "nl-NL",
              "pl-PL",
              "pt-BR",
              "pt-PT",
              "ru-RU",
              "sk-SK",
              "sl-SI",
              "sv-SE",
              "tr-TR",
              "uk-UA"
            ],
            "type": "string",
            "description": "Language of the instruction text, one of the 28 listed locales. The engine has no `en-AU`; `en-GB` (default) is the closest (metric, British spelling).",
            "default": "en-GB"
          },
          "elevationIntervalM": {
            "title": "Elevation sampling (m)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "0 = no elevation profile. Otherwise 10–1000: an elevation in metres every this many metres along each route (30 is a good choice). Values 1–9 are rejected. Always metres, whatever `units` says.",
            "default": 0
          },
          "geocodeCountry": {
            "title": "Geocoding country",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 code (two letters, e.g. `AU`, `NZ`, `GB`) that bounds and biases place-name lookups, in text route locations and in forward `geocode` queries. Empty = worldwide. Reverse geocoding and coordinates are never bounded by it.",
            "default": "AU"
          },
          "looseGeocoding": {
            "title": "Loose geocoding",
            "type": "boolean",
            "description": "Accept any geocoder hit for a place name, even when none of your words appear in the matched place. Off by default: a name like \"Nowhereville XYZ\" otherwise matches a venue called \"XYZ Finance\" and gets routed. When off, such hits are dropped; a location or `geocode` query left with none comes back as geocode_failed naming the closest match. Reverse geocoding is never filtered.",
            "default": false
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Requests processed in parallel (1–8). Requests to the routing engine are capped per host regardless of this value, so raising it past 4 rarely helps.",
            "default": 4
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}