{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps Route & Distance Matrix Scraper",
    "description": "Get driving, walking, bicycling or transit routes between two locations - distance, duration, traffic and turn-by-turn steps - or build a travel-time matrix across many origins and destinations in one run.",
    "version": "1.0",
    "x-build-id": "rqVaq22Xv16eLhVf8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vexaloom-labs~google-maps-route-and-distance-matrix-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vexaloom-labs-google-maps-route-and-distance-matrix-scraper",
        "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/vexaloom-labs~google-maps-route-and-distance-matrix-scraper/runs": {
      "post": {
        "operationId": "runs-sync-vexaloom-labs-google-maps-route-and-distance-matrix-scraper",
        "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/vexaloom-labs~google-maps-route-and-distance-matrix-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-vexaloom-labs-google-maps-route-and-distance-matrix-scraper",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "route",
              "matrix",
              "urls"
            ],
            "type": "string",
            "description": "What to scrape: one route (with optional waypoints), a distance matrix, or a list of Google Maps directions URLs.",
            "default": "route"
          },
          "stops": {
            "title": "Stops",
            "minItems": 2,
            "maxItems": 10,
            "type": "array",
            "description": "Ordered stops for route mode: 2–10 locations. The first is the origin, the last is the destination, and everything in between becomes a waypoint.",
            "items": {
              "type": "string"
            }
          },
          "origins": {
            "title": "Origins",
            "type": "array",
            "description": "Starting locations for matrix mode. Each origin is paired with every destination below.",
            "items": {
              "type": "string"
            }
          },
          "destinations": {
            "title": "Destinations",
            "type": "array",
            "description": "Ending locations for matrix mode. Each destination is paired with every origin above.",
            "items": {
              "type": "string"
            }
          },
          "directionsUrls": {
            "title": "Directions URLs",
            "type": "array",
            "description": "Google Maps directions links for URLs mode. Canonical /maps/dir/ links and short share links are both accepted; waypoints and travel mode are read from the link when present.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL",
                  "description": "Public Google Maps directions link."
                }
              },
              "required": [
                "url"
              ]
            }
          },
          "maxPairs": {
            "title": "Max Pairs",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of origin × destination pairs to request in matrix mode. Pairs beyond this cap are left out.",
            "default": 100
          },
          "travelMode": {
            "title": "Travel Mode",
            "enum": [
              "driving",
              "walking",
              "bicycling",
              "transit"
            ],
            "type": "string",
            "description": "How to travel between the stops.",
            "default": "driving"
          },
          "avoidTolls": {
            "title": "Avoid Tolls",
            "type": "boolean",
            "description": "Driving only — ask Google Maps to avoid toll roads. If no toll-free route exists, Google may still return a toll route.",
            "default": false
          },
          "avoidHighways": {
            "title": "Avoid Highways",
            "type": "boolean",
            "description": "Driving only — ask Google Maps to avoid highways and motorways. If no practical alternative exists, Google may still return a highway route.",
            "default": false
          },
          "avoidFerries": {
            "title": "Avoid Ferries",
            "type": "boolean",
            "description": "Driving only — prefer routes without ferry crossings. If every route uses a ferry, the result is still returned and marked with avoidanceUnmet.",
            "default": false
          },
          "departureTime": {
            "title": "Departure Time",
            "type": "string",
            "description": "Optional ISO 8601 departure time as local time at the origin, for example 2026-06-16T10:30:00. Used for driving traffic estimates and transit schedules. A timezone offset is accepted but ignored; walking and bicycling ignore the field."
          },
          "maxAlternatives": {
            "title": "Max Alternatives",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Maximum number of route alternatives to return per trip, including Google's recommended route. Applies to route and URLs modes. Google usually supplies up to 3 alternatives.",
            "default": 5
          },
          "maxItems": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Global cap on the number of records pushed to the dataset.",
            "default": 50
          },
          "includeSteps": {
            "title": "Include Steps",
            "type": "boolean",
            "description": "Add turn-by-turn steps with instruction, distance, duration, maneuver, coordinates and route geometry for every returned route.",
            "default": true
          },
          "includeStreetView": {
            "title": "Include Street View",
            "type": "boolean",
            "description": "Add a Street View panorama ID and thumbnail URL to each step where Google publishes one. This also enables step details.",
            "default": false
          },
          "language": {
            "title": "Language",
            "enum": [
              "en",
              "es",
              "fr",
              "de",
              "it",
              "pt",
              "ja",
              "ko",
              "zh",
              "ar",
              "ru"
            ],
            "type": "string",
            "description": "Language for instructions and other localized text.",
            "default": "en"
          },
          "units": {
            "title": "Units",
            "enum": [
              "metric",
              "imperial"
            ],
            "type": "string",
            "description": "Preferred distance units for the formatted distance fields. Meter values stay unchanged.",
            "default": "metric"
          },
          "requestDelayMs": {
            "title": "Request Delay (ms)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Pause between directions requests. A small delay keeps large matrix runs polite and reduces rate limiting.",
            "default": 250
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional fallback proxy. The actor first requests Google Maps directly and only retries through this proxy if the direct request is blocked."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}