Real road distance, never straight lines
Every distance and ETA traverses the OpenStreetMap road network with one-way streets, turn restrictions, and road class speeds — returned in meters, miles, seconds, and readable text.
Accurate driving distance and drive time on real roads. Sub-5 ms gateway overhead, the Wayline routing engine, and transparent per-request pricing.
Try every API free in the playground. Add a card to unlock API keys.
Developer-first
curl "https://api.wayline.cloud/v1/distance?origin=37.788,-122.4075&destination=37.8044,-122.2712&units=imperial" \
-H "Authorization: Bearer $WAYLINE_API_KEY"const res = await fetch(
"https://api.wayline.cloud/v1/distance?origin=37.788,-122.4075&destination=37.8044,-122.2712&units=imperial",
{ headers: { Authorization: `Bearer ${process.env.WAYLINE_API_KEY}` } },
);
if (!res.ok) throw new Error(`Wayline ${res.status}: ${await res.text()}`);
const data = await res.json();
console.log(data);import os, requests
res = requests.get(
"https://api.wayline.cloud/v1/distance",
params={"origin": "37.788,-122.4075", "destination": "37.8044,-122.2712", "units": "imperial"},
headers={"Authorization": f"Bearer {os.environ['WAYLINE_API_KEY']}"},
timeout=10,
)
res.raise_for_status()
print(res.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.wayline.cloud/v1/distance?origin=37.788,-122.4075&destination=37.8044,-122.2712&units=imperial", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("WAYLINE_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(body))
}<?php
$ch = curl_init("https://api.wayline.cloud/v1/distance?origin=37.788,-122.4075&destination=37.8044,-122.2712&units=imperial");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WAYLINE_API_KEY")],
CURLOPT_TIMEOUT => 10,
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://api.wayline.cloud/v1/distance?origin=37.788,-122.4075&destination=37.8044,-122.2712&units=imperial")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("WAYLINE_API_KEY")}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts JSON.parse(res.body)import java.net.URI;
import java.net.http.*;
public class Main {
public static void main(String[] args) throws Exception {
var req = HttpRequest.newBuilder(URI.create("https://api.wayline.cloud/v1/distance?origin=37.788,-122.4075&destination=37.8044,-122.2712&units=imperial"))
.header("Authorization", "Bearer " + System.getenv("WAYLINE_API_KEY"))
.GET().build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());
}
}import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> main() async {
final res = await http.get(
Uri.parse('https://api.wayline.cloud/v1/distance?origin=37.788,-122.4075&destination=37.8044,-122.2712&units=imperial'),
headers: {'Authorization': 'Bearer ${Platform.environment['WAYLINE_API_KEY']}'},
);
print(jsonDecode(res.body));
}{
"request_id": "req_01JD8Q4ZK7V3",
"distance_meters": 19870,
"duration_seconds": 1260,
"distance_miles": 12.3,
"distance_text": "12.3 mi",
"duration_text": "21 mins",
"region": "us",
"map_version": "20261121-2330",
"units_charged": 1
}Why Wayline
Every distance and ETA traverses the OpenStreetMap road network with one-way streets, turn restrictions, and road class speeds — returned in meters, miles, seconds, and readable text.
A stateless Go gateway with request coalescing in front of the regional Wayline Engine — built for ≥ 2,000 req/s per node.
Published per-unit prices, free units to start, spend limits and no charges for 4xx/5xx responses.
HMAC-hashed keys shown once, origin and IP allowlists, separate free test keys and audit-logged admin ops.
Track requests, billable units, and projected charges month-to-date and over 15/30-day charts in your console.
Each region runs its own OpenStreetMap extract and reports its exact map version in every response.
APIs
Road distance and drive time between two points.
Many-to-many distances and durations.
Turn-by-turn routes and geometry.
Consecutive legs for check-ins and mileage.
Snap GPS points to the nearest road.
Drop-in Distance Matrix endpoint.
Addresses and places to coordinates.
Coordinates to addresses and admin areas.
Best visiting order for up to 100 stops.
Zoomable maps for websites and apps.
Route images with numbered stops.
Migrate
Already using the Google Distance Matrix API with coordinates? Point your client at Wayline and keep your parsing code. See the migration guide.
- https://maps.googleapis.com/maps/api/distancematrix/json
- ?origins=…&destinations=…&key=GOOGLE_KEY
+ https://api.wayline.cloud/maps/api/distancematrix/json
+ ?origins=…&destinations=…&key=$WAYLINE_API_KEYGoogle Maps is a trademark of Google LLC. Wayline is not affiliated with Google. Differences: coordinates only (no address geocoding), driving only, no live traffic yet.
Pricing
| Endpoint | Per unit | Per 1,000 |
|---|---|---|
Distance | $0.0008 | $0.80 |
Route | $0.001 | $1.00 |
Batch distance | $0.0008 | $0.80 |
Distance matrix | $0.0004 | $0.40 |
Snap to road | $0.0005 | $0.50 |
Distance Matrix (Google-compatible) | $0.0004 | $0.40 |
Visit-order optimization | $0.0015 | $1.50 |
Geocoding | $0.0006 | $0.60 |
Reverse geocoding | $0.0006 | $0.60 |
Static map images | $0.0005 | $0.50 |
Map tiles | $0.0001 | $0.10 |
Reliability & security
Redundant gateways, health-checked routing pools and zero-downtime map updates. Live status on our status page.
Access logging, change management, encrypted backups and incident runbooks. We are not SOC 2 certified today.
Keys are hashed at rest, shown once, and can be restricted by origin and IP. Every staff action is audit-logged.
Read about our security practices and the SLA. Performance figures will be published with our benchmark methodology.
Coverage
We add regions from OpenStreetMap extracts on request. Tell us where you need routing and the volume you expect.
Request a regionA distance API returns the distance and travel time between locations. Wayline computes real driving distance along the road network — not straight-line distance — and returns meters, miles, seconds and readable text.
Usage-based. Each endpoint has a published per-unit price; new accounts get free units, and only successful (2xx) responses are billed. You are billed monthly in arrears through Paddle, and you can set a monthly spend limit.
Yes. Our Google-compatible endpoint returns the same JSON structure, so most integrations only change the base URL and API key. Note that we accept coordinates, not addresses, and do not include live traffic yet.
From OpenStreetMap, processed on Wayline's own routing infrastructure. Every response includes the region and map version used. Map data © OpenStreetMap contributors.
Yes — open-source SDKs for TypeScript/JavaScript, Python, Go, PHP, Ruby, Java/Kotlin and Dart with retries, typed errors and timeouts built in. Plain HTTPS works from any language.
Create an account, grab a test key and make your first request in under five minutes.