{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps Directions API",
    "description": "Get Google Maps directions for any route - driving, transit, walking, cycling, or flight - with distance, ETA, and turn-by-turn steps as JSON. Use addresses, coordinates, or place IDs; avoid tolls, highways, or ferries; set departure or arrival time. MCP-ready for Claude and AI agents.",
    "version": "0.0",
    "x-build-id": "rwItowLWYRS36ZPyK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/johnvc~google-maps-directions-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-johnvc-google-maps-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/johnvc~google-maps-directions-api/runs": {
      "post": {
        "operationId": "runs-sync-johnvc-google-maps-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/johnvc~google-maps-directions-api/run-sync": {
      "post": {
        "operationId": "run-sync-johnvc-google-maps-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": {
          "start_addr": {
            "title": "Start Address",
            "type": "string",
            "description": "Enter the starting address or place name (e.g. 'New York, NY' or 'Empire State Building'). Provide this or `start_coords` or `start_data_id` for the origin."
          },
          "end_addr": {
            "title": "End Address",
            "type": "string",
            "description": "Enter the destination address or place name (e.g. 'Boston, MA' or 'Fenway Park'). Provide this or `end_coords` or `end_data_id` for the destination."
          },
          "start_coords": {
            "title": "Start Coordinates",
            "type": "string",
            "description": "Optionally set the origin as exact GPS coordinates in 'latitude,longitude' format (e.g. '40.7128,-74.0060'). Overrides the start address when provided."
          },
          "end_coords": {
            "title": "End Coordinates",
            "type": "string",
            "description": "Optionally set the destination as exact GPS coordinates in 'latitude,longitude' format (e.g. '42.3601,-71.0589'). Overrides the end address when provided."
          },
          "start_data_id": {
            "title": "Start Place ID",
            "type": "string",
            "description": "Optionally set the origin as a Google Maps place data ID (e.g. '0x89c24fa5d33f083b:0xc80b8f06e177fe62'). Overrides the start address when provided."
          },
          "end_data_id": {
            "title": "End Place ID",
            "type": "string",
            "description": "Optionally set the destination as a Google Maps place data ID. Overrides the end address when provided."
          },
          "travel_mode": {
            "title": "Travel Mode",
            "enum": [
              "best",
              "driving",
              "cycling",
              "walking",
              "transit",
              "flight",
              "two-wheeler"
            ],
            "type": "string",
            "description": "Choose how to travel. 'Best' returns the best options across modes; the others restrict the result to one mode. Flight and two-wheeler are only available for some regions and routes.",
            "default": "best"
          },
          "distance_unit": {
            "title": "Distance Unit",
            "enum": [
              "auto",
              "km",
              "miles"
            ],
            "type": "string",
            "description": "Choose the distance unit for the results. 'Automatic' lets the region decide.",
            "default": "auto"
          },
          "avoid_tolls": {
            "title": "Avoid Tolls",
            "type": "boolean",
            "description": "Enable to prefer routes without toll roads. Applied as a preference; Google may still include tolls if no alternative exists.",
            "default": false
          },
          "avoid_highways": {
            "title": "Avoid Highways",
            "type": "boolean",
            "description": "Enable to prefer routes that avoid highways.",
            "default": false
          },
          "avoid_ferries": {
            "title": "Avoid Ferries",
            "type": "boolean",
            "description": "Enable to prefer routes that avoid ferries.",
            "default": false
          },
          "transit_prefer": {
            "title": "Preferred Transit Mode",
            "enum": [
              "none",
              "bus",
              "subway",
              "train",
              "tram",
              "light_rail"
            ],
            "type": "string",
            "description": "Set a preferred public transit mode. Only applied when Travel Mode is 'Transit'. Leave as 'None' for no preference.",
            "default": "none"
          },
          "transit_routing": {
            "title": "Transit Routing Preference",
            "enum": [
              "none",
              "fewer_transfers",
              "less_walking",
              "wheelchair"
            ],
            "type": "string",
            "description": "Set how transit routes are optimized. Only applied when Travel Mode is 'Transit'. Leave as 'None' for the default.",
            "default": "none"
          },
          "time_type": {
            "title": "Time Mode",
            "enum": [
              "leave_now",
              "depart_at",
              "arrive_by"
            ],
            "type": "string",
            "description": "Choose whether the time below is a departure time, an arrival time, or to leave now. 'Leave now' ignores the time value.",
            "default": "leave_now"
          },
          "time_value": {
            "title": "Time",
            "type": "string",
            "description": "Set the departure or arrival time as an ISO 8601 datetime (e.g. '2026-06-01T09:00:00') or a Unix timestamp. Used only when Time Mode is 'Depart at' or 'Arrive by'."
          },
          "hl": {
            "title": "Language Code",
            "type": "string",
            "description": "Set the two-letter interface language code (ISO 639-1, e.g. 'en', 'es', 'fr'). Controls the language of instructions and place names. Defaults to 'en'.",
            "default": "en"
          },
          "gl": {
            "title": "Country Code",
            "type": "string",
            "description": "Set the two-letter country code (ISO 3166-1, e.g. 'us', 'gb', 'ca'). Influences regional routing and defaults. Defaults to 'us'.",
            "default": "us"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}