{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps Directions and Routes API",
    "description": "Extract Google Maps route alternatives with multi-stop legs, navigation steps, distance, duration, traffic estimates, and encoded paths.",
    "version": "0.1",
    "x-build-id": "srCdfV9hSOdPsxSDF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~google-maps-directions-routes-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-google-maps-directions-routes-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/automation-lab~google-maps-directions-routes-api/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-google-maps-directions-routes-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/automation-lab~google-maps-directions-routes-api/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-google-maps-directions-routes-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",
            "minLength": 1,
            "type": "string",
            "description": "Starting address, place name, or latitude,longitude pair for a single route request."
          },
          "destination": {
            "title": "Destination",
            "minLength": 1,
            "type": "string",
            "description": "Ending address, place name, or latitude,longitude pair for a single route request."
          },
          "waypoints": {
            "title": "Waypoints",
            "maxItems": 8,
            "type": "array",
            "description": "Up to 8 intermediate stops, visited in the supplied order.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "mode": {
            "title": "Travel mode",
            "enum": [
              "driving",
              "walking",
              "bicycling",
              "transit"
            ],
            "type": "string",
            "description": "Default travel mode for the single request and batch rows that do not set their own mode.",
            "default": "driving"
          },
          "avoid": {
            "title": "Avoid features",
            "uniqueItems": true,
            "type": "array",
            "description": "Road features Google Maps should avoid where the selected mode supports them.",
            "items": {
              "type": "string",
              "enum": [
                "tolls",
                "highways",
                "ferries"
              ],
              "enumTitles": [
                "Tolls",
                "Highways",
                "Ferries"
              ]
            },
            "default": []
          },
          "locale": {
            "title": "Language",
            "pattern": "^[A-Za-z]{2,3}(-[A-Za-z]{2})?$",
            "type": "string",
            "description": "Language code for Google Maps labels and navigation instructions, such as en, de, or fr.",
            "default": "en"
          },
          "country": {
            "title": "Country bias",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Two-letter country code used to resolve ambiguous place names and localize units.",
            "default": "us"
          },
          "maxRouteAlternatives": {
            "title": "Route alternatives per request",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "Maximum number of Google Maps route alternatives to save for each request. Google Maps may return fewer.",
            "default": 3
          },
          "routes": {
            "title": "Batch route requests",
            "maxItems": 50,
            "type": "array",
            "description": "Optional batch of up to 50 origin-destination requests. When supplied, it replaces the top-level single route.",
            "items": {
              "type": "object",
              "required": [
                "origin",
                "destination"
              ],
              "properties": {
                "origin": {
                  "title": "Origin",
                  "description": "Starting address, place, or coordinates.",
                  "type": "string",
                  "minLength": 1
                },
                "destination": {
                  "title": "Destination",
                  "description": "Ending address, place, or coordinates.",
                  "type": "string",
                  "minLength": 1
                },
                "waypoints": {
                  "title": "Waypoints",
                  "description": "Intermediate stops in visit order.",
                  "type": "array",
                  "maxItems": 8,
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "mode": {
                  "title": "Travel mode",
                  "description": "Travel mode for this request.",
                  "type": "string",
                  "enum": [
                    "driving",
                    "walking",
                    "bicycling",
                    "transit"
                  ]
                },
                "avoid": {
                  "title": "Avoid",
                  "description": "Road features to avoid: tolls, highways, or ferries.",
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "locale": {
                  "title": "Language",
                  "description": "Language code for labels and instructions.",
                  "type": "string"
                },
                "country": {
                  "title": "Country bias",
                  "description": "Two-letter country bias.",
                  "type": "string"
                },
                "maxRouteAlternatives": {
                  "title": "Route alternatives",
                  "description": "Maximum alternatives for this request.",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3
                }
              }
            }
          },
          "maxItems": {
            "title": "Maximum saved routes",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "Global cap on route-alternative records saved across all requests.",
            "default": 20
          },
          "requestDelayMs": {
            "title": "Delay between requests (milliseconds)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Conservative delay between separate route requests. No delay is added between alternatives in one response.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}