views:

524

answers:

7

Is it possible to use the Google Maps API router just using HTTP? Something like http://maps.google.com?from=blah?to=blah

And have it return some sort of XML or JSON representing the directions?

+1  A: 

Here you can find a list of parameters you can pass to the maps.google.com URL. Maybe you'll be able to get the information you need. I don't know what the returned output contains. At least you are able to define different output types.

MicSim
A: 

I've never used the API but it is pretty easy to get the structured directions data from a google maps page using JS to access the gmap page's DOM.

fsb
+2  A: 

There is no documented and approved method to access driving directions via an HTTP API request.

This makes it difficult to get driving directions on the server-side, which I assume is your intention.

Not only it is undocumented and difficult to achieve, but it would also violate the restrictions 10.1 and 10.5 of the Google Maps API Terms and Conditions.

However, if you don't mind the challenge, and you believe that rules are there to be broken, you may want to check these articles:

Daniel Vassallo
+1  A: 

I have already used this library with python and it works well, although it's against Google Maps API Terms.

jbochi
+2  A: 

If you want Google to allow legal access to driving directions via HTTP you might consider voting for the enhancement request: Issue 235. Theoretically, the more people that vote for an enhancement request, the more attention Google give to it.

However, I strongly suspect that there might be contractual issues with the organisations that supply the data. Organisations like TeleAtlas impose restrictions about how Google can use their data. TeleAtlas probably don't want Google to make it legal for people to use their data to create apps for free that directly compete with their own commercial apps and devices.

Mike Williams
+1  A: 

Actually yes, and they do it themselves

The REST format is like:

http://maps.google.com/maps/nav?output=js&q=from:%20Montreal%20to:%20Toronto&key=apikey

Where q should have the form: "from: x to: y" (url encoded).

Some of the parameters are similar to the HTTP Geocoding service: http://code.google.com/apis/maps/documentation/geocoding/index.html

Mike

Mike Gleason jr Couturier