I need to calculate a lot of distances between several cities in Germany which are identified by a postal code, e.g. 10115 for Berlin. I cannot use the Google Maps Distance Matrix API because it would be way too expensive for the amount of requests (even with caching).

Does anybody know a self-hosted/offline API (maybe based on OSM?) where I can request a distance matrix/list of distances between cities identified by postal codes? Unfortunately, I couldn't find anything by Googling.

  • not an api but download.geofabrik.de/europe/germany.html has shapefiles with postal codes you cab qgis to calculate the distances locally on your pc.
    – Mapperz
    May 20, 2018 at 20:31
  • thanks for your suggestion @Mapperz, but I need to calculate distances in a PHP/Java/NodeJS backend, so using qgis is not an option
    – Maxbit
    May 21, 2018 at 8:36

1 Answer 1


The TravelTime Search API is a cheaper alternative to Google distance matrix however it is not self hosted / offline. But they do offer a service where you can send a CSV of all origins & destinations and get a matrix of journey times back https://www.traveltimeplatform.com/analytics/

However you can use an API if it doesn't need to be self hosted / offline you can use the free geocoder to translate points in Germany into lat longs http://docs.traveltimeplatform.com/reference/geocoding-search/ and then select an origin and query against 1000s of destinations in a single API request. Use time filter for this http://docs.traveltimeplatform.com/reference/time-filter/

Disclaimer: I work for the creators of the API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.