# OSRM Driving Routes & Directions Scraper (`parseforge/osrm-routing-scraper`) Actor

Compute driving, cycling, or walking routes between two coordinates using the OSRM open routing engine. Returns total distance, duration, route geometry, and optional turn-by-turn instructions.

- **URL**: https://apify.com/parseforge/osrm-routing-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $28.50 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

![ParseForge Banner](https://github.com/ParseForge/apify-assets/blob/ad35ccc13ddd068b9d6cba33f323962e39aed5b2/banner.jpg?raw=true)

## 🗺️ OSRM Routing Scraper

> 🚀 **Compute driving, cycling, and walking routes anywhere on Earth in seconds.** Distance, duration, geometry polylines, and turn-by-turn directions for any origin/destination pair, plus alternative routes and per-segment annotations. No sign-up, no map-tile licence.

> 🕒 **Last updated:** 2026-05-15 · **📊 17 fields** per record · **🌍 Global OSM coverage** · **🚗 3 travel profiles** · **🛣️ Up to 3 alternatives per route**

The **OSRM Routing Scraper** wraps the open-source **Project OSRM** routing engine and returns **17 fields per route**, including distance, duration, GeoJSON geometry, snap-to-road waypoints, and detailed turn-by-turn legs. OSRM is the routing engine behind countless mapping products, logistics apps, and academic mobility studies because it ships pre-built world graphs based on OpenStreetMap.

The catalogue covers **every road on OpenStreetMap**, with three profiles tuned for car, bicycle, and pedestrian travel. This Actor makes routing downloadable as CSV, Excel, JSON, or XML in under a minute. Every input runs server-side, so you skip the OSM extract, the contraction-hierarchies build, and the engine deploy entirely.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Logistics teams, delivery startups, GIS analysts, mobility researchers, travel-tech apps, urban planners, hobbyist developers | Last-mile route optimization, ETA calculation, distance matrices, travel-time isochrones, OD pair analytics, map-app prototypes |

---

### 📋 What the OSRM Routing Scraper does

Three travel profiles in a single run:

- 🚗 **Driving.** Car-friendly roads with realistic speed profiles.
- 🚴 **Cycling.** Bike-friendly paths, lanes, and shared roads.
- 🚶 **Foot.** Pedestrian routes including footways and crossings.

For each origin/destination pair you can request **alternative routes**, **turn-by-turn step instructions**, **per-segment annotations** (node IDs, durations, distances, speeds), and three levels of geometry detail (full, simplified, or none).

> 💡 **Why it matters:** routing infrastructure is hard. Self-hosting OSRM means downloading 60+ GB of OSM extracts, running multi-hour graph builds, and operating a high-availability service. This Actor skips the operational toil and gives you ready-to-use routes per request.

---

### 🎬 Full Demo

_🚧 Coming soon: a 3-minute walkthrough showing how to compute a global route batch from a CSV._

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td><code>maxItems</code></td><td>integer</td><td><code>10</code></td><td>Routes to return. Free plan caps at 10, paid plan at 1,000,000.</td></tr>
<tr><td><code>routes</code></td><td>array</td><td>2 example routes</td><td>List of route requests. Each item needs <code>startLat</code>, <code>startLon</code>, <code>endLat</code>, <code>endLon</code>, optional <code>via</code> array of intermediate lat/lon pairs.</td></tr>
<tr><td><code>profile</code></td><td>string</td><td><code>"driving"</code></td><td>Travel mode: <code>driving</code>, <code>cycling</code>, or <code>foot</code>.</td></tr>
<tr><td><code>alternatives</code></td><td>boolean</td><td><code>false</code></td><td>Request up to 3 alternative routes per pair.</td></tr>
<tr><td><code>steps</code></td><td>boolean</td><td><code>true</code></td><td>Include turn-by-turn step instructions.</td></tr>
<tr><td><code>annotations</code></td><td>boolean</td><td><code>false</code></td><td>Include per-segment node IDs, durations, distances, and speeds.</td></tr>
<tr><td><code>overview</code></td><td>string</td><td><code>"simplified"</code></td><td>Geometry detail: <code>full</code>, <code>simplified</code>, or <code>false</code>.</td></tr>
</tbody>
</table>

**Example: San Francisco to Los Angeles by car with alternatives.**

```json
{
    "maxItems": 5,
    "routes": [
        { "startLat": 37.7749, "startLon": -122.4194, "endLat": 34.0522, "endLon": -118.2437, "label": "SF → LA" }
    ],
    "profile": "driving",
    "alternatives": true,
    "steps": true,
    "overview": "full"
}
````

**Example: walking route across central London.**

```json
{
    "maxItems": 1,
    "routes": [
        { "startLat": 51.5007, "startLon": -0.1246, "endLat": 51.5074, "endLon": -0.0877, "label": "Big Ben → St Paul's" }
    ],
    "profile": "foot",
    "steps": true,
    "overview": "simplified"
}
```

> ⚠️ **Good to Know:** OSRM is built on OpenStreetMap, so route quality reflects OSM coverage in your region. Major cities and highways are excellent; remote dirt roads and recently built developments may lag behind reality. For safety-critical navigation, cross-check against an official map provider.

***

### 📊 Output

Each route record contains **17 fields**. Download the dataset as CSV, Excel, JSON, or XML.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🏷️ `label` | string | null | `"SF → LA"` |
| 🚗 `profile` | string | `"driving"` |
| 📍 `startLatitude` | number | `37.7749` |
| 📍 `startLongitude` | number | `-122.4194` |
| 📍 `endLatitude` | number | `34.0522` |
| 📍 `endLongitude` | number | `-118.2437` |
| 🔢 `routeIndex` | number | `0` |
| 📏 `distanceMeters` | number | `615321.4` |
| 🕒 `durationSeconds` | number | `21847.6` |
| 📏 `distanceKilometers` | number | `615.32` |
| 🕒 `durationMinutes` | number | `364.1` |
| 📊 `weight` | number | `21847.6` |
| 🏷️ `weightName` | string | `"routability"` |
| 📐 `geometry` | object | null | `{ "coordinates": [...], "type": "LineString" }` |
| 📦 `legs` | array | turn-by-turn legs with steps |
| 📍 `waypoints` | array | snapped lat/lon plus snap distance |
| 🕒 `snapshotTime` | ISO 8601 | `"2026-05-15T00:00:00.000Z"` |

#### 📦 Sample records

<details>
<summary><strong>🚗 Driving route: San Francisco to Los Angeles</strong></summary>

```json
{
    "label": "SF → LA",
    "profile": "driving",
    "startLatitude": 37.7749,
    "startLongitude": -122.4194,
    "endLatitude": 34.0522,
    "endLongitude": -118.2437,
    "routeIndex": 0,
    "distanceMeters": 615321.4,
    "durationSeconds": 21847.6,
    "distanceKilometers": 615.32,
    "durationMinutes": 364.1,
    "weight": 21847.6,
    "weightName": "routability",
    "geometry": { "coordinates": [[-122.4194, 37.7749], [-118.2437, 34.0522]], "type": "LineString" },
    "legs": [
        { "summary": "I-5 S", "distanceMeters": 615321.4, "durationSeconds": 21847.6, "steps": [] }
    ],
    "waypoints": [
        { "name": "Market Street", "latitude": 37.7749, "longitude": -122.4194, "snapDistanceMeters": 12.4 },
        { "name": "S Hill St", "latitude": 34.0522, "longitude": -118.2437, "snapDistanceMeters": 4.8 }
    ],
    "snapshotTime": "2026-05-15T00:00:00.000Z"
}
```

</details>

<details>
<summary><strong>🚴 Cycling route: London Bridge to Hyde Park</strong></summary>

```json
{
    "label": "London Bridge → Hyde Park",
    "profile": "cycling",
    "startLatitude": 51.5074,
    "startLongitude": -0.0877,
    "endLatitude": 51.507,
    "endLongitude": -0.1657,
    "routeIndex": 0,
    "distanceMeters": 6342.1,
    "durationSeconds": 1521.8,
    "distanceKilometers": 6.34,
    "durationMinutes": 25.4,
    "weight": 1521.8,
    "weightName": "routability",
    "geometry": { "coordinates": [[-0.0877, 51.5074], [-0.1657, 51.507]], "type": "LineString" },
    "legs": [
        { "summary": "Embankment", "distanceMeters": 6342.1, "durationSeconds": 1521.8, "steps": [] }
    ],
    "waypoints": [
        { "name": "Tooley Street", "latitude": 51.5074, "longitude": -0.0877, "snapDistanceMeters": 8.2 },
        { "name": "South Carriage Drive", "latitude": 51.507, "longitude": -0.1657, "snapDistanceMeters": 3.1 }
    ],
    "snapshotTime": "2026-05-15T00:00:00.000Z"
}
```

</details>

<details>
<summary><strong>🚶 Walking route: Big Ben to St Paul's Cathedral</strong></summary>

```json
{
    "label": "Big Ben → St Paul's",
    "profile": "foot",
    "startLatitude": 51.5007,
    "startLongitude": -0.1246,
    "endLatitude": 51.5138,
    "endLongitude": -0.0984,
    "routeIndex": 0,
    "distanceMeters": 2841.2,
    "durationSeconds": 2046.8,
    "distanceKilometers": 2.84,
    "durationMinutes": 34.1,
    "weight": 2046.8,
    "weightName": "routability",
    "geometry": { "coordinates": [[-0.1246, 51.5007], [-0.0984, 51.5138]], "type": "LineString" },
    "legs": [
        { "summary": "Victoria Embankment", "distanceMeters": 2841.2, "durationSeconds": 2046.8, "steps": [] }
    ],
    "waypoints": [
        { "name": "Bridge Street", "latitude": 51.5007, "longitude": -0.1246, "snapDistanceMeters": 5.2 },
        { "name": "St Paul's Churchyard", "latitude": 51.5138, "longitude": -0.0984, "snapDistanceMeters": 2.7 }
    ],
    "snapshotTime": "2026-05-15T00:00:00.000Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 🌍 | **Global coverage.** Every road on OpenStreetMap is routable. No region locks. |
| 🚗 | **Three travel profiles.** Driving, cycling, and walking, each with profile-tuned graph weights. |
| 🛣️ | **Alternative routes.** Up to 3 alternatives per origin/destination pair where they exist. |
| 📐 | **Detailed geometry.** Full GeoJSON polylines, simplified polylines, or geometry-free responses. |
| 🧭 | **Turn-by-turn legs.** Maneuver type, modifier, street name, distance, duration, and bearing on every step. |
| 📊 | **Per-segment annotations.** Node IDs, durations, distances, and speeds on demand. |
| 🚫 | **No sign-up.** No map-tile licence required. Works against the public OSRM open-source routing engine. |

> 📊 OSRM powers logistics apps, public-transport extensions, and academic mobility studies because it ships pre-built world graphs from OpenStreetMap.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| **⭐ OSRM Routing Scraper** *(this Actor)* | $5 free credit, then pay-per-use | **Global OSM** | **Live per request** | profile, alternatives, steps, geometry | ⚡ 2 min |
| Self-hosted OSRM | Free engine + servers | Global OSM | Manual graph rebuild | Same | 🐢 Days of ops |
| Commercial routing APIs | $0.50-$5 per 1k routes | Global proprietary | Live | Many | ⏳ Hours of integration |
| Map-app embeds | Free per user | Global proprietary | Live | App-bound | 🚫 Not bulk-friendly |

Pick this Actor when you want batched, queryable routing without operating your own OSRM cluster.

***

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the OSRM Routing Scraper page on the Apify Store.
3. 🎯 **Set input.** Add your route requests (lat/lon pairs), pick a profile, and toggle alternatives and steps.
4. 🚀 **Run it.** Click **Start** and let the Actor compute your routes.
5. 📥 **Download.** Grab your results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to downloaded routes: **3-5 minutes.** No coding required.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### 🚚 Logistics & Last-Mile Delivery

- Compute optimal driver routes across delivery stops
- Estimate ETAs for customer-facing apps
- Build distance and duration matrices for routing solvers
- Score warehouse locations by service-area drive times

</td>
<td width="50%" valign="top">

#### 🏙️ Urban Planning & Mobility Research

- Analyze cycling-network connectivity across a city
- Generate walking-time isochrones around transit stops
- Compare car versus bike commute times for policy briefs
- Evaluate accessibility of healthcare and schools

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### 🗺️ Travel-Tech & Map Apps

- Power MVP routing for travel-planner prototypes
- Add turn-by-turn directions to a travel itinerary app
- Compute multi-stop walking tours for tourism guides
- Suggest scenic alternatives between two waypoints

</td>
<td width="50%" valign="top">

#### 📊 GIS & Data Analytics

- Build OD matrices for spatial accessibility studies
- Enrich geocoded datasets with travel-time fields
- Stress-test geographic clustering with real road distances
- Train ML models that need ground-truth route durations

</td>
</tr>
</table>

***

### 🔌 Automating OSRM Routing Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. Daily route refreshes keep your delivery ETAs current.

***

### 🌟 Beyond business use cases

Routing data powers more than commercial workflows. The same structured records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Mobility studies on urban accessibility and equity
- Replicate published OD-matrix papers with cited data
- Teach geospatial analysis with real road graphs
- Power student transport-planning capstone projects

</td>
<td width="50%">

#### 🎨 Personal and creative

- Plot a personal cycling tour around a region
- Render artistic route maps for portfolios
- Build a hiking-time calculator for trail apps
- Generate routes for road-trip travel blogs

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Map walking-time access to clinics in low-income areas
- Plan disaster-response evacuation routes
- Score food-bank service areas by drive time
- Provide free routing data to journalism collectives

</td>
<td width="50%">

#### 🧪 Experimentation

- Train ML models that predict travel-time variability
- Validate accessibility hypotheses with real route data
- Prototype agent pipelines that resolve location-to-location distance
- Test routing UIs with live OSRM responses

</td>
</tr>
</table>

***

### 🤖 Ask an AI assistant about this scraper

Open a ready-to-send prompt about this ParseForge actor in the AI of your choice:

- 💬 [**ChatGPT**](https://chat.openai.com/?q=How%20do%20I%20use%20the%20OSRM%20Routing%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🧠 [**Claude**](https://claude.ai/new?q=How%20do%20I%20use%20the%20OSRM%20Routing%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🔍 [**Perplexity**](https://perplexity.ai/search?q=How%20do%20I%20use%20the%20OSRM%20Routing%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🅒 [**Copilot**](https://copilot.microsoft.com/?q=How%20do%20I%20use%20the%20OSRM%20Routing%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

Pass an array of route requests (lat/lon start and end), pick a profile, and toggle the data you want returned. The Actor calls the OSRM open-source routing engine and writes one record per route variant, with distance, duration, geometry, and turn-by-turn legs.

#### 📏 How accurate is the data?

OSRM is built on OpenStreetMap, so accuracy depends on OSM coverage in your area. Major cities and highways are excellent. Rural and recently built roads may lag. For safety-critical navigation, cross-check against an official map provider.

#### 🔁 How fresh is the underlying graph?

The OSRM open-source routing engine refreshes its public graphs on a regular cadence from OpenStreetMap extracts. Recent OSM edits may take a few weeks to propagate.

#### 🛣️ Does it return alternative routes?

Yes. Set <code>alternatives: true</code> to request up to 3 alternative routes per origin/destination pair, where they exist.

#### 🧭 Are turn-by-turn instructions included?

Yes. Set <code>steps: true</code> (default) to receive maneuver type, modifier, street name, distance, duration, and bearing for every step.

#### 📐 Can I get a full GeoJSON polyline?

Yes. Set <code>overview: "full"</code> to receive every coordinate. Use <code>"simplified"</code> for a smoothed polyline, or <code>"false"</code> to skip geometry entirely.

#### ⏰ Can I schedule regular runs?

Yes. Use Apify Schedules to refresh route batches hourly, daily, or weekly.

#### ⚖️ Is this data legal to use?

OpenStreetMap data is published under the Open Database License (ODbL). Attribution is required. The OSRM open-source routing engine itself is permissive open source.

#### 💼 Can I use this data commercially?

Yes, subject to OSM attribution and the ODbL share-alike clause for derived databases. Most product use cases qualify; consult the OSM licence for edge cases.

#### 💳 Do I need a paid Apify plan to use this Actor?

No. The free Apify plan is enough for testing and small runs (10 routes per run). A paid plan lifts the limit and enables scheduling.

#### 🆘 What if I need help?

Our support team is here to help. Contact us through the Apify platform or use the Tally form linked below.

***

### 🔌 Integrate with any app

OSRM Routing Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Get run notifications in your channels
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Pipe route data into your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits and releases
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets straight to Sheets

You can also use webhooks to trigger downstream actions when a run finishes. Push freshly computed routes into your dispatcher, or push ETAs to a customer-facing app.

***

### 🔗 Recommended Actors

- [**🗺️ Nominatim OSM Scraper**](https://apify.com/parseforge/nominatim-osm-scraper) - Geocode addresses via OpenStreetMap
- [**✈️ OurAirports Scraper**](https://apify.com/parseforge/ourairports-scraper) - Global airport master data with lat/lon
- [**🚇 MBTA Live Transit Scraper**](https://apify.com/parseforge/mbta-transit-scraper) - Boston transit routes, stops, vehicles, and predictions
- [**🚦 TfL London Live Status Scraper**](https://apify.com/parseforge/tfl-london-status-scraper) - Live London transport status and disruptions
- [**🌍 Overpass OSM Scraper**](https://apify.com/parseforge/overpass-osm-scraper) - Query arbitrary OpenStreetMap features

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more geospatial scrapers.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Project OSRM, OpenStreetMap, or any of their contributors. All trademarks mentioned are the property of their respective owners. Only publicly available open data is collected.

# Actor input Schema

## `routes` (type: `array`):

List of route requests. Each item must include startLat, startLon, endLat, endLon. Optionally add intermediate via-points as alternating lat/lon pairs.

## `sectionCaptionRouting` (type: `string`):

Set the travel profile and what extras to return.

## `profile` (type: `string`):

Mode of transport. Driving uses car-friendly roads, cycling prefers bike infrastructure, foot uses pedestrian paths.

## `alternatives` (type: `boolean`):

Request up to 3 alternative routes per origin/destination pair (where available).

## `steps` (type: `boolean`):

Include detailed step instructions (street names, maneuvers, distances) for each route leg.

## `annotations` (type: `boolean`):

Include node IDs, per-segment durations, distances, and speeds for advanced analysis.

## `overview` (type: `string`):

How detailed the route polyline should be. 'full' returns every coordinate; 'simplified' returns a smoothed path; 'false' omits geometry entirely.

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## Actor input object example

```json
{
  "routes": [
    {
      "startLat": 37.7749,
      "startLon": -122.4194,
      "endLat": 34.0522,
      "endLon": -118.2437
    },
    {
      "startLat": 51.5074,
      "startLon": -0.1278,
      "endLat": 48.8566,
      "endLon": 2.3522
    }
  ],
  "profile": "driving",
  "alternatives": false,
  "steps": true,
  "annotations": false,
  "overview": "simplified",
  "maxItems": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

Overview of scraped data

## `fullData` (type: `string`):

Complete dataset

# 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 = {
    "routes": [
        {
            "startLat": 37.7749,
            "startLon": -122.4194,
            "endLat": 34.0522,
            "endLon": -118.2437
        },
        {
            "startLat": 51.5074,
            "startLon": -0.1278,
            "endLat": 48.8566,
            "endLon": 2.3522
        }
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/osrm-routing-scraper").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 = {
    "routes": [
        {
            "startLat": 37.7749,
            "startLon": -122.4194,
            "endLat": 34.0522,
            "endLon": -118.2437,
        },
        {
            "startLat": 51.5074,
            "startLon": -0.1278,
            "endLat": 48.8566,
            "endLon": 2.3522,
        },
    ],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/osrm-routing-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "routes": [
    {
      "startLat": 37.7749,
      "startLon": -122.4194,
      "endLat": 34.0522,
      "endLon": -118.2437
    },
    {
      "startLat": 51.5074,
      "startLon": -0.1278,
      "endLat": 48.8566,
      "endLon": 2.3522
    }
  ],
  "maxItems": 10
}' |
apify call parseforge/osrm-routing-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/osrm-routing-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OSRM Driving Routes & Directions Scraper",
        "description": "Compute driving, cycling, or walking routes between two coordinates using the OSRM open routing engine. Returns total distance, duration, route geometry, and optional turn-by-turn instructions.",
        "version": "0.0",
        "x-build-id": "96W7daVz2bXNH1dhl"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~osrm-routing-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-osrm-routing-scraper",
                "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/parseforge~osrm-routing-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-osrm-routing-scraper",
                "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/parseforge~osrm-routing-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-osrm-routing-scraper",
                "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",
                "required": [
                    "routes"
                ],
                "properties": {
                    "routes": {
                        "title": "Routes to Compute",
                        "type": "array",
                        "description": "List of route requests. Each item must include startLat, startLon, endLat, endLon. Optionally add intermediate via-points as alternating lat/lon pairs."
                    },
                    "sectionCaptionRouting": {
                        "title": "Routing options",
                        "type": "string",
                        "description": "Set the travel profile and what extras to return."
                    },
                    "profile": {
                        "title": "Travel Profile",
                        "enum": [
                            "driving",
                            "cycling",
                            "foot"
                        ],
                        "type": "string",
                        "description": "Mode of transport. Driving uses car-friendly roads, cycling prefers bike infrastructure, foot uses pedestrian paths.",
                        "default": "driving"
                    },
                    "alternatives": {
                        "title": "Return Alternative Routes",
                        "type": "boolean",
                        "description": "Request up to 3 alternative routes per origin/destination pair (where available).",
                        "default": false
                    },
                    "steps": {
                        "title": "Include Turn-by-Turn Steps",
                        "type": "boolean",
                        "description": "Include detailed step instructions (street names, maneuvers, distances) for each route leg.",
                        "default": true
                    },
                    "annotations": {
                        "title": "Include Per-Segment Annotations",
                        "type": "boolean",
                        "description": "Include node IDs, per-segment durations, distances, and speeds for advanced analysis.",
                        "default": false
                    },
                    "overview": {
                        "title": "Geometry Detail",
                        "enum": [
                            "full",
                            "simplified",
                            "false"
                        ],
                        "type": "string",
                        "description": "How detailed the route polyline should be. 'full' returns every coordinate; 'simplified' returns a smoothed path; 'false' omits geometry entirely.",
                        "default": "simplified"
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
