# Road Trip Planner (`malachite_illusion/road-trip-planner`) Actor

"Instantly plan safe road trips. Calculates overnight stops based on your driving limit and finds top-rated hotels at each stop."

- **URL**: https://apify.com/malachite\_illusion/road-trip-planner.md
- **Developed by:** [Dipak Kumar](https://apify.com/malachite_illusion) (community)
- **Categories:** Travel, Automation, Agents
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🚗 Road Trip Rest Planner

**Instantly plan safe, optimized road trips with automatic hotel suggestions based on your personal driving limits.**

Driving while tired is dangerous. The **Road Trip Rest Planner** solves this by calculating exactly where you need to stop for the night based on your specific driving limit (e.g., 8 hours per day). Instead of giving you random coordinates in the middle of nowhere, it intelligently scans the area for the **highest-rated hotels** and builds your itinerary around them.

***

### 🌟 Key Features

- **⏱️ Smart Rest Logic:** You set the limit (e.g., "I only want to drive 6 hours a day"). We calculate exactly where you will be on the route when that time runs out.
- **🏨 Intelligent Hotel Finder:** The tool automatically searches for **4+ star hotels** near your calculated stop location and suggests the best one as your primary stop.
- **📍 Real-World Accuracy:** Uses the **Google Maps Directions API** (not straight-line distance) to account for traffic patterns, highway speeds, and actual road paths.
- **🆓 Instant Demo Mode:** Want to test the JSON format? Run it **without an API key** to see a sample itinerary instantly.
- **🔗 Ready-to-Click Links:** Returns direct Google Maps links for every hotel, so you can book or navigate immediately.

***

### 📋 Input Parameters

| Field | Type | Description | Default |
| :--- | :--- | :--- | :--- |
| `origin` | String | The city or specific address where you are starting. | `New York, NY` |
| `destination` | String | The city or specific address where you want to go. | `Boston, MA` |
| `hrs_per_day` | Number | Maximum number of hours you want to drive before sleeping. | `8` |
| `google_api_key` | String | **Required for real results.** Your Google Maps API Key. (Leave empty to run in Demo Mode). | `None` |

> **⚠️ Important:** To get real data, you must provide a valid Google Maps API Key with the **Directions API** and **Places API (New)** enabled.

***

### 💾 Data Output Reference

The results are saved in a structured dataset. You can download them as JSON, CSV, XML, or Excel.

#### Root Fields

| Field | Type | Description |
|---|---|---|
| `status` | String | Result status (`SUCCESS` or `DEMO_MODE`). |
| `origin` | String | The starting point of the trip. |
| `destination` | String | The final destination. |
| `total_trip_hours` | Number | Total pure driving time (excluding stops) calculated by Google Maps. |
| `stops_required` | Number | The number of overnight stops needed based on your daily limit. |
| `itinerary` | Array | A list of daily stops (see below). |

#### Itinerary Object (Daily Stops)

Inside the `itinerary` list, each "stop" contains:

| Field | Type | Description |
|---|---|---|
| `day_number` | Number | The sequential day of the trip (1, 2, 3...). |
| `stop_location` | String | The name of the best hotel or city where the day ends. |
| `approx_driving_hours` | Number | How many hours of driving are scheduled for this specific day. |
| `suggested_hotels` | Array | A list of alternative top-rated hotels found nearby. |

#### Hotel Object

Inside `suggested_hotels`, each hotel contains:

| Field | Type | Description |
|---|---|---|
| `name` | String | The official name of the hotel. |
| `rating` | Number | Google Maps user rating (e.g., 4.5). |
| `address` | String | The local address or vicinity. |
| `map_link` | String | A direct, clickable URL to open this hotel in Google Maps. |

***

### 📊 Sample Output (JSON)

````json
{
  "status": "SUCCESS",
  "origin": "Delhi, India",
  "destination": "Bangalore, Karnataka, India",
  "total_trip_hours": 37.3,
  "stops_required": 4,
  "itinerary": [
    {
      "day_number": 1,
      "stop_location": "Country Inn & Suites by Radisson, Kota",
      "approx_driving_hours": 8.1,
      "suggested_hotels": [
        {
          "name": "Country Inn & Suites by Radisson",
          "rating": 4.5,
          "address": "Jhalawar Road, Kota",
          "map_link": "http://googleusercontent.com/maps..."
        }
      ]
    }
  ]
}

# Actor input Schema

## `origin` (type: `string`):

Enter the starting city (e.g., New York, NY)
## `destination` (type: `string`):

Enter the destination city (e.g., Miami, FL)
## `hrs_per_day` (type: `integer`):

Max hours you want to drive each day
## `google_api_key` (type: `string`):

Required for real results. Leave empty for Demo Mode.

## Actor input object example

```json
{
  "hrs_per_day": 8
}
````

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("malachite_illusion/road-trip-planner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("malachite_illusion/road-trip-planner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call malachite_illusion/road-trip-planner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,malachite_illusion/road-trip-planner"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Kef0WrBgp4q1koFO3/builds/9JfPNWhqFih6G47XX/openapi.json
