GET or POST /v1/staticmap
Static Maps API for route images with numbered stops
Request and response
curl "https://api.wayline.cloud/v1/staticmap?size=1280x800&scale=2&path=color%3A0x2563eb%7Cweight%3A5%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376&markers=numbered%3A1%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376" \
-H "Authorization: Bearer $WAYLINE_API_KEY"const res = await fetch(
"https://api.wayline.cloud/v1/staticmap?size=1280x800&scale=2&path=color%3A0x2563eb%7Cweight%3A5%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376&markers=numbered%3A1%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376",
{ 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/staticmap",
params={"size": "1280x800", "scale": "2", "path": "color:0x2563eb|weight:5|23.7925,90.4078|23.7937,90.4066|23.7639,90.3889|23.7465,90.376", "markers": "numbered:1|23.7925,90.4078|23.7937,90.4066|23.7639,90.3889|23.7465,90.376"},
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/staticmap?size=1280x800&scale=2&path=color%3A0x2563eb%7Cweight%3A5%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376&markers=numbered%3A1%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376", 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/staticmap?size=1280x800&scale=2&path=color%3A0x2563eb%7Cweight%3A5%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376&markers=numbered%3A1%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376");
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/staticmap?size=1280x800&scale=2&path=color%3A0x2563eb%7Cweight%3A5%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376&markers=numbered%3A1%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376")
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/staticmap?size=1280x800&scale=2&path=color%3A0x2563eb%7Cweight%3A5%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376&markers=numbered%3A1%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376"))
.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/staticmap?size=1280x800&scale=2&path=color%3A0x2563eb%7Cweight%3A5%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376&markers=numbered%3A1%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376'),
headers: {'Authorization': 'Bearer ${Platform.environment['WAYLINE_API_KEY']}'},
);
print(jsonDecode(res.body));
}HTTP/1.1 200 OK
Content-Type: image/png
X-Map-Zoom: 14
X-Map-Center: 23.752310,90.384120
X-Units-Charged: 1
X-Cache: MISS
<2560 x 1600 PNG: your route and numbered stops, © OpenStreetMap contributors>What the Static Maps API gives you
Route geometry in, image out
Pass routes[0].geometry from the Routing API unchanged (encoded polyline, precision 5 or 6), or a list of points. POST a JSON body when a long day's path outgrows a URL.
Numbered stops and clear start/end
markers=numbered:1 labels a whole day of stops 1, 2, 3 in one parameter. Start and end styles, colors and letters are built in.
Retina sharp, zoom friendly
Up to 1280x1280 with scale=2 (2560 px wide), so the image stays sharp when your app or website lets people zoom in 2 to 4 times.
Attribution included
“© OpenStreetMap contributors” is drawn on every image, so the ODbL attribution requirement is met without extra work on your side.
How the Static Maps API works
Wayline fits the view to every path vertex and marker (or uses your center and zoom), draws the base map from its own OpenStreetMap tiles, then draws your paths with a white casing and your markers on top. Images are cached on the server by a hash of their parameters; one unit is billed per image, cached or fresh.
Built for field reports
Route a rep's day with the Routing API (profile=motorcycle), then render the polyline and the numbered check-ins as one image to attach to the daily report. Both calls use the same API key and the same map data.
Frequently asked questions
Is a cached image billed?
Yes. Every image returned with HTTP 200 costs one static_map unit, whether it was rendered fresh or served from our one-hour cache, so the price never depends on our cache. Errors are never billed.
How long can the path be?
Up to 25,000 points over 10 paths. Keep GET URLs under 16 KB (use overview=simplified on /v1/route); for longer paths, POST the same parameters as JSON.
Which areas have maps?
Regions with map tiles, starting with Bangladesh, where street names in Dhaka are readable at zoom 15 to 16. The Coverage page lists each region's map data date.
Start building in minutes
Create an account, grab a test key and make your first request in under five minutes.