I started in the python library, and have come back to the base API to confirm the same behavior. I am trying to route from an island back to the mainland, which has a ferry connection, but I cannot get the route returned in the API.
body = {“coordinates”:[[-70.0918500, 41.2767560],[-72.2648160, 41.8823860]]}
headers = {
‘Accept’: ‘application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8’,
‘Authorization’: api_key,
‘Content-Type’: ‘application/json; charset=utf-8’
}
call = requests.post(‘https://api.openrouteservice.org/v2/directions/driving-car/json’, json=body, headers=headers)
I receive this error:
{“error”:{“code”:2009,“message”:“Route could not be found - Unable to find a route between points 1 (-70.0918500 41.2767560) and 2 (-72.2648160 41.8823860).”},“info”:{“engine”:{“build_date”:“2024-12-02T11:09:21Z”,“graph_version”:“1”,“version”:“9.0.0”},“timestamp”:1738117008169}}
The same query into the map will generate a route. I did notice in the json, instead of graph_version:1, it has graph_date:2025-01-22T01:20:38Z. I copied the query syntax from the map gui and still get the same error above.
maps.openrouteservice.org
Anyone have pointers of where to look next?