Is it possible to generate a KML file of searched items in Google Maps? For example:

  • Search for highschools in Virginia
  • Return the results as a KML file with the schoolname address and location

2 Answers 2


Yes, click the Link on Google Maps to expose the full url of the map location and search. add '&output=kml' to the end >save file open in Google Earth or overlay on Google Maps


[Note I don't think this is officially accepted - just possible]

  • although this method works fine, it'll only return the list of points with a label on them, i.e. the first 10 points. The second thing is, it'll display items outside of the region / state, which is not a real issue, but the first issue is crucial
    – dassouki
    Nov 12, 2010 at 15:57
  • You can use The Google AJAX API & Google Maps API to display 20 markers[limitation] code.google.com/apis/ajax/playground/#localsearch_with_markers
    – Mapperz
    Nov 12, 2010 at 18:52
  • 1
    @dassouki, I was able to find the coordinates in that file, they are within the placemark tag. It still sucks though that you can only export 10 at a time. I also see you can only have a search at max return 200 results.
    – Andy W
    Nov 13, 2010 at 3:04

I can't quite figure out what the second set of coordinates are in the search string Mapperz provided, but if you look at the page source you can see urls for subsequent pages in the maps search

so for the first 10 results


results 11 to 20


results 21 to 30



You could build a scraper with this (just add the &output=kml to the end of the string as Mapperz suggested, it appears the coordinates are only in the kml file, not in the original url source) but the problem is that the query itself only returns at max 200 results. You could add to this a spatially varying search term (i.e. plus or minus the latitude and longitude) to cover the whole state. (Also I thought at first you could just save all of the data if you used Google Earth directly, but this is not the case and it is exactly the same as using the Google Maps search.) I wouldn't be surprised if there is more magic in the url that you could use to your advantage in building a scraper that I am unaware of.

This map comparing density of grocery stores to bars uses data collected from Google, so maybe you could ask the makers how they pulled the data.

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.