GoogleDistanceMatrixAPIMicroservice

A Spring Boot project for Google Distance Matrix API to find road distance between two points based on location name or pin code.
Made with ♥ in Java

Steps to excution:

  1. Execute the DemoApplication.java file
  2. An Tomcat server instance will be started at port: 8080.
  3. Access this server through your browser using localhost:8080.
  4. To use the API enter the following in the url:
    1. JSON String: http://localhost:8080/distance/json/{start}to{end}
      Replace {start} and {end} with respective places/pin-codes.
    2. Plain String: http://localhost:8080/distance/{start}to{end}
      Replace {start} and {end} with respective places/pin-codes.
  5. Get output.

Output Format

  1. JSON String
    Sample input: http://localhost:8080/distance/json/MumbaitoThane
    {
       "Starting Location":"Mumbai, Maharashtra, India",
       "Duration":"32 mins",
       "Ending Location":"Thane, Maharashtra, India",
       "Distance":"22.7 km"
    }
  2. Plain String
    Sample input: http://localhost:8080/distance/MumbaitoThane
    Distance is: 22.7 km
    Duration is: 32 mins
    Starting Location: Mumbai, Maharashtra, India
    Ending Location: Thane, Maharashtra, India