{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps Directions Scraper",
    "description": "Get Google Maps directions as JSON for driving, transit, walking and cycling. Add origins and destinations and get every alternative route with duration, distance, fares, transit lines, platforms, stops and per-leg times. Set a leave-at or arrive-by time and add waypoints. $2.50 per 1,000 routes.",
    "version": "1.0",
    "x-build-id": "9Klc02NvFwbNg6XPa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/boncross~google-maps-directions/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-boncross-google-maps-directions",
        "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/boncross~google-maps-directions/runs": {
      "post": {
        "operationId": "runs-sync-boncross-google-maps-directions",
        "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/boncross~google-maps-directions/run-sync": {
      "post": {
        "operationId": "run-sync-boncross-google-maps-directions",
        "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",
        "required": [
          "routes"
        ],
        "properties": {
          "routes": {
            "title": "Routes",
            "type": "array",
            "description": "One per entry: {\"origin\": \"King's Cross Station, London\", \"destination\": \"Heathrow Terminal 5\"}, with optional \"departAt\" or \"arriveBy\" (YYYY-MM-DDTHH:MM, local to the route) and, for driving, walking or cycling, \"waypoints\": [\"Windsor Castle\"]: Google does not plan public transport through stops. Plain place names, addresses or coordinates all work; Google geocodes them and the record shows what each one resolved to. A plain string \"A -> B\" also works."
          },
          "maxItems": {
            "title": "Maximum routes for the whole run",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many routes have been returned across the run. 0 means no limit.",
            "default": 0
          },
          "modes": {
            "title": "Travel modes",
            "type": "array",
            "description": "One request per route per mode.",
            "items": {
              "type": "string",
              "enum": [
                "driving",
                "transit",
                "walking",
                "cycling"
              ],
              "enumTitles": [
                "Driving",
                "Transit",
                "Walking",
                "Cycling"
              ]
            },
            "default": [
              "transit"
            ]
          },
          "departAt": {
            "title": "Depart at (default for all routes)",
            "type": "string",
            "description": "YYYY-MM-DDTHH:MM in the route's own local time. Empty = leave now. Per-route departAt / arriveBy override this.",
            "default": ""
          },
          "arriveBy": {
            "title": "Arrive by (default for all routes)",
            "type": "string",
            "description": "YYYY-MM-DDTHH:MM local time. Ignored when Depart at is set.",
            "default": ""
          },
          "fallbackToComparableDate": {
            "title": "Fall back to a comparable date",
            "type": "boolean",
            "description": "Transit timetables are only published a few weeks ahead. When a dated transit query returns nothing, retry the latest same weekday that has a timetable and mark the record with substitutedDate.",
            "default": true
          },
          "avoidTolls": {
            "title": "Avoid tolls",
            "type": "boolean",
            "description": "Driving routes only: route around toll roads.",
            "default": false
          },
          "avoidHighways": {
            "title": "Avoid highways",
            "type": "boolean",
            "description": "Driving routes only: keep off motorways and highways.",
            "default": false
          },
          "avoidFerries": {
            "title": "Avoid ferries",
            "type": "boolean",
            "description": "Driving routes only: never take a car ferry.",
            "default": false
          },
          "transitRoutePreference": {
            "title": "Transit route preference",
            "enum": [
              "best",
              "fewerTransfers",
              "lessWalking"
            ],
            "type": "string",
            "description": "Public transport only. Best route (the default), fewer transfers, or less walking.",
            "default": "best"
          },
          "transitModes": {
            "title": "Preferred transit modes",
            "type": "array",
            "description": "Public transport only. Prefer these vehicles. A preference, as in Google Maps: when no route uses only them, routes mixing in others still come back.",
            "items": {
              "type": "string",
              "enum": [
                "bus",
                "subway",
                "train",
                "tram"
              ],
              "enumTitles": [
                "Bus",
                "Subway",
                "Train",
                "Tram and light rail"
              ]
            },
            "default": []
          },
          "maxAlternatives": {
            "title": "Max alternatives per route",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "0 = all Google returns (typically 3 road, up to 6 transit).",
            "default": 0
          },
          "includeLegs": {
            "title": "Include per-leg breakdown",
            "type": "boolean",
            "description": "For transit: walk / ride legs with line, platform, boarding and alighting stops and times.",
            "default": true
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Names, road and line labels in this language, e.g. en, ja, de.",
            "default": "en"
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Which country Google assumes when a place name is ambiguous: \"Springfield\" to \"Boston\" finds a drive with us and no route with gb. Distances come in the units of the country the route is in, whatever this is set to.",
            "default": "us"
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 32,
            "type": "integer",
            "description": "How many requests run at once across the whole run. The default is the fastest level measured clean; lower it only if a run reports refusals or errors.",
            "default": 32
          },
          "delayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Optional pause before each call, in milliseconds. 0 (the default) runs as fast as the parallel limit allows.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}