0

When i try to calculate the distance between Paris and an other city in France, Google API returns a random result. It returns the right distance or ZERO_RESULTS

I use Postman application. I create GET request :

https://maps.googleapis.com/maps/api/distancematrix/json?units=METRIC&mode=WALKING&origins=BRY SUR MARNE , VAL-DE-MARNE , FR&destinations=PARIS , PARIS , FR&key=MY_KEY

API Google returns :

{
    "destination_addresses": [
        "4100 Lake Dr SE Suite 300, Grand Rapids, MI 49546, USA"
    ],
    "origin_addresses": [
        "94360 Bry-sur-Marne, France"
    ],
    "rows": [
        {
            "elements": [
                {
                    "status": "ZERO_RESULTS"
                }
            ]
        }
    ],
    "status": "OK"
}

1 Answers1

0

This is an intended behavior because the destination address is in the USA while the origin is in France which doesn't have any available routes towards each other, If the destination address is not the intended address, I'd suggest that you supply the well-formatted address to avoid this kind of errors.

Shawn Domingo
  • 1,371
  • 1
  • 11
  • 16