{
  "openapi": "3.0.1",
  "info": {
    "title": "Route Optimizer: Vehicle Routing & Delivery Route Planner",
    "description": "Plan optimal delivery and service routes for one or more vehicles with Google OR-Tools: capacities, time windows, working hours, pickups and deliveries, skills. Stops from a list, CSV, Google Sheets or Google Maps Scraper results. Maps, times, Google Maps links. For AI agents.",
    "version": "0.1",
    "x-build-id": "Ete7bms6N8xtwdRBP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jumblemog~route-optimizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jumblemog-route-optimizer",
        "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/jumblemog~route-optimizer/runs": {
      "post": {
        "operationId": "runs-sync-jumblemog-route-optimizer",
        "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/jumblemog~route-optimizer/run-sync": {
      "post": {
        "operationId": "run-sync-jumblemog-route-optimizer",
        "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": {
          "stops": {
            "title": "Stops",
            "type": "array",
            "description": "The places to visit, as objects: {\"name\": \"Lincoln Park Market\", \"lat\": 41.9214, \"lng\": -87.6513}. Optional per stop: demand (a number, or {\"weight\": 120, \"volume\": 2} for several capacity kinds), pickup (amount collected and brought back to the depot), serviceMinutes, timeWindow (\"09:00-11:00\", several as \"09:00-11:00, 14:00-16:00\", or windowStart and windowEnd), priority (higher is kept first when not everything fits), optional (true: may be skipped), skills (such as [\"fridge\"]: only vehicles with them), vehicle (must go on this vehicle), address and id. Mark the depot with \"type\": \"depot\", or leave it out and the first stop is the depot. Field names are matched loosely, so latitude/longitude, quantity, service_time or time_window also work."
          },
          "stopsCsv": {
            "title": "Stops as CSV",
            "type": "string",
            "description": "CSV or TSV text with a header row, such as name,lat,lng,demand,timeWindow on the first line and Lincoln Park Market,41.9214,-87.6513,6,09:00-11:00 on the next. The same columns as Stops work."
          },
          "dataUrl": {
            "title": "Stop list link",
            "type": "string",
            "description": "A link to a CSV, TSV, JSON or Excel (.xlsx) file of stops. Google Sheets share links (shared as \"Anyone with the link\"), GitHub file links and JSON API answers work. The site's robots.txt is respected."
          },
          "datasetId": {
            "title": "Apify dataset of stops",
            "type": "string",
            "description": "Plan routes through the items of a dataset in your account, such as Google Maps Scraper results (title, address and location are read as they are). Up to 1,000 stops; the tool gets read access to this dataset only."
          },
          "depot": {
            "title": "Depot",
            "type": "object",
            "description": "Where vehicles start and finish: {\"name\": \"Warehouse\", \"lat\": 41.88, \"lng\": -87.65}, or {\"name\": \"Warehouse\"} to use the stop of that name. Leave empty to use the stop marked \"type\": \"depot\", or else the first stop."
          },
          "startAnywhere": {
            "title": "Start each route at any stop (no depot)",
            "type": "boolean",
            "description": "For routes that end at their last stop (Return to depot off): each route starts at whichever stop makes it shortest. Use it to find the best order to visit places with no fixed starting point.",
            "default": false
          },
          "vehicleCount": {
            "title": "Number of vehicles",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many identical vehicles (or drivers) are available. The plan uses as many as it needs, up to this number.",
            "default": 1
          },
          "capacity": {
            "title": "Capacity per vehicle",
            "minimum": 0,
            "type": "number",
            "description": "How much each vehicle carries, in the same unit as the stops' demand (parcels, kg, crates, seats). Empty: no limit. For several kinds (weight and volume) set capacity objects in Vehicles."
          },
          "vehicles": {
            "title": "Vehicles",
            "type": "array",
            "description": "Different vehicles, each an object: {\"name\": \"Truck\", \"count\": 2, \"capacity\": 1200, \"start\": {\"lat\": 41.9, \"lng\": -87.7}, \"end\": \"depot\", \"shiftStart\": \"07:00\", \"shiftEnd\": \"15:00\", \"skills\": [\"fridge\"], \"maxStops\": 20, \"maxDistance\": 150, \"costPerKm\": 0.6, \"costPerHour\": 25, \"fixedCost\": 40}. capacity can be an object for several kinds: {\"weight\": 1000, \"volume\": 12}. start and end default to the depot; end can also be \"anywhere\" (finish at the last stop). Replaces Number of vehicles."
          },
          "shiftStart": {
            "title": "Working hours start",
            "type": "string",
            "description": "When vehicles can leave, such as 08:00 or 8:30 am. Vehicles leave as late as they can without arriving after a time window or finishing later.",
            "default": "08:00"
          },
          "shiftEnd": {
            "title": "Working hours end",
            "type": "string",
            "description": "When vehicles must be back (or, for routes that don't return, finished), such as 17:00. Empty: no end."
          },
          "maxRouteHours": {
            "title": "Longest route (hours)",
            "minimum": 0.1,
            "maximum": 240,
            "type": "number",
            "description": "The most time a route may take from departure to return, waiting and service included."
          },
          "maxRouteDistance": {
            "title": "Longest route (distance)",
            "minimum": 0.1,
            "type": "number",
            "description": "The most distance one route may cover, in the plan's units (km or miles), such as an electric van's range."
          },
          "maxStopsPerVehicle": {
            "title": "Most stops per vehicle",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "The most stops one vehicle may visit."
          },
          "returnToDepot": {
            "title": "Return to depot",
            "type": "boolean",
            "description": "On: routes end back at the depot. Off: each route ends at its last stop (drivers going home, one-way trips).",
            "default": true
          },
          "objective": {
            "title": "Optimize for",
            "enum": [
              "distance",
              "time",
              "balanced",
              "vehicles",
              "cost"
            ],
            "type": "string",
            "description": "What the plan minimizes. With time windows, the distance, balanced and fewest-vehicles plans also avoid long waits when a short detour does.",
            "default": "distance"
          },
          "allowSkipping": {
            "title": "Leave out stops that don't fit",
            "type": "boolean",
            "description": "On: when not every stop fits (capacity, time windows, working hours), plan the rest and list the stops left out with the reason. Off: fail with the reasons instead. Stops marked optional can always be left out.",
            "default": true
          },
          "shipments": {
            "title": "Pickups and deliveries",
            "type": "array",
            "description": "Loads to carry from one place to another on the same vehicle, pickup first (couriers, food delivery, moving): [{\"name\": \"Order 17\", \"pickup\": {\"name\": \"Bakery\", \"lat\": 41.92, \"lng\": -87.70}, \"delivery\": {\"name\": \"Office\", \"lat\": 41.88, \"lng\": -87.63, \"timeWindow\": \"11:00-12:00\"}, \"load\": 2}]. Pickup and delivery take the same optional fields as stops."
          },
          "timeLimitSeconds": {
            "title": "Solving time (seconds)",
            "minimum": 0,
            "maximum": 600,
            "type": "integer",
            "description": "How long the solver searches for a better plan. 0: chosen from the size, about 1 s for 10 stops, 8 s for 100 and 60 s for 1,000. At most 30 s up to 50 stops, then 0.6 s per stop, since longer searches don't pay off.",
            "default": 0
          },
          "units": {
            "title": "Distance units",
            "enum": [
              "km",
              "mi"
            ],
            "type": "string",
            "description": "Units for distances in the results and for distance settings.",
            "default": "km"
          },
          "distanceSource": {
            "title": "Distance source",
            "enum": [
              "auto",
              "estimate",
              "matrix",
              "osrm"
            ],
            "type": "string",
            "description": "Estimated: the straight-line distance times Road factor, driven at Average speed. Good for comparing orders; a road network gives exact times.",
            "default": "auto"
          },
          "averageSpeed": {
            "title": "Average speed",
            "minimum": 1,
            "maximum": 200,
            "type": "number",
            "description": "For estimated travel times: average speed including stops at lights, in km/h (mph with miles). Default 35 km/h (22 mph), typical for city driving; try 60 to 80 for rural or highway routes."
          },
          "roadFactor": {
            "title": "Road factor",
            "minimum": 1,
            "maximum": 3,
            "type": "number",
            "description": "For estimated distances: how much longer road trips are than straight lines. 1.3 suits most cities; 1.2 for grid streets, 1.5 for rivers, hills or coastlines.",
            "default": 1.3
          },
          "distanceMatrix": {
            "title": "Distance matrix",
            "type": "array",
            "description": "Road distances between every pair of places, one row and one column per place, in km (miles with Distance units miles): the depot first unless it's one of the stops, then the stops in the order given, then each shipment's pickup and delivery. null marks pairs that can't be reached."
          },
          "durationMatrix": {
            "title": "Travel time matrix (minutes)",
            "type": "array",
            "description": "Driving minutes between every pair of places, in the same order as the distance matrix. Without it, times come from the distances at Average speed."
          },
          "routingResponse": {
            "title": "Routing service response",
            "type": "object",
            "description": "A matrix response pasted as it is: an OSRM table, OpenRouteService matrix or Google Distance Matrix API answer, with places in the same order as for the distance matrix. Meters and seconds are converted."
          },
          "osrmUrl": {
            "title": "OSRM server",
            "type": "string",
            "description": "The address of an OSRM routing server you're allowed to use, such as https://osrm.example.com, for real road distances and times (one table request per plan, up to 400 places)."
          },
          "osrmProfile": {
            "title": "OSRM profile",
            "type": "string",
            "description": "The OSRM profile: driving, car, bike or foot, as your server names them.",
            "default": "driving"
          },
          "costPerDistance": {
            "title": "Cost per km (or mile)",
            "minimum": 0,
            "type": "number",
            "description": "Fuel, wear and tolls per km, or per mile with Distance units miles."
          },
          "costPerHour": {
            "title": "Cost per hour",
            "minimum": 0,
            "type": "number",
            "description": "Driver and vehicle cost per hour of route time, waiting and service included."
          },
          "costPerVehicle": {
            "title": "Cost per vehicle used",
            "minimum": 0,
            "type": "number",
            "description": "A fixed cost for each vehicle that goes out, such as a day's rental or a driver's minimum pay."
          },
          "chart": {
            "title": "Route map",
            "type": "boolean",
            "description": "Draw a map of the routes: each vehicle's route in its own color with numbered stops, the depot, the stops left out and a scale bar.",
            "default": true
          },
          "chartFormats": {
            "title": "Map formats",
            "type": "array",
            "description": "The map's file formats. Each plan also gets a CSV of every stop and a GeoJSON file of the routes.",
            "items": {
              "type": "string",
              "enum": [
                "png",
                "svg",
                "pdf",
                "html"
              ],
              "enumTitles": [
                "PNG image",
                "SVG (vector)",
                "PDF",
                "Interactive HTML (stop details on hover)"
              ]
            },
            "default": [
              "png"
            ]
          },
          "chartTheme": {
            "title": "Map theme",
            "enum": [
              "light",
              "dark"
            ],
            "type": "string",
            "description": "The map's colors.",
            "default": "light"
          },
          "title": {
            "title": "Title",
            "type": "string",
            "description": "The plan's title on the map and in the results, such as Monday deliveries."
          },
          "plans": {
            "title": "Several plans (JSON)",
            "type": "array",
            "description": "Many plans in one run, each an object with its own stops and settings: [{\"title\": \"Monday\", \"stops\": [...]}, {\"title\": \"Tuesday\", \"datasetId\": \"...\", \"vehicleCount\": 3}]. Settings outside plans apply to every plan, and a plan with its own stops doesn't use the shared stops or depot."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}