I am trying this URL straight from documentation, and it works fine, showing a route consisting of walkable sections as well as sections to be plied by public transport:
However, when I try this on another route, it says that no route is available:
https://transit.router.hereapi.com/v8/routes?apiKey={key}&origin=22.50,88.36&destination=22.64,88.43
The two coordinates are incidentally, two places in Kolkata, a city in India - one can just Google them (Jodhpur Park coordinates
and Dum Dum coordinates
) and Google actually offers a public transit between those two places, suggesting that public transit does exist between those two places:
Can anyone tell me how to make Here API return the public transit data for these route? Or are there routes where public transit data is not available, even in an otherwise metro city like Kolkata?
TL;DR
If you include more digits in your second API request coordinates, as many as you have in your first request, this should resolve your issue.
The full URL (with excluded API key) is:
I have a live demo of this below the detailed answer below where you can paste in your API key and run the query to see this in action.
Detailed answer
In your second example, your latitude and longitude coordinates need to be more specific, as they do not match the actual locations you are looking for transit directions from/to.
Instead of using
Use ✅
I pulled these coordinates from Google for both locations…
Searching "Jodhpur Park coordinates":
Searching "Dum Dum coordinates":
The full URL (with excluded API key) is:
The resulting JSON data produces three different transit routes.
LIVE DEMO
Here is a demo of this in action where you can securely use your own API key as well as adjust the Origin and Destination lat/lng coordinates as needed to generate data from the API: