
Comprehensive documentation for the intelligent art tour planning API
The /maps/tour endpoint provides intelligent art tour planning based on available time, similar to Komoot for art galleries. It creates optimized routes that include gallery visits, travel time, and optional restaurant stops.
GET /maps/tour
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
lat |
float | Yes | - | Starting latitude |
lng |
float | Yes | - | Starting longitude |
total_time |
integer | Yes | - | Total available time in minutes (30-480) |
gallery_time |
integer | No | 20 | Time to spend at each gallery in minutes (10-120) |
include_restaurant |
boolean | No | false | Whether to include a restaurant stop |
restaurant_time |
integer | No | 45 | Time to spend at restaurant in minutes (15-120) |
loop |
boolean | No | true | Whether to return to starting point |
max_galleries |
integer | No | 5 | Maximum number of galleries to visit (1-10) |
GET /maps/tour?lat=50.935173&lng=6.953101&total_time=120
GET /maps/tour?lat=50.935173&lng=6.953101&total_time=180&include_restaurant=true&restaurant_time=60
GET /maps/tour?lat=50.935173&lng=6.953101&total_time=120&gallery_time=30&max_galleries=3
GET /maps/tour?lat=50.935173&lng=6.953101&total_time=120&loop=false
{
"success": true,
"tour": {
"stops": [
{
"type": "restaurant",
"name": "Café Central",
"address": "Hohe Straße 123, Cologne",
"lat": 50.935173,
"lng": 6.953101,
"time_minutes": 45,
"walking_time_minutes": 5,
"distance_km": 0.3,
"description": "Lunch break"
},
{
"type": "gallery",
"id": 123,
"name": "Contemporary Art Exhibition",
"space_name": "Galerie Modern",
"address": "Kunststraße 45, Cologne",
"lat": 50.936000,
"lng": 6.954000,
"visit_time_minutes": 20,
"travel_time_minutes": 8,
"total_time_minutes": 28,
"distance_km": 0.5,
"exhibition": {
"id": 123,
"name": "Contemporary Art Exhibition",
"opening_datetime": "2024-01-15T10:00:00",
"closing_datetime": "2024-03-15T18:00:00"
}
},
{
"type": "return",
"name": "Return to start",
"lat": 50.935173,
"lng": 6.953101,
"travel_time_minutes": 12,
"total_time_minutes": 12,
"distance_km": 0.8,
"description": "Return to starting point"
}
],
"total_time_minutes": 130,
"total_distance_km": 1.6,
"gallery_count": 1,
"includes_restaurant": true
},
"summary": {
"total_stops": 3,
"gallery_count": 1,
"restaurant_count": 1,
"total_time_minutes": 130,
"requested_time_minutes": 120,
"time_utilization_percent": 108.3,
"total_distance_km": 1.6,
"average_time_per_gallery": 130.0
}
}
{
"success": false,
"message": "No galleries found within the specified time range",
"tour": null
}
The tour planning uses a greedy algorithm that:
Perfect for iOS/Android apps that need to provide “one-click” art tour planning:
// Example mobile app usage
const planTour = async (lat, lng, totalTime) => {
const response = await fetch(`/maps/tour?lat=${lat}&lng=${lng}&total_time=${totalTime}&include_restaurant=true`);
const tour = await response.json();
if (tour.success) {
// Display tour on map
displayTourOnMap(tour.tour.stops);
// Show tour summary
showTourSummary(tour.summary);
}
};
Ideal for web-based art discovery platforms:
// Example web app usage
const createArtTour = async (userLocation, preferences) => {
const params = new URLSearchParams({
lat: userLocation.lat,
lng: userLocation.lng,
total_time: preferences.duration,
gallery_time: preferences.galleryTime || 20,
include_restaurant: preferences.includeLunch,
loop: preferences.returnToStart !== false
});
const response = await fetch(`/maps/tour?${params}`);
return await response.json();
};
findDistance finderThe endpoint handles various error conditions:
Potential improvements for the tour planning system: