RoutingroutingoperationId match
POST/v1/match
Match a GPS trace onto the roads (Newson–Krumm HMM): per point the edge and position it most likely lies on, the matched route, its length and duration, and a confidence.
Send Authorization: Bearer sk_live_…. The key's plan must include therouting product; which plans do.
Explained in Map matching and Cleaning GPS traces.
Example
A two-minute GPS trace.
curl -X POST "https://api.oslew.com/v1/match" \
-H "Authorization: Bearer $GEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"points":[{"lat":19.419276,"lon":-99.179338,"time":1790175600},{"lat":19.418751,"lon":-99.179701,"time":1790175605},{"lat":19.41867,"lon":-99.179614,"time":1790175610},{"lat":19.418502,"lon":-99.179014,"time":1790175615},{"lat":19.418286,"lon":-99.178608,"time":1790175620},{"lat":19.417033,"lon":-99.179268,"time":1790175625},{"lat":19.416802,"lon":-99.179338,"time":1790175630},{"lat":19.416776,"lon":-99.178855,"time":1790175635},{"lat":19.416914,"lon":-99.178812,"time":1790175640},{"lat":19.418012,"lon":-99.178069,"time":1790175645},{"lat":19.418268,"lon":-99.178079,"time":1790175650},{"lat":19.418769,"lon":-99.177802,"time":1790175655},{"lat":19.419165,"lon":-99.177555,"time":1790175660},{"lat":19.419798,"lon":-99.177323,"time":1790175665},{"lat":19.419971,"lon":-99.177179,"time":1790175670},{"lat":19.420875,"lon":-99.177583,"time":1790175675},{"lat":19.421131,"lon":-99.177514,"time":1790175680},{"lat":19.42292,"lon":-99.177679,"time":1790175685},{"lat":19.423246,"lon":-99.176215,"time":1790175690},{"lat":19.42322,"lon":-99.175986,"time":1790175695},{"lat":19.423306,"lon":-99.175722,"time":1790175700},{"lat":19.423814,"lon":-99.174224,"time":1790175705},{"lat":19.424459,"lon":-99.172921,"time":1790175710},{"lat":19.424828,"lon":-99.172014,"time":1790175715},{"lat":19.425023,"lon":-99.171867,"time":1790175720}],"geometry":false}'from oslew import Client
# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")
answer = client.match(
{
"points": [
{"lat": 19.419276, "lon": -99.179338, "time": 1790175600},
{"lat": 19.418751, "lon": -99.179701, "time": 1790175605},
{"lat": 19.41867, "lon": -99.179614, "time": 1790175610},
{"lat": 19.418502, "lon": -99.179014, "time": 1790175615},
{"lat": 19.418286, "lon": -99.178608, "time": 1790175620},
{"lat": 19.417033, "lon": -99.179268, "time": 1790175625},
{"lat": 19.416802, "lon": -99.179338, "time": 1790175630},
{"lat": 19.416776, "lon": -99.178855, "time": 1790175635},
{"lat": 19.416914, "lon": -99.178812, "time": 1790175640},
{"lat": 19.418012, "lon": -99.178069, "time": 1790175645},
{"lat": 19.418268, "lon": -99.178079, "time": 1790175650},
{"lat": 19.418769, "lon": -99.177802, "time": 1790175655},
{"lat": 19.419165, "lon": -99.177555, "time": 1790175660},
{"lat": 19.419798, "lon": -99.177323, "time": 1790175665},
{"lat": 19.419971, "lon": -99.177179, "time": 1790175670},
{"lat": 19.420875, "lon": -99.177583, "time": 1790175675},
{"lat": 19.421131, "lon": -99.177514, "time": 1790175680},
{"lat": 19.42292, "lon": -99.177679, "time": 1790175685},
{"lat": 19.423246, "lon": -99.176215, "time": 1790175690},
{"lat": 19.42322, "lon": -99.175986, "time": 1790175695},
{"lat": 19.423306, "lon": -99.175722, "time": 1790175700},
{"lat": 19.423814, "lon": -99.174224, "time": 1790175705},
{"lat": 19.424459, "lon": -99.172921, "time": 1790175710},
{"lat": 19.424828, "lon": -99.172014, "time": 1790175715},
{"lat": 19.425023, "lon": -99.171867, "time": 1790175720},
],
"geometry": False,
},
)import { Client } from "@oslew/client";
// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });
const answer = await client.match({
points: [
{ lat: 19.419276, lon: -99.179338, time: 1790175600 },
{ lat: 19.418751, lon: -99.179701, time: 1790175605 },
{ lat: 19.41867, lon: -99.179614, time: 1790175610 },
{ lat: 19.418502, lon: -99.179014, time: 1790175615 },
{ lat: 19.418286, lon: -99.178608, time: 1790175620 },
{ lat: 19.417033, lon: -99.179268, time: 1790175625 },
{ lat: 19.416802, lon: -99.179338, time: 1790175630 },
{ lat: 19.416776, lon: -99.178855, time: 1790175635 },
{ lat: 19.416914, lon: -99.178812, time: 1790175640 },
{ lat: 19.418012, lon: -99.178069, time: 1790175645 },
{ lat: 19.418268, lon: -99.178079, time: 1790175650 },
{ lat: 19.418769, lon: -99.177802, time: 1790175655 },
{ lat: 19.419165, lon: -99.177555, time: 1790175660 },
{ lat: 19.419798, lon: -99.177323, time: 1790175665 },
{ lat: 19.419971, lon: -99.177179, time: 1790175670 },
{ lat: 19.420875, lon: -99.177583, time: 1790175675 },
{ lat: 19.421131, lon: -99.177514, time: 1790175680 },
{ lat: 19.42292, lon: -99.177679, time: 1790175685 },
{ lat: 19.423246, lon: -99.176215, time: 1790175690 },
{ lat: 19.42322, lon: -99.175986, time: 1790175695 },
{ lat: 19.423306, lon: -99.175722, time: 1790175700 },
{ lat: 19.423814, lon: -99.174224, time: 1790175705 },
{ lat: 19.424459, lon: -99.172921, time: 1790175710 },
{ lat: 19.424828, lon: -99.172014, time: 1790175715 },
{ lat: 19.425023, lon: -99.171867, time: 1790175720 },
],
geometry: false,
});HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 294
ratelimit-reset: 1
{
"points": [
{
"lat": 19.419265833691888,
"lon": -99.1793149055659,
"from": 362390,
"to": 362686,
"along": 0.16342062635322144,
"distance_m": 2.6727302657997343
},
{
"lat": 19.418717279588495,
"lon": -99.1795863931191,
"from": 362686,
"to": 362687,
"along": 0,
"distance_m": 12.590083383713226
},
{
"lat": 19.418717279588495,
"lon": -99.1795863931191,
"from": 362686,
"to": 362687,
"along": 0,
"distance_m": 6.001708302961281
},
{
"lat": 19.418447264747087,
"lon": -99.17902412186542,
"from": 362688,
"to": 361352,
"along": 0,
"distance_m": 6.1781608772235606
},
{
"lat": 19.41828749262708,
"lon": -99.17860207985096,
"from": 361352,
"to": 362389,
"along": 0.045549726075291,
"distance_m": 0.6426478129502552
}
],
"speed_limits_kmh": [
50,
null,
null,
null,
null
],
"classes": [
"primary",
"residential",
"residential",
"residential",
"residential"
],
"geometry": [],
"distance_m": 1835,
"duration_s": 154.9,
"confidence": 0.8,
"matched": 25,
"unmatched": 0,
"provenance": {
"name": "overture-transportation",
"release": "2026-08-19.0",
"license": "ODbL-1.0"
},
"took_us": 3881
}A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call. Shortened for the page: points shows 5 of 25. Shortened for the page: speed_limits_kmh shows 5 of 25. Shortened for the page: classes shows 5 of 25.
Body
application/json, required.
pointsobject[]required≤ 10000 itemslatnumberrequiredlonnumberrequiredtimeinteger | null
geometrybooleanprofilestringThe mode whose network to match onto.driving | walking | cycling | railsearch_mnumber≥ 5, ≤ 200How far from a point a road may be, metres.sigma_mnumber≥ 1, ≤ 50The GPS noise, metres.
Responses
200 — The match.
classes(string | null[])requiredThe class of each matched edge.confidencenumberrequired≥ 0, ≤ 1distance_mnumberrequiredduration_snumberrequiredgeometrynumber[][]requiredmatchedintegerrequiredpoints(Matched | null[])requiredalongnumberrequired0..1 along the edge.distance_mnumberrequiredFrom the observed point.fromintegerrequiredlatnumberrequiredlonnumberrequiredtointegerrequired
provenanceSourcerequiredlicensestringrequirednamestringrequiredreleasestringrequired
speed_limits_kmh(integer | null[])requiredThe posted limit on each matched edge.took_usintegerrequiredunmatchedintegerrequired
With RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset(and their X-RateLimit-* aliases); see rate limits.
Refusals
Every refusal is a JSON object with an error string, except where noted.
| 400 | Bad request. |
| 401 | No key, or one that is unknown, revoked or suspended. |
| 403 | The key's plan does not include this route's product, or the request is larger than the plan allows. The body names the plan that does. |
| 429 | This product's bucket is empty: the key is going faster than its plan's sustained rate. Wait Retry-After seconds; nothing is used up. Carries Retry-After. |
| 503 | The pod cannot reach the control plane and its entitlements are too old to trust. Retry. |
A malformed query string or JSON body is refused by the framework before this route runs, in plain text rather than JSON; see errors.
Rendered from the OpenAPI document at commit b8f4bde-dirty; the same document is served at/v1/openapi.json and generates both clients.