Public API: places of one category along a route, with detour times (metered)
const url = 'https://api.tareky.com/v1/poi/along-route';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"route":"example","routeFormat":"polyline","categoryId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","buffer":300,"from":{"lng":1,"lat":1},"maxAheadMeters":1,"take":10,"detour":true,"sortBy":"along"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tareky.com/v1/poi/along-route \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "route": "example", "routeFormat": "polyline", "categoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "buffer": 300, "from": { "lng": 1, "lat": 1 }, "maxAheadMeters": 1, "take": 10, "detour": true, "sortBy": "along" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Legacy key id (until its sunset)
Request Bodyrequired
Section titled “Request Bodyrequired”object
The route as an encoded polyline, 2 to 10,000 points, which must enter Iraq
Precision of route: polyline is Google precision 5 (what /directions returns), polyline6 precision 6
Required: one category keeps the corridor query to milliseconds
Metres either side of the route
Where the driver is: places behind it are left out, and aheadMeters counts from it
object
Only places within this many metres of from along the route (default: the rest of it)
Price each place as a detour from the route; false skips the routing engine
detour ranks the first 20 places ahead by detour time (the same as along when detour is false)
Responses
Section titled “Responses”object
Length of the whole route that was sent
Where from sits along the route, in metres from its start; null when no from was sent
object
object
object
object
Mean review rating, 0 when there are no reviews
Metres from the start of the route to the place
Metres from from (or the start of the route) to the place, along the route
Distance from the route line to the place
Extra driving time to visit the place and rejoin the route; null when it could not be priced
Extra driving distance, same rule
Examplegenerated
{ "routeLengthMeters": 1, "fromAlongMeters": 1, "data": [ { "id": "example", "lng": 1, "lat": 1, "categoryId": "example", "name": { "ar": "example", "en": "example", "ckb": "example" }, "category": { "id": "example", "name": { "ar": "example", "en": "example", "ckb": "example" } }, "avgRating": 1, "reviewCount": 1, "alongMeters": 1, "aheadMeters": 1, "offRouteMeters": 1, "detourSeconds": 1, "detourMeters": 1 } ]}Rate limit or monthly quota exceeded; see Retry-After
object
object
Stable machine-readable code, e.g. quota_exceeded, no_route
For invalid_request: the validation issues
Examplegenerated
{ "error": { "code": "example", "message": "example", "status": 1, "details": "example", "docsUrl": "example" }, "requestId": "example"}default
Section titled “default”Any other error, in the /v1 error envelope
object
object
Stable machine-readable code, e.g. quota_exceeded, no_route
For invalid_request: the validation issues
Examplegenerated
{ "error": { "code": "example", "message": "example", "status": 1, "details": "example", "docsUrl": "example" }, "requestId": "example"}