Distance, matrices and snap-to-road API

The road distance API built for scale

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.

POST/v1/route
37.79,-122.41 → 37.80,-122.27
Presets:
Sample preview
Road distance
~9.6 mi
Drive time
~29 min
Region
us
Map data
—
Gateway overhead
< 5 ms
Stateless Go edge
Routing engine
Wayline Engine
Car & motorcycle road graph
Target uptime
99.95%
Zero-downtime updates
Failed requests
$0.00
Only 2xx billed

Developer-first

One request. Real road distance.

Plain HTTPS from any language, or use our typed SDKs. Coordinates use Google’s lat,lng order.
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"
Response · 200 OKJSON
{
  "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

Everything you need to ship location features

Turn-by-turn road graph

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.

Haversine (straight-line)4.8 mi
Wayline road graph6.5 mi · 23 min

Built for throughput

A stateless Go gateway with request coalescing in front of the regional Wayline Engine — built for ≥ 2,000 req/s per node.

Gateway overhead (p99)< 5 ms

Transparent pricing

Published per-unit prices, free units to start, spend limits and no charges for 4xx/5xx responses.

Secure by default

HMAC-hashed keys shown once, origin and IP allowlists, separate free test keys and audit-logged admin ops.

Usage you can see

Track requests, billable units, and projected charges month-to-date and over 15/30-day charts in your console.

Region-based coverage

Each region runs its own OpenStreetMap extract and reports its exact map version in every response.

APIs

Eleven APIs, one key

Migrate

Switch from Google in one line

Already using the Google Distance Matrix API with coordinates? Point your client at Wayline and keep your parsing code. See the migration guide.

  • Compatible JSON status & element shape
  • Predictable per-element billing
  • Zero code changes to response parsers
Base URL change
- 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_KEY

Google 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

Pay only for successful requests

Prices update here automatically. Every new account gets 25,000 free request units. Full pricing and calculator.
Wayline API prices in USD
EndpointPer unitPer 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

Built like infrastructure you can depend on

  • 99.95% availability target

    Redundant gateways, health-checked routing pools and zero-downtime map updates. Live status on our status page.

  • SOC 2-minded practices

    Access logging, change management, encrypted backups and incident runbooks. We are not SOC 2 certified today.

  • Keys done right

    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

Where you can route today

Each region runs its own road network built from OpenStreetMap, with a published map version. New regions are added on request. All coverage details.

Frequently asked questions

What is a distance API?

A 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.

How is Wayline priced?

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.

Can I switch from the Google Distance Matrix API?

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.

Where does the map data come from?

From OpenStreetMap, processed on Wayline's own routing infrastructure. Every response includes the region and map version used. Map data © OpenStreetMap contributors.

Do you have SDKs?

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.

Start building in minutes

Create an account, grab a test key and make your first request in under five minutes.