Route4Me API Documentation

Address Distance

This API call will always respond with an numeric value of the distance between the two points. If the two points are the same, or are not found, then the response will be zero.

Sample Request URL: http://www.route4me.com/api/distance.php?start=lax&end=sfo

 

Method Parameter Type Required Default Description
GET api_key String Yes N/A A valid and active API key obtained from authentication or a user's API control panel.
GET start String Yes N/A The origin address or coordinates.
GET end String Yes N/A The destination address or coordinates.
GET optimize ENUM(Distance, Time,
timeWithTraffic)
No timeWithTraffic The method to use when determining the distance between the two points.
GET distanceUnit ENUM(mi, km) No mi The distance will be returned in this measurement unit.
GET travelMode ENUM(Driving, Walking) No Driving The transportation mode to use when calculating the distance.

 

Sample XML Response:

 

<?xml version="1.0" encoding="UTF-8" ?><destinations> <destination  destination="Los Angeles International Airport, CA" lat="33.945705" lng="-118.391105" type="airport" confidence="high"/> <destination  destination="San Francisco International Airport, CA" lat="37.614663" lng="-122.391853" type="airport" confidence="high"/> <destination  destination="Boston, MA" lat="42.35863" lng="-71.05670" type="populatedplace" confidence="high"/> <destination  destination="Boston, GA" lat="30.79561" lng="-83.78629" type="populatedplace" confidence="high"/> <destination  destination="Boston, NY" lat="42.65295" lng="-78.74477" type="populatedplace" confidence="high"/> <destination  destination="Boston, AR" lat="35.84012" lng="-93.60345" type="populatedplace" confidence="high"/> <destination  destination="Boston, TN" lat="35.85051" lng="-87.03492" type="populatedplace" confidence="high"/></destinations>