{"openapi":"3.1.0","info":{"title":"Polyline API","version":"1.0.0","description":"Encode and decode Google/Mapbox encoded polylines — the compact ASCII string used by the Google Maps Directions API, Mapbox, Valhalla, OSRM and GPX-style route geometry to pack a list of coordinates into a few bytes. Decode an encoded string into an array of latitude/longitude points, encode a coordinate list back into a polyline (precision 5, the Google default, or 6 for OSRM/Valhalla overview), and measure a path — point count, total length by the haversine great-circle formula in km and miles, and the bounding box. Perfect for drawing routes on a map, storing tracks compactly, computing trip distance and fitting a map viewport. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. Distinct from coordinate-format conversion (Plus Code/MGRS/UTM) and geohash.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/polyline-api","description":"oanor gateway"}],"tags":[{"name":"Polyline"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/decode":{"get":{"operationId":"get_v1_decode","tags":["Polyline"],"summary":"Decode a polyline to coordinates","description":"","parameters":[{"name":"polyline","in":"query","required":true,"description":"Encoded polyline string","schema":{"type":"string"},"example":"_p~iF~ps|U_ulLnnqC_mqNvxq`@"},{"name":"precision","in":"query","required":false,"description":"1-12 (default 5; OSRM/Valhalla use 6)","schema":{"type":"string"},"example":"5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"precision":5,"coordinates":[{"lat":38.5,"lng":-120.2},{"lat":40.7,"lng":-120.95},{"lat":43.252,"lng":-126.453}],"point_count":3},"meta":{"timestamp":"2026-06-02T16:51:50.532Z","request_id":"b40f7030-7f97-49e4-916a-ce839b559d4d"},"status":"ok","message":"Decode an encoded polyline to coordinates","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/encode":{"get":{"operationId":"get_v1_encode","tags":["Polyline"],"summary":"Encode coordinates to a polyline","description":"","parameters":[{"name":"coordinates","in":"query","required":true,"description":"JSON array of [lat,lng] pairs","schema":{"type":"string"},"example":"[[38.5,-120.2],[40.7,-120.95],[43.252,-126.453]]"},{"name":"precision","in":"query","required":false,"description":"1-12 (default 5)","schema":{"type":"string"},"example":"5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"polyline":"_p~iF~ps|U_ulLnnqC_mqNvxq`@","precision":5,"point_count":3},"meta":{"timestamp":"2026-06-02T16:51:50.634Z","request_id":"00866047-67d0-49b0-a05c-8250f124b264"},"status":"ok","message":"Encode coordinates to a polyline","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/info":{"get":{"operationId":"get_v1_info","tags":["Polyline"],"summary":"Path stats: points, length, bbox","description":"","parameters":[{"name":"polyline","in":"query","required":true,"description":"Encoded polyline string","schema":{"type":"string"},"example":"_p~iF~ps|U_ulLnnqC_mqNvxq`@"},{"name":"precision","in":"query","required":false,"description":"1-12 (default 5)","schema":{"type":"string"},"example":"5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"bbox":{"max_lat":43.252,"max_lng":-120.2,"min_lat":38.5,"min_lng":-126.453},"length_km":788.90696,"precision":5,"point_count":3,"length_miles":490.203907},"meta":{"timestamp":"2026-06-02T16:51:50.724Z","request_id":"7066eb11-c588-4065-ace5-e29659fd42ef"},"status":"ok","message":"Path stats for an encoded polyline","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"name":"Polyline API","notes":"Precision 5 is the Google Maps default; Valhalla/OSRM-overview often use 6. Pure local computation, nothing stored.","version":"v1","endpoints":[{"path":"/v1/decode","params":{"polyline":"encoded string (required)","precision":"1-12, default 5"},"returns":"array of {lat,lng}"},{"path":"/v1/encode","params":{"precision":"1-12, default 5","coordinates":"JSON array of [lat,lng] pairs (required)"},"returns":"encoded polyline string"},{"path":"/v1/info","params":{"polyline":"encoded string (required)","precision":"1-12, default 5"},"returns":"point_count, length (km+miles, haversine), bounding box"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Encode and decode Google/Mapbox encoded polylines and measure the resulting path."},"meta":{"timestamp":"2026-06-02T16:51:50.823Z","request_id":"7173826c-6b85-4396-87ff-48fa33931dd1"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":1080,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":270,"monthly_call_quota":9300,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2220,"monthly_call_quota":141000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5820,"monthly_call_quota":725000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/polyline-api"}