
Route Planner API
- Our Route Planner API is powerful and flexible enough to solve your vehicle routing and schedule optimization problems.
- Use our API to create routing, logistics, and delivery solutions for your business. Or use it to build a platform for your customers.
- Get started with free route optimization!
Visit our Documentation page to learn more about features, or try our free route planner now in our Playground!
On this page
Try Our Route Planner API
Try our live demo and see our route planning API in action. Select an area on the map, choose a vehicle route optimization task, and see how to solve it. It's easy:
1. Select a task from the list
The simulator will search for locations that fit the task description and display them on the map. You can look at vehicle starting positions, residences and buildings, warehouses etc. We use Places API to search locations on the map.
2. Press Optimize to calculate routes
The Route Planner API will find the best route for vehicles or agents. You can see the results on the map and displayed as a timeline.
3. Select a new map view to regenerate the task
Move the map around to choose a different view. Press “regenerate the task” to get new locations for the Route Planner API and see matching solutions.
Use Cases
Optimal route planning is key to success for any business focused on logistics, delivery, or building routes for people. Our Route Planner API helps you build the solutions you need to solve routing tasks, or to create route planner solutions for your customers.
Route Optimization API for Multi-Vehicle Planning
Use our route optimization API to solve multi-vehicle planning tasks with constraints, priorities, and time windows. This routing optimization API helps dispatchers and operations teams reduce travel time while keeping schedules realistic.
Solve your most important routing tasks
Use our Route Planner API to solve your business routing tasks. Our route optimization API is flexible and customizable, so you can use it to solve your tasks in the most efficient and affordable way.
Whatever your exact requirements, our route planning API helps you develop a route planning solution. Once your solution is built, you'll get the results in the format you need.
You can also use it as a route builder to generate optimized plans and as a route organizer to manage daily route schedules.
Our interface gives you transparent charges for route calculation, and we don't charge extra for additional drivers, users or displays.
Use Route Planner API to build and sell solutions
Our paid plans allow white labeling, so you can build route organizer solutions and sell them under your own brand. Our white labeling doesn't incur extra costs, restrictions or limitations. You pay for the route calculations only.
Features and capabilities
Solve route optimization problems
Route Planner API is flexible so you can develop solutions for the most well-known route optimization problems:
- Building routes for multiple vehicles or agents
- Building the optimal route for pickups and deliveries
- Scheduling and route planning for professional services
Consider constraints
Build solutions that take into account constraints such as:
- Vehicle / agent capacity
- Vehicle / agent capabilities such as vehicle features or agent tools and skills
- Specific job requirements
Set time frames
Create solutions that let you or your customers set time windows for vehicles, agents and jobs:
- Set service times
- Set working and opening hours
- Set lunch breaks
Set different travel modes
- Optimize routes for different travel modes
- Build a solution that returns the best route for cars, trucks, motorcycles, bicycles, or walking.
- Go here to see the full list (search for “travel modes”)
Avoid specific parts of routes
- Create solutions that allow adding barriers around some locations to avoid them
- Avoid tolls
- Avoid specific parts of routes such as countries or cities
You can find the complete list of Route Planner API features on the API documentation page.
Getting started
1. Visit our Playground to explore Route Planner API features, input and output parameters
See examples of tasks you can solve with our route planning API in the API Playground. Choose a task that is similar to yours from the dropdown list, and check the API request object and result structure.
The input object describes the Route Planner task, and the returned object contains a GeoJSON.FeatureCollection object where each object represents an agent execution plan.
Here are examples of input and result objects:
- Input object example
- Result object example
{
"mode":"drive",
"agents":[
{ "start_location":[ -3.6705633, 40.5172291 ], "time_windows":[ [ 0, 10800 ] ] },
{ "start_location":[ -3.651263064675685, 40.51553235 ], "time_windows": [ [ 0, 10800 ] ] },
{ "start_location":[ -3.660241470310801, 40.5176717 ], "time_windows":[ [ 0, 10800 ] ] }
],
"shipments":[
{ "id": "order_1", "pickup": { "location_index": 0, "duration": 120 }, "delivery": { "location":[ -3.67715033613878, 40.509209439673135 ], "duration":240 } },
{ "id": "order_2", "pickup": { "location_index": 0, "duration": 120 }, "delivery": { "location":[ -3.67715033613878, 40.509209439673135 ], "duration":120 } },
{ "id": "order_6", "delivery": { "location_index": 0, "duration":120 }, "pickup":{ "location":[ -3.6779564485281186, 40.5109186 ], "duration":120 } },
...
],
"locations":[
{ "id":"warehouse-0", "location": [-3.6716357, 40.513842 ]}
]
}The documentation page has detailed information about the API specification, billing details, and code samples.
2. Get your Geoapify API key
You'll need an API Key to use the API. Register on MyProject Geoapify to get yours.
3. Generate HTTP Post request
Generate an HTTP post request with input data and make the call. You can use request objects from the API Playground as examples of how you could use our route optimization API for your business. Here are examples of calling Route Planner API:
- JavaScript
- Node.js-fetch
- Python
- PHP
fetch('https://api.geoapify.com/v1/routeplanner?apiKey=YOUR_API_KEY', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(routePlannerInput)
})
.then(res => res.json())
.then(res => console.log(res));4. Process and visualize results
The API returns a FeatureCollection GeoJSON object as a result. As most map client libraries (MapLibre GL, Mapbox GL, Leaflet, OpenLayers, etc.) natively support GeoJSON, the result can be easily visualized on a map. Check out code samples of Route Planner API data processing and GeoJSON visualization on Geoapify APIDocs.
NPM Library
@geoapify/route-planner-sdk
Use our NPM package @geoapify/route-planner-sdk to integrate route optimization and delivery planning into your applications.
The Geoapify Route Optimization SDK is a lightweight, dependency-free TypeScript library for the Route Planner API. It helps you build requests, execute optimization tasks, inspect structured output, and modify planned routes in a developer-friendly way.
The SDK works in both frontend (browser) and backend (Node.js) environments.
Key features
- Fluent API for building route planning input (
RoutePlanner,Agent,Job,Shipment, and more) - Structured result handling via
RoutePlannerResult(raw + parsed route data) - Post-optimization editing with
RoutePlannerResultEditor(reassign jobs, remove stops, re-sequence visits) - Timeline extraction with
RoutePlannerTimelinefor schedule and visualization use cases
Example usage
const planner = new RoutePlanner({ apiKey: API_KEY });
planner.setMode("drive");
// Add 3 agents (vehicles) with working time windows
planner.addAgent(new Agent().setStartLocation(44.50485912329202, 40.177547000000004).addTimeWindow(0, 7200));
planner.addAgent(new Agent().setStartLocation(44.50485912329202, 40.177547000000004).addTimeWindow(0, 7200));
planner.addAgent(new Agent().setStartLocation(44.50485912329202, 40.177547000000004).addTimeWindow(0, 7200));
// Add a warehouse location
planner.addLocation(new Location().setId("warehouse-0").setLocation(44.5130974, 40.1766863));
// Add shipments (orders) with pickup & delivery points
planner.addShipment(
new Shipment().setId("order-1")
.setDelivery(new ShipmentStep().setDuration(120).setLocation(44.50932929564537, 40.18686625))
.setPickup(new ShipmentStep().setDuration(120).setLocationIndex(0))
);
planner.addShipment(
new Shipment().setId("order-2")
.setDelivery(new ShipmentStep().setDuration(120).setLocation(44.511160727462574, 40.1816037))
.setPickup(new ShipmentStep().setDuration(120).setLocationIndex(0))
);
// Add avoidance rules
planner.addAvoid(new Avoid().setType("tolls"));
planner.addAvoid(new Avoid().addValue(40.50485912329202, 42.177547000000004).setType("locations"));
// Set optimization preferences
planner.setTraffic("approximated");
planner.setType("short");
planner.setUnits("metric");
planner.setMaxSpeed(10);
// Run the route optimization
const result = await planner.plan();You can use the result to display optimized routes, manage deliveries, or integrate the output into your logistics system. The library helps you automate route planning and easily adjust parameters when needed.
How Much Does It Cost?
We've kept our costs straightforward, and you can get started for free with our free route planner. Start developing your application today, and then extend depending on your needs.
The cost of a request depends on the number of locations you specify. Locations include:
- agent start and end locations
- shipment pickup, delivery
- and job locations.
Then the API request cost is calculated as follows:
- For requests with less than 10 locations, REQUEST_COST = NUMBER_OF_LOCATIONS * NUMBER_OF_LOCATIONS
- For requests with more than 10 locations, REQUEST_COST = NUMBER_OF_LOCATIONS * 10
So, for example, if you have 7 agents with start and end locations set + 30 jobs, ( 7*2 + 30 = 44 location in total) will cost 44 * 10 = 440 credits.
We have a Freemium pricing model that includes 3000 free credits per day. When you have big volumes, we offer unmetered tariffs from 700€ / month.
Check our Pricing Plans to learn more, and use our credits calculator to figure out which Pricing Plan is most appropriate for you.
Not sure which pricing plan you'll need? Get in touch and we'll help you figure out the best plan for your business.
FAQ
Is the Route Planner API GDPR compliant?
We are a German company and provide GDPR-compliant services. Our default API endpoints use only European data centers. Dedicated endpoints can utilize other server locations, even located in your intranet.
Which variants of VRP can be solved by Geoapify Route Planner API?
Use our route optimization API to solve many variations of VRP including the Travelling salesman problem (TSP), Capacitated Vehicle Optimization Problem (CVRP), Vehicle Routing Problem with Time Windows (VRPTW), Multi-Depot Vehicle Routing Problem (MDVRP), and Pickup and Delivery Problem with Time Windows (PDPTW).
Can I combine Constraints and Time Windows in one task?
Sure! You can solve any mix of the supported VRP variants.
Can we integrate the Route Planner API into our ERP system and sell it to our customers?
Absolutely. You can develop your own Route Planner that uses the API and sell it.
What is a route optimization API?
A route optimization API calculates efficient routes and schedules across multiple stops, vehicles, and constraints such as time windows, capacities, and job requirements.
Can I use Geoapify as a route builder or route organizer?
Yes. You can use Geoapify Route Planner API as a route builder to create optimized routes and as a route organizer to structure and manage recurring delivery or service schedules.
Can I edit routes after optimization?
Yes, route editing is possible. In JavaScript, we provide the @geoapify/route-planner-sdk, which includes tools for post-optimization updates such as adjusting assignments and updating route plans programmatically. If you use another language or backend stack, the recommended approach is to recalculate the task with the new conditions (for example updated time windows, changed priorities, removed stops, or reassigned jobs) so the API returns a fresh optimized plan that reflects the latest constraints.
What are the Route Planner API limits, and how can I process larger tasks?
The synchronous Route Planner API supports up to 300 unique locations per optimization task by default. For larger asynchronous workloads, use the Batch API, which supports bigger route-planning jobs (up to 1000 locations) in background mode.
We expect to have high volumes of API requests. Can we have custom conditions?
Yes! Contact us, and we will find conditions beneficial for both sides!
