{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps Directions Scraper: Distance Matrix, Traffic & ETA",
    "description": "Distance and travel time between address pairs or a whole origins x destinations matrix, as Google Maps shows them: drive time in traffic for a set departure or arrival, route alternatives with tolls flagged, transit legs, and the resolved place for every stop. No API key.",
    "version": "0.0",
    "x-build-id": "bkKOyrgylk9dKC3RM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapebench~google-maps-directions-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapebench-google-maps-directions-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/scrapebench~google-maps-directions-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapebench-google-maps-directions-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/scrapebench~google-maps-directions-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapebench-google-maps-directions-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": {
          "routes": {
            "title": "Routes (origin and destination pairs)",
            "type": "array",
            "description": "One entry per trip: {\"origin\": \"...\", \"destination\": \"...\"}, or the text \"Origin -> Destination\" (also → or |). A single \"A to B\" text is never split, because place names can contain \"to\". A stop can be a full address, a landmark, \"ZIP, state\" or \"lat,lng\"; add the state to a city name.",
            "default": []
          },
          "origin": {
            "title": "Origin",
            "type": "string",
            "description": "One starting point. Combined with Destination / Destinations below."
          },
          "destination": {
            "title": "Destination",
            "type": "string",
            "description": "One end point. Combined with Origin / Origins."
          },
          "origins": {
            "title": "Origins (matrix)",
            "type": "array",
            "description": "Matrix mode: every origin is routed to every destination (10 origins x 20 destinations = 200 routes). One best route per pair unless Alternatives is switched on.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "destinations": {
            "title": "Destinations (matrix)",
            "type": "array",
            "description": "Matrix mode: the destinations every origin is routed to.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "travelMode": {
            "title": "Travel modes",
            "type": "array",
            "description": "One or more of: driving, transit, walking, cycling. Each pair is routed once per mode. Anything else is ignored (logged).",
            "default": [
              "driving"
            ],
            "items": {
              "type": "string"
            }
          },
          "departAt": {
            "title": "Depart at (local time, optional)",
            "type": "string",
            "description": "Local date and time at the origin, e.g. 2026-11-10 08:00, for Google's predicted traffic or the transit timetable at that moment. Empty = now. A past date rolls forward to the same weekday and time in the coming week, so a saved schedule keeps working. Set this or Arrive by, not both."
          },
          "arriveBy": {
            "title": "Arrive by (local time, optional)",
            "type": "string",
            "description": "Local date and time to arrive, e.g. 2026-11-10 09:00. Set this or Depart at, not both."
          },
          "avoid": {
            "title": "Avoid",
            "type": "array",
            "description": "Any of: tolls, highways, ferries (driving routes).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "alternatives": {
            "title": "Alternative routes",
            "type": "boolean",
            "description": "On: every alternative Google offers, one row each (usually up to three driving routes; transit lists each departure, 6 for San Jose to San Francisco on 2026-11-08), at no extra charge. Off: the best route only. Left unset: alternatives for Routes, the best route only for an Origins x Destinations matrix."
          },
          "includeSteps": {
            "title": "Include turn-by-turn steps",
            "type": "boolean",
            "description": "Add the step-by-step instructions (maneuver, distance, duration) to each row. Makes rows larger.",
            "default": false
          },
          "distanceUnit": {
            "title": "Distance label unit",
            "enum": [
              "miles",
              "km"
            ],
            "type": "string",
            "description": "Unit of the distance_text label. distance_m, distance_km and distance_miles are on every row either way.",
            "default": "miles"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language of Google's labels and instructions, as a code (en, es, fr, de, ...).",
            "default": "en"
          },
          "maxResults": {
            "title": "Maximum routes",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on route rows for the WHOLE run (not per pair). A spend cap: the run stops once it has this many, and a free row lists the pairs not run.",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Off by default: Google answered without one when tested. Switch it on only if your runs come back blocked.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}